_build_multi_body_systems

Builders for simulating modular robots.

Package Contents

Classes

BodyToMultiBodySystemConverter

A tool to convert modular robot bodies to multi-body systems.

BodyToMultiBodySystemMapping

Mappings from bodies to multi-body system objects.

class BodyToMultiBodySystemConverter

A tool to convert modular robot bodies to multi-body systems.

convert_robot_body(body: revolve2.modular_robot.body.base.Body, pose: revolve2.simulation.scene.Pose, translate_z_aabb: bool) tuple[revolve2.simulation.scene.MultiBodySystem, modular_robot_simulation._build_multi_body_systems._body_to_multi_body_system_mapping.BodyToMultiBodySystemMapping]

Convert a modular robot body to a multi-body system.

Parameters:
  • body – The body to convert.

  • pose – The pose to put the multi-body system in. Ownership will be taken of the pose object and it should not be reused after passing it to this function.

  • translate_z_aabb – Whether the robot should be translated upwards so it’s T-pose axis-aligned bounding box is exactly on the ground. I.e. if the robot should be placed exactly on the ground. The pose parameters is still added afterwards.

Returns:

The created multi-body system, and a mapping from body to multi-body system.

class BodyToMultiBodySystemMapping

Mappings from bodies to multi-body system objects.

multi_body_system: revolve2.simulation.scene.MultiBodySystem
active_hinge_to_joint_hinge: dict[revolve2.simulation.scene.UUIDKey[revolve2.modular_robot.body.base.ActiveHinge], revolve2.simulation.scene.JointHinge]
active_hinge_sensor_to_joint_hinge: dict[revolve2.simulation.scene.UUIDKey[revolve2.modular_robot.body.sensors.ActiveHingeSensor], revolve2.simulation.scene.JointHinge]
imu_to_sim_imu: dict[revolve2.simulation.scene.UUIDKey[revolve2.modular_robot.body.sensors.IMUSensor], revolve2.simulation.scene.sensors.IMUSensor]
camera_to_sim_camera: dict[revolve2.simulation.scene.UUIDKey[revolve2.modular_robot.body.sensors.CameraSensor], revolve2.simulation.scene.sensors.CameraSensor]