_v2_physical_interface

Module Contents

Classes

V2PhysicalInterface

Implementation of PhysicalInterface for V2 modular robots.

class V2PhysicalInterface(debug: bool, dry: bool)

Bases: modular_robot_physical.physical_interfaces._physical_interface.PhysicalInterface

Inheritance diagram of modular_robot_physical.physical_interfaces.v2._v2_physical_interface.V2PhysicalInterface

Implementation of PhysicalInterface for V2 modular robots.

set_servo_targets(pins: list[int], targets: list[float]) None

Set the target for multiple servos.

This can be a fairly slow operation.

Parameters:
  • pins – The GPIO pin numbers.

  • targets – The target angles.

enable() None

Start the robot.

disable() None

Set the robot to low power mode.

This disables all active modules and sensors.

get_battery_level() float

Get the battery level.

Returns:

The battery level as a number between 0.0 and 1.0.

get_multiple_servo_positions(pins: Sequence[int]) list[float]

Get the current position of multiple servos.

Parameters:

pins – The GPIO pin numbers.

Returns:

The current positions.

get_imu_angular_rate() pyrr.Vector3

Get the angular rate from the IMU.

Returns:

The angular rate.

Raises:

RuntimeError – When imu could not be read.

get_imu_orientation() pyrr.Vector3

Get the orientation from the IMU.

Returns:

The orientation.

Raises:

RuntimeError – When imu could not be read.

get_imu_specific_force() pyrr.Vector3

Get the specific force from the IMU.

Returns:

The specific force.

Raises:

RuntimeError – When imu could not be read.

get_camera_view() numpy.typing.NDArray[numpy.uint8] | None

Get the current view from the camera.

Returns:

An image captured from robohatlib.