Overview#
robot_py.RobotInterface organizes motors, the IMU, joint mappings, and closed-chain transformations according to a YAML configuration. The constructor creates hardware interfaces; read the YAML directly for offline configuration checks.
Construction and actions#
robot_py.RobotInterface(config_file)
robot.apply_action(p, v=[], kp=[], kd=[], tau=[])p contains target joint positions. When optional vectors are empty, velocity and feedforward terms are filled with zeros, and gains come from the robot configuration. All vectors follow the joint order defined by the configuration. p must match the joint count, and every other nonempty vector must have the same length; validate lengths before calling.
State layers#
| Method | Data or operation layer |
|---|---|
init_motors() / deinit_motors() |
Motor lifecycle |
read_joints() |
Converts the motor driver cache into the joint cache without actively requesting feedback |
refresh_joints() |
Requests motor status, waits approximately 1 second, then updates the joint cache |
read_imu() |
Transforms cached IMU data into the body frame and updates the body cache |
get_joint_q() / get_joint_vel() |
Joint cache, rad / rad/s |
get_joint_tau() |
Cached joint feedback; the underlying physical quantity depends on the motor driver |
get_quat() / get_ang_vel() |
Body cache, wxyz / rad/s |
reset_joints(joint_default_angle) |
Smoothly resets the target and sends actions |
set_zeros() / clear_errors() |
Sends zeroing / error-clear requests |
Joint getters throw Motors are not initialized before initialization; body getters throw IMU is not initialized when no IMU object exists.
Meaning of the initialization state#
The read-only property is_init indicates the object's motor initialization state. After initialization, check communication, health, and calibration for each motor; the implementation does not aggregate driver return codes when setting is_init.
set_zeros() does not aggregate the drivers' Boolean returns; clear_errors() sends clear requests. Confirm persistent writes and fault recovery using actual feedback, device state, and the applicable procedures.
Concurrency and cleanup#
In the Python bindings, only reset_joints() explicitly releases the GIL. The destructor deinitializes motors if they were initialized and releases resources; physical robot applications should still manage their exit paths explicitly rather than waiting for abnormal process termination.
The upstream minimal example uses an RPO configuration and sends apply_action. Before integrating RP1, verify the configuration and action conventions. See Minimal integration examples to select an example.