_modular_robot_simulation_handler

Module Contents

Classes

ModularRobotSimulationHandler

Implements the simulation handler for a modular robot scene.

class ModularRobotSimulationHandler

Bases: revolve2.simulation.scene.SimulationHandler

Inheritance diagram of modular_robot_simulation._modular_robot_simulation_handler.ModularRobotSimulationHandler

Implements the simulation handler for a modular robot scene.

add_robot(brain_instance: revolve2.modular_robot.brain.BrainInstance, body_to_multi_body_system_mapping: modular_robot_simulation._build_multi_body_systems.BodyToMultiBodySystemMapping) None

Add a brain that will control a robot during simulation.

Parameters:
  • brain_instance – The brain.

  • body_to_multi_body_system_mapping – A mapping from body to multi-body system

handle(simulation_state: revolve2.simulation.scene.SimulationState, simulation_control: revolve2.simulation.scene.ControlInterface, dt: float) None

Handle a simulation frame.

Parameters:
  • simulation_state – The current state of the simulation.

  • simulation_control – Interface for setting control targets.

  • dt – The time since the last call to this function.