brain
Modular robot brain interface and implementations.
Subpackages
Package Contents
Classes
The brain of a modular robot. |
|
An instance of a brain that perform the control of a robot. |
- class Brain
Bases:
abc.ABC
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
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.