brain

Modular robot brain interface and implementations.

Subpackages

Package Contents

Classes

Brain

The brain of a modular robot.

BrainInstance

An instance of a brain that perform the control of a robot.

class Brain

Bases: abc.ABC

Inheritance diagram of modular_robot.brain.Brain

The brain of a modular robot.

Inherit from this to implement your own brain. Each brain implements the make_instance function, which create the actual brain instance that control the robot. The instance contains all the state associated with the control strategy; this class must be stateless.

abstract make_instance() modular_robot.brain._brain_instance.BrainInstance

Create an instance of this brain.

Returns:

The created instance.

class BrainInstance

Bases: abc.ABC

Inheritance diagram of modular_robot.brain.BrainInstance

An instance of a brain that perform the control of a robot.

Instances of this class can be stateful.

abstract control(dt: float, sensor_state: modular_robot.sensor_state.ModularRobotSensorState, control_interface: modular_robot._modular_robot_control_interface.ModularRobotControlInterface) None

Control the modular robot.

Parameters:
  • dt – Elapsed seconds since last call to this function.

  • sensor_state – Interface for reading the current sensor state.

  • control_interface – Interface for controlling the robot.