Skip to content

Quick Start

MozRobot SDK

Python 3.10+ROS2 Humble

MozRobot SDK is a comprehensive Python SDK for controlling the Moz robot system. Built on ROS2, it provides intuitive APIs for robot control and data acquisition for the Moz1 robot.

Key Features

  • Multi-Configuration Support: Dual arm, whole body (with/without base)
  • Real-Time Control: High-frequency control loop (up to 120Hz) for precise manipulation
  • Vision Integration: Native RealSense camera support with multi-camera configurations
  • ROS2 Native: Seamless integration with ROS2 Humble ecosystem
  • Safety First: Built-in safety checks and error handling
  • Easy Integration: Simple Python API for rapid prototyping and deployment

System Requirements

  • Operating System: Ubuntu 22.04 LTS (recommended)
  • ROS Version: ROS2 Humble
  • Python Version: 3.10 or higher, system interpreter recommended
  • Hardware Requirements:
    • RealSense cameras: USB 3.0 * 3
    • Connection to robot control system: RJ45 * 1
  • System Resources: 8GB+ RAM recommended

Supported Platforms

  • x86_64
  • aarch64

Network Configuration

  • Host IP: Must be in the 172.16.0.x subnet (e.g., 172.16.0.100)
  • Robot IP: 172.16.0.20
  • ROS_DOMAIN_ID: 33 (must match MovaX control system)

SDK Package Download

VersionRelease DateArtifacts
0.1.020250925mozrobot-0.1.0-x86_64
mozrobot-0.1.0-aarch64

Step 1: System Dependencies

ros-humble Installation Guide

bash
# Install ROS2 Humble
sudo apt install software-properties-common
sudo add-apt-repository universe
sudo apt update && sudo apt install curl -y

sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null

sudo apt update
# you can install ros-humble-desktop-full
sudo apt install -y ros-humble-ros-base python3-colcon-common-extensions ros-dev-tools

# Install system dependencies
sudo apt install -y build-essential cmake git curl wget python3-pip python3-dev
sudo apt install -y libopencv-dev python3-opencv

Step 2: robot_interface ROS Package Build

robot_interface is the required ROS2 interface package, containing robot communication messages and service definitions. This package must be built first before the SDK can be used properly.

bash
# Navigate to the dependency package directory
cd /path/to/mozrobot-SDK/deps

# Create ROS2 workspace and build robot_interface package
mkdir -p ~/ros_ws/src
cp -r robot_interface ~/ros_ws/src/
cd ~/ros_ws

# Configure ROS2 environment
source /opt/ros/humble/setup.bash
export ROS_DOMAIN_ID=33
# Build package
colcon build --packages-select mc_core_interface

Step 3: Environment Configuration

bash
# Configure ROS2 environment
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
echo "export ROS_DOMAIN_ID=33" >> ~/.bashrc
echo "source ~/ros_ws/install/setup.bash" >> ~/.bashrc  # Add robot_interface package environment
source ~/.bashrc

Step 4: Network Configuration

Edit network configuration:

bash
sudo nano /etc/netplan/01-netcfg.yaml

Add the following configuration:

yaml
network:
  version: 2
  ethernets:
    eth0:  # Replace with actual network interface name
      addresses: [172.16.0.100/24]  # Choose an IP in the 172.16.0.x range
      gateway4: 172.16.0.1
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]

Apply configuration:

bash
sudo netplan apply

Step 5: SDK Installation

bash
# Install Python dependencies
cd /path/to/mozrobot-sdk
pip3 install -r packages/requirements.txt

# Install SDK
pip install packages/mozrobot-*.whl

Step 6: Verify Installation

bash
python3 -c "from mozrobot import MOZ1Robot, MOZ1RobotConfig; print('✅ MozRobot SDK installed successfully!')"

Quick Test

bash
# Set environment
export ROS_DOMAIN_ID=33

# Run example
cd mozrobot
python3 example/example_usage.py

# Example with performance optimization enabled
python3 example/example_usage.py --enable-soft-realtime --bind-cpu 5 --no-camera

Performance Optimization Configuration (Optional)

MozRobot SDK supports real-time performance optimization, suitable for scenarios with strict requirements for control precision and latency:

Soft Real-Time Scheduling

Enabling soft real-time scheduling can improve the real-time performance of robot control, reducing control latency and jitter.

bash
# Execute setup script (requires administrator privileges)
sudo bash scripts/setup_rtprio.sh
sudo reboot

CPU Binding

Bind robot control threads to specific CPU cores to avoid task switching overhead and improve control stability.

Recommended Configuration:

  • Avoid using core 0, which is usually occupied by system tasks

Important Notes:

  • These features are optional and not required for normal use
  • Only enable when best real-time performance is needed
  • Ensure the system has sufficient CPU resources for binding