API Reference
Robot Configuration
MOZ1RobotConfig
Main configuration class for setting robot parameters.
Constructor Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
realsense_serials | str | "0000000000,0000000000,0000000000" | RealSense camera serial numbers (comma-separated) |
camera_resolutions | str | "320*240,320*240,320*240" | Camera resolutions, format "width*height" |
no_camera | bool | False | Skip camera initialization (for testing) |
structure | str | "wholebody" | Robot configuration type |
robot_control_hz | int | 120 | Control loop frequency (Hz), should match robot control system settings |
enable_soft_realtime | bool | False | Enable soft real-time scheduling, requires running scripts/setup_rtprio.sh first |
bind_cpu_idxs | Optional[Sequence[int]] | None | CPU binding index list, e.g., [5] means bind to CPU core 5, index starts from 0 |
Supported Robot Structures:
dualarm: Dual arm configuration (left arm + right arm)wholebody_without_base: Whole body configuration without mobile base (dual arms + torso)wholebody: Whole body configuration with mobile base (dual arms + torso + base)
Configuration Examples:
from mozrobot import MOZ1RobotConfig
# Basic dual arm configuration
config = MOZ1RobotConfig(
realsense_serials="123456789,987654321,555666777",
camera_resolutions="640*480,640*480,640*480",
structure="dualarm",
robot_control_hz=120
)
# Test configuration without camera
config_no_cam = MOZ1RobotConfig(
no_camera=True,
structure="dualarm"
)
# Whole body configuration
config_wholebody = MOZ1RobotConfig(
structure="wholebody",
robot_control_hz=120
)
# High-performance real-time configuration
config_realtime = MOZ1RobotConfig(
structure="dualarm",
robot_control_hz=120,
enable_soft_realtime=True, # Enable soft real-time scheduling
bind_cpu_idxs=[5] # Bind to CPU core 5
)Robot Control
MOZ1Robot
Main robot control class providing connection, control, and data acquisition functions.
Constructor:
MOZ1Robot(config: MOZ1RobotConfig)Core Methods:
Connection Management
connect() -> NoneEstablish connection to the robot system.
- Exception: Raises
RuntimeErroron connection failure
disconnect() -> NoneDisconnect from the robot system.
is_robot_connected -> boolProperty to check robot connection status.
- Returns:
Trueif robot is connected, otherwiseFalse - Usage: Check connection status before sending commands to ensure robot communication is normal
Robot Control
enable_external_following_mode() -> NoneEnable external following control mode.
- Important: Must activate external following mode before using send_action
- Function: Activates the robot's external control receiver, making commands sent by send_action effective
- Exception: Raises
RobotDeviceNotConnectedErrorif robot is not connected
send_action(action: Dict) -> DictSend control commands to the robot.
- Parameters:
action: Action command dictionary, data units are SI units (radians, meters, seconds)
- Returns: Sent action command confirmation
- Important Requirements:
- Call Frequency: send_action calls must maintain a stable frequency, consistent with the
robot_control_hzinitialization parameter - Trajectory Continuity: Sent trajectories must satisfy continuity constraints, avoiding large sudden changes in acceleration and jerk
- Exclusive Control Mode: Each execution structure (left arm/right arm/torso) can only choose one of axis space control or Cartesian space control at the same time
- Prerequisite: Must call
enable_external_following_mode()method first
- Call Frequency: send_action calls must maintain a stable frequency, consistent with the
- Exception: Raises
RuntimeErrorif robot is not connected or sending fails
reset_robot_positions(left_arm_joints: Optional[List] = None,
right_arm_joints: Optional[List] = None,
torso_joints: Optional[List] = None,
gripper_positions: Optional[List] = None) -> boolAsynchronously reset robot to specified positions.
- Parameters:
left_arm_joints: Left arm joint target positions (optional)right_arm_joints: Right arm joint target positions (optional)torso_joints: Torso joint target positions (optional)gripper_positions: Gripper positions (optional)Data units are SI units (radians, meters)
- Returns:
Trueif reset command was sent successfully - Important: This method is asynchronous. After calling, you need to manually sleep and wait for the robot to complete the reset action
- Recommendation: Wait 3-5 seconds after reset to ensure the robot has stabilized at the position. Specific time depends on robot speed set in MovaX
- Exception: Raises
RobotDeviceNotConnectedErrorif robot is not connected
Status Monitoring
capture_observation() -> DictCapture current robot state, including images and joint data.
- Returns: Dictionary containing observation data, data units are SI units (radians, meters, seconds)
- Camera Update Frequency: RealSense cameras update image data at 30Hz
- Data Content: Contains robot joint states, Cartesian positions, gripper states, and camera images
- Rotation Representation: All rotation data uses rotation vector representation
- Base Control: When robot is configured as wholebody, the base uses velocity control mode, returning current velocity state [vx, vy, wz]
- Exception: Raises
RuntimeErrorif robot is not connected or data capture fails
Additional Methods
control_hz -> intCheck the robot's control frequency
- Returns: Currently effective robot control frequency

