_sensor_state_impl

Sensor state implementations for the simulations.

Package Contents

Classes

ActiveHingeSensorStateImpl

Implements the active hinge sensor state.

CameraSensorStateImpl

The simulation implementation of the camera sensor state.

IMUSensorStateImpl

Implements the IMU sensor state.

ModularRobotSensorStateImpl

Implementation for ModularRobotSensorState.

class ActiveHingeSensorStateImpl(simulation_state: revolve2.simulation.scene.SimulationState, hinge_joint: revolve2.simulation.scene.JointHinge)

Bases: revolve2.modular_robot.sensor_state.ActiveHingeSensorState

Inheritance diagram of modular_robot_simulation._sensor_state_impl.ActiveHingeSensorStateImpl

Implements the active hinge sensor state.

property position: float

Get the measured position of the active hinge.

Returns:

The measured position.

class CameraSensorStateImpl(simulation_state: revolve2.simulation.scene.SimulationState, multi_body_system: revolve2.simulation.scene.MultiBodySystem, camera: revolve2.simulation.scene.sensors.CameraSensor)

Bases: revolve2.modular_robot.sensor_state.CameraSensorState

Inheritance diagram of modular_robot_simulation._sensor_state_impl.CameraSensorStateImpl

The simulation implementation of the camera sensor state.

property image: numpy.typing.NDArray[numpy.uint8]

Get the current image.

Returns:

The image.

class IMUSensorStateImpl(simulation_state: revolve2.simulation.scene.SimulationState, multi_body_system: revolve2.simulation.scene.MultiBodySystem, imu: revolve2.simulation.scene.sensors.IMUSensor)

Bases: revolve2.modular_robot.sensor_state.IMUSensorState

Inheritance diagram of modular_robot_simulation._sensor_state_impl.IMUSensorStateImpl

Implements the IMU sensor state.

property specific_force: pyrr.Vector3

Get the measured specific force.

Returns:

The measured specific force.

property angular_rate: pyrr.Vector3

Get the measured angular rate.

Returns:

The measured angular rate.

property orientation: pyrr.Quaternion

Get the measured orientation.

Returns:

The measured position.

class ModularRobotSensorStateImpl(simulation_state: revolve2.simulation.scene.SimulationState, body_to_multi_body_system_mapping: modular_robot_simulation._build_multi_body_systems.BodyToMultiBodySystemMapping)

Bases: revolve2.modular_robot.sensor_state.ModularRobotSensorState

Inheritance diagram of modular_robot_simulation._sensor_state_impl.ModularRobotSensorStateImpl

Implementation for ModularRobotSensorState.

get_active_hinge_sensor_state(sensor: revolve2.modular_robot.body.sensors.ActiveHingeSensor) revolve2.modular_robot.sensor_state.ActiveHingeSensorState

Get the state of the provided active hinge sensor.

Parameters:

sensor – The sensor.

Returns:

The state.

get_imu_sensor_state(sensor: revolve2.modular_robot.body.sensors.IMUSensor) revolve2.modular_robot.sensor_state.IMUSensorState

Get the state of the provided IMU sensor.

Parameters:

sensor – The IMU sensor.

Returns:

The IMU sensor state.

get_camera_sensor_state(sensor: revolve2.modular_robot.body.sensors.CameraSensor) revolve2.modular_robot.sensor_state.CameraSensorState

Get the state of the camera sensor.

Parameters:

sensor – The camera sensor.

Returns:

The camera sensor state.