About L7
Product Introduction
L7 is the latest general-purpose humanoid robot developed by RobotEra, featuring an industry-leading 55 degrees of freedom, motors delivering up to 400 N·m peak torque and a peak speed of 25 rad/s, enabling high-speed running, and has currently achieved the world's fastest outdoor all-terrain running speed of 4 m/s. The L7 is also equipped with a pair of dexterous hands with 12 active degrees of freedom. Coupled with the powerful computing power of the 275 TOPS platform, it can implement multiple algorithms such as teleoperation, imitation learning, and large robot models, supporting AGI-oriented applications in research, industrial, commercial, and home scenarios. The currently available models and their corresponding configurations for L7 are as follows:
| Product Model | Product Chinese Name | Product English Name | Product Model (ERP) | RobotBody | Dexterous Hand | Jetson Orin Compute Controller | Dexterous Hand Tactile Sensor | Product Code |
|---|---|---|---|---|---|---|---|---|
| L7 SE | L7 SE 全尺寸双足人形机器人 | L7 SE Full-size Bipedal Humanoid | L7-N-NN | L7 | 7003000010 | |||
| L7 SE+ | L7 SE+ 全尺寸双足人形机器人 | L7 SE+ Full-size Bipedal Humanoid | L7-A-NN | L7 | Included | 7003000009 | ||
| L7 Pro | L7 Pro 全尺寸双足人形机器人 | L7 Pro Full-size Bipedal Humanoid | L7-N-XT | L7 | XHAND | Included | 7003000008 | |
| L7 Pro+ | L7 Pro+ 全尺寸双足人形机器人 | L7 Pro+ Full-size Bipedal Humanoid | L7-A-XT | L7 | XHAND | Included | Included | 7003000007 |
| L7 Pro | L7 Pro 全尺寸双足人形机器人 | L7 Pro Full-size Bipedal Humanoid | L7-N-XN | L7 | XHAND | |||
| L7 Pro+ | L7 Pro+ 全尺寸双足人形机器人 | L7 Pro+ Full-size Bipedal Humanoid | L7-A-XN | L7 | XHAND | Included |
Overview
the overall appearance of the robot is shown below.

Overall Robot Parameters
Technical Specifications
| L7 Specification | |
|---|---|
| Size | Standing dimensions: 1706 mm 580 mm 320 mm, as shown in the figure. |
| Total Thigh and Shank Length | 720mm x 2 |
| Total Arm Length | 717mm x 2 |
| Single-arm Payload: | 10Kg |
| Degree of Freedom | 55 (7 DOF x 2 for arms, 6 DOF x 2 for legs, 3 DOF for waist, 2 DOF for neck, 12 DOF x 2 for dexterous hands) |
| Overall Robot Weight | Approximately 67kg |
| Locomotion Speed | 4m/s (theoretical maximum 6 m/s) |
| Battery | 57.6V, 15Ah, 864Wh |
| Compute and Perception Capability | 80 TOPS(x86) + 275 TOPS(Orin AGX) |
| Perception Sensor Configuration | Depth Camera Voice Module |
| Dexterous Hand | Human-like hand design with 12 active DOF per hand |
| Communication Interface | Ethernet、USB 3.0、Wi-Fi 6、4G、USB-C |
Joints and Motors
Joints and Motors :

The coordinate axes of each joint are defined as follows:

Joint and Motor Zero Position Definitions:
| Joint Name | Angle (degrees) |
|----------------------------|:---------------:|
| left_hip_pitch_joint | 30 |
| left_knee_joint | -60 |
| left_ankle_pitch_joint | 30 |
| right_hip_pitch_joint | 30 |
| right_knee_joint | -60 |
| right_ankle_pitch_joint | 30 |
| Other joints | 0 |Joint Peak Torque and Speed Specifications:
| position | Peak torque (Nm) | speed (rad/s) |
|---|---|---|
| knee | 400 | 25 |
| leg pitch | 400 | 25 |
| leg roll | 255 | 7 |
| leg yaw | 100 | 13 |
| ankle pitch | 50 | 14 |
| ankle roll | ||
| shoulder pitch | 95 | 4 |
| shoulder roll | ||
| shoulder yaw | ||
| elbow pitch | ||
| wrist yaw | 35 | 4 |
| wrist roll | ||
| wrist pitch | ||
| neck pitch | 35 | 4 |
| neck yaw | ||
| waist pitch | 95 | 4 |
| waist roll | ||
| waist yaw |
Onboard Computing Resource Connection Diagram

The hardware and system specifications of the onboard computing resources are listed below:
| Computing Unit Name: | AMD Ryzen AI 9 HX 370 |
|---|---|
| CPU | 12 cores |
| Memory | 32GB |
| Storage | 1TB SSD |
(Optional Jetson Orin AGX Module)
| Computing Unit Name: | Jetson Orin AGX 64GB |
|---|---|
| AI Performance | 275 TOPS |
| GPU | NVIDIA Ampere architecture GPU with 2,048 CUDA cores and 64 Tensor Cores |
| GPU Maximum Frequency | 1.3 GHz |
| CPU | 12-core Arm® Cortex®-A78AE v8.2 64-bit CPU, 3 MB L2 + 6 MB L3 |
| CPU Maximum Frequency | 2.2 GHz |
| System Memory | 64 GB 256-bit LPDDR5 204.8 GB/s |
Operation Guide
Unboxing and Power-On
Unboxing
The robot unboxing procedure typically includes the following steps:
- Check the packaging: Before opening the box, first check whether the packaging box is damaged to ensure that the product has not been damaged during transportation.
- Remove the items: Open the packaging case and remove the robot and its accessories one by one according to the instructions in this manual, including the power supply, tools, fixtures, and other accessories.
- Remove the robot: Follow the video instructions to remove the robot from the packaging case and lift it using the lifting device.
Install the battery and power on the robot.
Connect to the robot
Locate the robot’s Wi-Fi SSID under the hip roll joint. The SSID is in the format: L_v3_BOTXX.

Search for “L_v3_BOTXX” in the available Wi-Fi networks and connect to the router inside the robot body.
Note: The 5G Wi-Fi network may take longer to appear.
The default Wi-Fi password is xbot123456.
Access the Robot Management Console
Open a browser and enter the following address: http://192.168.8.100:1888. This will open the robot control console, where you can view robot status, system information, and other related information.
Set an Access Password
Create a Password

This is the initial security setup interface of XOS. It is used to configure the access password for the one-stop robot control center and ensure the security of system and device permissions.
Two-Factor Authentication

The two-factor authentication settings interface of XOS further strengthens the access security of the robot control center, providing a second layer of protection for the system beyond passwords.
Homepage

- View the overall robot status information on the home page to monitor the current robot status in real time.
- The overall robot information is displayed as follows: INIT: State after power-on startup. IDLE: Robot hardware connection state. READY: Robot initialization state. ACTIVE: The robot is ready to accept tasks. ERROR: The robot is in an error state. Robot Model: Model of the current robot. Dexterous Hand Model: Model of the dexterous hand installed on the current robot. Battery Level: Displayed as a percentage. Battery Status: Standby/Fully Charged, Charging, or Discharging. Robot SN: Serial number of the current robot. NUC IP Address: IP address of the NUC in the current robot. XOS Version: Current XOS version of the robot. CPU Usage: Overall CPU usage curve. Robot Simulation Model: Simulation model corresponding to the current robot model.
- Real-time Error Information: If an alarm or error occurs, the corresponding joint in the robot simulation model will turn red.
Robot Overview
Log Management

- The log management module supports log collection, storage, and visualization.
- Operation logs from each functional module can be classified and aggregated based on the system architecture hierarchy.
- The interactive interface supports log display and structured parsing.
- Users can manually download log files for specified modules according to operational needs, supporting system debugging, issue tracing, and troubleshooting.
CPU Frequency Dashboard

- This function allows users to view the overall CPU frequency curve in real time. Through a graphical interface, it dynamically displays the trend of the aggregate frequency across all CPU cores over time. The horizontal axis represents time, and the vertical axis represents the frequency value in GHz. It supports real-time refresh, allowing users to monitor CPU performance fluctuations, analyze CPU frequency scaling behavior, and identify abnormal conditions.
- CPU: Supports selection of
cpu,cpu_max,cpu_min,cpu_avg, and individual CPU cores. Single selection, multiple selection, and select-all are supported. - Time Range: Supports querying data within a 24-hour time range.
- Reset: Resets the query filters on the page, including the selected CPU and time range. After clicking Reset, all query filters will be cleared.
- Refresh Control: Real-time refresh is enabled by default on the curve page. When disabled, the curve will stop refreshing. When enabled, the latest data will be retrieved in real time and plotted on the curve.
Abnormal State

- Supports real-time monitoring of abnormal operating states of each module of the robot, supports pop-up notifications and voice announcements, and can quickly locate and handle faults.
Core Features:
- Abnormal Notification: Supports two reminder methods, pop-up notification and voice broadcast, and is enabled by default.
- Exception List: Clearly displays the exception module, name, code, location, description, and level, facilitating quick identification of issues.
- Quick Processing: Each exception provides a "View Solution" entry, which directly jumps to the corresponding handling instructions.
Operation Instructions:
- Turn on/off notifications
- Click the switch on the right side of "Pop-up Notification" or "Voice Broadcast" to toggle the on/off state.
- View exception details
- View key information such as abnormal modules, locations, and levels in the list.
- Exception levels are divided into: fatal error, serious error, error, warning, prompt, and information.
- Handle exceptions
- Click "View Solution" in the action bar on the right side of the abnormal row to obtain the official processing steps.
Robot Management
Startup Management

- Startup management is used to set the startup mode of the robot.
Startup Mode Selection:
- Standard Mode: The SDK enters the ACTIVE state, starts upper limb force control and lower limb force control, simultaneously starts MPC/RL, and when RL is ready, RL ACTIVE is started by the remote control.
- Quick Start Mode: The SDK starts the robot to the RL ready state while simultaneously starting the MPC, allowing for quick switching to teleoperation mode via the remote control.
- Developer Mode: The SDK is not started, and the remote controller node is not started.
Voice and Action

- This module allows users to add and configure voice-action combinations. After a voice-action combination is added, the robot can be triggered to execute the corresponding action and play the associated voice prompt by clicking the play button or pressing the configured key combination on the remote controller.
- The list displays voice name, action name, voice duration, and action duration, supporting operations such as play, edit, and delete.
- Operation Buttons:
Stop Playback: Terminate the currently executing voice - action sequence.
Add voice action: Create a new "Voice Command → Device Action".
Voice List / Action List: View all available voice libraries and action libraries separately.
Add Voice Action

- Voice and action support selecting only one action or one voice, or one of each.
- Click Save, and after successful saving, a new piece of data will be added to the playback list.
Robot Action List

- The list displays the action name, file size, file duration, and upload time.
- Click to select a file, and choose a robot action file in zip format locally.
- Click Save, and after successful saving, a new piece of data will be added to the Tabular Data.
- This Tabular Data is used to select actions when configuring voice and actions.
Voice List

- The list displays the voice name, file size, voice duration, date, and operations including download and delete.
- Click on Text To Speech, a pop-up input window will appear, where you can enter the voice name and content. Click Submit, and upon success, a new piece of data will be added to the audio file list.
- Click "Upload Voice", select a voice file locally to upload, and a new data entry will be added to the page upon successful upload.
- This Tabular Data is used to select voices when configuring voice and actions.
Timbre and Volume

- This function supports a volume adjustment range of 0–100%. Users can precisely control the robot's sound volume by sliding the adjustment bar or using the plus/minus buttons. By default, the system remembers the last settings parameters and automatically restores the user's preferred settings after restarting.
- Supports users to independently select the audio output device of the robot. The system will automatically scan and list the currently available sound card list (including built-in sound cards, external USB sound cards, etc.), and the output device can be quickly switched via the drop-down menu.
Robot Control Console
Refer to the detailed usage method inxviz 使用说明文档
Integrated Data Center

The XOS Robot Console – Integrated Data Center is a one-stop data visualization and simulation debugging platform designed for robot users. It supports real-time monitoring of operational data such as robot joint status, as well as fault diagnosis, data recording, and simulation validation. It provides end-to-end support for robot debugging, operation analysis, and issue localization.
Data Monitoring Center

The XOS Data Monitoring Center is a real-time visualization dashboard for robot operation data. It supports real-time acquisition and visualization of key data streams, such as joint status data, including arm and elbow joint positions, through line charts and other visual formats. This helps users intuitively monitor the robot’s operating status and quickly identify data anomalies and fluctuations.
Recording Center

- Enables flexible subscription to ROS topics, including XOS-specific topics, as well as custom recording and export by time range. It supports one-click quick export and precise time-range export, adapts to the XOS data format and the small-screen layout of portable devices, and simplifies data acquisition and export operations.
Simulation Center

XOS Simulation Center – Twin Mode links the robot’s real-world operating data with a virtual model in real time, enabling visual debugging and validation through virtual–real synchronization. It supports real-time mapping of joint states, motion trajectory replay, and physics-based simulation validation. This helps developers verify control logic, identify potential risks in advance, and improve debugging efficiency and safety.
Application Management

- This page allows users to upload, install, and launch system extension applications.
- Upload the compressed application package. The page supports both drag-and-drop upload and file selection from the system file browser. After the upload is complete, click Upload and Install to install the application.
- Once the installation is complete, the application will appear in the application list. Click the application to open it.
System Upgrade
- This function is used to manage the software versions of the robot system and the dexterous hand controller. It supports both cloud-based update checking and manual upgrade.
Version Information Display:
- Version Number: Displays the current system version, RobotOS.
- Version Details: Click Version Details to view the version number of each module.

Upgrade Package Acquisition Method:
- Cloud Detection:
- One-click to detect and obtain the latest version from the cloud server.
- Click the "Check for Updates" button, and the system will re-detect the latest version from the cloud.

- Download
Click the "Download Upgrade Package vX.X.X.X" button to start downloading, and deletion is supported during the download process.
- Manually upload the upgrade package
Supports uploading local upgrade packages for offline or specified version upgrades.

Upgrade
**Pre-upgrade **Checks
- Before upgrading, ensure that the robot is stationary, in a safe condition, and hoisted as shown in the illustration below.
Illustration:

- The battery level must be above 30%, or an external power source must be connected.
- The robot will restart automatically during the upgrade. Do not operate the robot during this process.
After confirming that the above conditions are met, click Upgrade to vX.X.X to start the upgrade. Do not power off or operate the robot during the upgrade to avoid upgrade failure.
Upgrade Completion Judgment
- After the upgrade is initiated, the system will automatically perform the upgrade. When the interface displays Upgrade Completed, the current upgrade has been completed successfully. Do not power off the robot during the entire process.
Security Center
For specific usage instructions, please refer to说明书——XOS安全部分
Set Password

The Set Password function of the XOS Security Center supports users to update their login password (6-8 characters, letters or numbers), and can also turn off password protection to achieve flexible management of access rights to the Robot Control Center.
Authenticator Management

The Authenticator Management feature of XOS Security Center supports users in adding, renaming, and deleting TOTP verification devices, with a maximum of 5 devices that can be bound, facilitating users to flexibly manage backup devices for two-factor authentication and ensuring the security of system access.
Login History

The Login History feature of the XOS Security Center can display the latest 50 login records, including login IP, time, result, and client information, helping users trace access behavior and promptly detect abnormal login risks.
ROS-IP Management

ROS-IP Allowlist Managementfunction of XOS Security Center is used to configure trusted IP addresses for CycloneDDS communication, supports adding and deleting IPs, and only allows devices within the allowlist to communicate with the robot system, enhancing the security and controllability of ROS communication.
Firewall Management

The firewall management function of the XOS Security Center is used to manage the port allowing rules of the nftables INPUT chain, supports viewing system built-in rules and customs adding new rules, controls network port access of the robot system, and strengthens network security protection.
Robot Intranet teleoperation
exclamation Please first use the lifting device to adjust the robot to the following standing posture. During the descent, the robot's toes touch the ground --> the robot's soles touch the ground --> ensure there is visible tension between the sling and the lifting ring to prevent the robot from tilting. Then, switch to the remote control mode via the gamepad, let the robot stand up autonomously, and then start the teleoperation application.


Upload the teleoperation authorization file
- Upload the teleoperation authorization file. After successful upload and verification, the teleoperation function can be used.
- This page supports manual configuration of camera parameters.

Open the teleoperation app
- Open the teleoperation app and enter the main page. The robot will start up, raises both arms after startup is completed, and enters the state of waiting to connect to VR devices.
- After the VR device is successfully connected, start teleoperation via the Xingyao App.
- Click to exit teleoperation, the page will return to XOS, and the robot will exit the teleoperation state.

Connect to MetaQuest
- Turn on the Meta Quest device and enter the system settings.
- Select the network connection method:
Wired connection: Directly connect the Meta Quest to the robot via a data cable.
WiFi Connection: Find the WiFi corresponding to the robot, enter the password, and complete the connection.
- Find the "Xingyao App" icon in the Meta Quest app list and click to launch it.
For detailed usage, refer to:星遥App软件使用说明
+1 After completing the above steps, teleoperation has been successfully started! As shown in the figure below

Remote control robot walking
- Lower the robot from the lifting device until its feet touch the ground, and hold the handrail behind the robot with your hand to prevent it from falling.
- Start the robot via the remote control to enter the standing or walking mode, and then start remote control.
Remote Control Instructions
- Gamepad
Introduction to the Remote Control
- Image:

- Turn on the remote controller: Press the home button once, the handle vibrates, and a steady white light indicates that it is connected to the robot
- Turn off the remote controller: switch to other modes on the back of the handle, or it will automatically turn off after a long period of inactivity
- For detailed parameters of the remote controller, please refer to the handle's user manual
Button Definition:
- Button Instructions
- Use the four shoulder buttons as primary buttons including:
LT, RT, LB, RB - Take
the up, down, left, and right of the D-padandthe ABXY function keysas secondary keys - The robot supports control using secondary keys alone or combinations of primary and secondary keys.
- Use the four shoulder buttons as primary buttons including:
- Attention
- The primary key must be fully pressed down to take effect when pressed.
- When using a combination key, you need to press the primary key first, then press the secondary key to trigger it.
Key Function List:
| Mode | Button | Description |
|---|---|---|
| Remote Control Mode | LB+A | Switch to remote control mode |
| Y | Stand taller | |
| X | Stand a bit lower | |
| Left Joystick | Y-axis movement, X-axis traverse | |
| Right Joystick | X-axis steering | |
| RT + D-pad ⬅️ | Stop action voice | |
| RT + D-pad ⬇️ | Pause/Resume Action Voice | |
| RT + A/B/X/Y/(D-pad ⬆️➡️) LT + A/B/X/Y/(D-pad ⬆️⬇️⬅️➡️) | Play action voice | |
| Teleoperation mode (Quick start mode is in effect) | LB+X | can quickly switch to the teleoperation mode via the remote control combination keys |
Usage Steps:
- Preparation:
- When the robot is powered on normally, it will automatically start up to the ACTIVE state
- Turn on the remote controller, press the home button, and if the white light on the handle stays on, it indicates that the remote control has been connected to the robot
- When the robot is in the ACTIVE state, the following key combinations can be used to control the robot
- Combination key
LB + A, switches the robot to remote control mode and plays a voice prompt simultaneously
- Combination key
- When the robot is in remote control mode, the following combination keys can be used to control the robot
- Slide
the Y-axis of the left joystick, that is, slide up and down, and the robot will move forward and backward - Slide
the X-axis of the left joystick, i.e., slide left or right, and the robot will move horizontally left or right - Slide
the X-axis of the right joystick, that is, slide left or right, and the robot will turn left or right
- Slide
- Custom buttons require customizing the voice or action triggered by the remote control combination keys at the location of <XOS Page> -> <Robot Management> -> <Upper Limb Playback Management>. The supported combination keys are as follows:
- Combination Key RT + A/B/X/Y/(D-pad ⬆️➡️) LT + A/B/X/Y/(D-pad ⬆️⬇️⬅️➡️) Play the specified voice or perform the specified action according to the configuration of the XOS page
- Note: The remote control supports automatic connection upon startup. If it is turned off and then turned on again during use, it will not affect the robot's status.
ORIN Operation Guide
System Functional Interface Diagram

Powe Input 2x Gigabit Ethernet HDMI GMSL Camera


Login Credentials
After power on, the system enters the Ubuntu interface.
Username: xbot-orin
Password: xbot_123456
Network Configuration
After startup, the default IP address is 192.168.8.200
Device System Flashing
Preparation
Download the flashing package: https://developer.nvidia.com/embedded/jetson-linux-r3643

Baseboard device tree: ces-Linux_R36.4.3_bsp
Link: https://pan.baidu.com/s/1b_7R4hyPML47WPkr1Afyjg?pwd=cmrb Extraction code: cmrb
After the download is complete, run the following commands:
$ sudo tar -xf Jetson_Linux_R36.4.3_aarch64.tbz2$ sudo tar -xpf Tegra_Linux_Sample-Root-Filesystem_R38.2.1_aarch64.tbz2 -C Linux_for_Tegra/rootfs/$ cd Linux_for_Tegra/$ sudo ./tools/l4t_flash_prerequisites.sh$ sudo ./apply_binaries.sh$ cd ../ces-Linux_P36.4.3_bsp$ sudo chmod 777 ces-install.sh$ sudo ./ces-install.sh$ cd ../Linux_for_Tegra/Flashing Procedure
Set up the flashing environment (x86 host machine; recommended available disk space: >100 GB)
Download the product flashing image package from the cloud drive to an x86 host machine running Ubuntu 18.04, Ubuntu 20.04, or later.
In the flashing image folder, run the following command to install the required components:
$ sudo ./install.shFlash the image to the Jetson device
Press and hold the RCW button, then connect the power supply. Press the PWR button to power on the device and enter Recovery mode.
Connect the host machine to the device Type-C port using a USB cable.

Connect the flashing cable to this port.
To check whether the device has successfully entered Recovery mode, run the lsusb command in the terminal of the x86 host machine and verify whether a device named “NVIDIA Corp.” is listed.

If the device information is displayed as shown in the figure, the device has entered Recovery mode.
ID: For AGX ORIN, the ID is 7023 or 7223.
Run flash.sh to perform the flashing operation.
Flashing command:
sudo ./flash.sh ces-agx-orin64-dak-01 mmcblk0p1Flashing Complete
Connect an HDMI display for power-on verification. If the system boots normally, the flashing process is complete.
Flashing a Custom Image
Image Backup Method:
sudo ./flash.sh -r -k APP -G backup.img jetson-agx-orin-devkit mmcblk0p1The generated backup image file is backup.img.
Image Restoration Method:
Copy the backup image file named backup.img to the Linux_for_Tegra/bootloader/ directory and rename it as system.img:
sudo cp backup.img bootloader/system.imgRun the following command in the Linux_for_Tegra directory:
sudo ./flash.sh -r jetson-agx-orin-devkit mmcblk0p1Note: The -r parameter indicates that the system.img file in the bootloader directory will be used for flashing.
Note: Both backup and restoration operations must be performed in Recovery mode.
Precautions
- When touching the mainboard, wear an anti-static wrist strap or other ESD protection equipment, and ensure proper grounding.
- Do not assemble components, connect cables, or perform wiring operations while the device is powered on.
- Verify the definitions of the mainboard interfaces and peripheral interfaces. Incorrect or reversed connections are not allowed.
- Ensure that the IO ports, serial ports, enable pins, and other signals are level-matched.
- Pay attention to the power consumption of the external display. If the power consumption is high, use an external power supply.
- Pay attention to the total power consumption of the product and select a power supply with sufficient power capacity.
Emergency Stop
L7 provides an emergency stop remote control to promptly cut off power in case of unexpected situations, ensuring safety.
The following figure shows the emergency stop remote control:

Press the A button once to turn off the power of the onboard computer, and press it again to restore it
Press the D button once to turn off the power of the joint motor, and press it again to restore it
exclamation **Important: Please ensure that the emergency stop remote control is ready during debugging. **In an emergency, press the D button to cut power to the joint motors.
Packing
Re-zero
Development Guide
Overall robot software architecture

SDK Call Instructions
L7 uses ROS2 Humble to interact with the whole robot. Developers can connect to the robot via wired/wireless networks, or communicate with the host system by logging into the developer container to write and run programs.
Ros2 domain: 211
If you wish to connect to the robot via another host for control:
- Connect to the robot via a wired connection or directly connect to the robot's WIFI
- Prerequisite: The host has a ros-humble + cyclonedds environment
- Messages used by the robot need to be deployed on its own host
git clone https://github.com/roboterax/teleop_client.git
cd teleop_client
colcon build
source install/setup.bash- Set environment variables
export ROS_DOMAIN_ID=211
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp- Configure unicast, and directly execute the following command on the host:
sudo mkdir /etc/xbot/
sudo tee /etc/xbot/cyclonedds.xml > /dev/null << 'EOF'
<?xml version="1.0"?>
<CycloneDDS xmlns="https://cdds.io/config">
<Domain id="211">
<General>
<AllowMulticast>false</AllowMulticast>
</General>
<Discovery>
<Peers>
<Peer address="127.0.0.1"/>
<Peer address="192.168.8.100"/>
</Peers>
<ParticipantIndex>auto</ParticipantIndex>
<MaxAutoParticipantIndex>300</MaxAutoParticipantIndex>
</Discovery>
</Domain>
</CycloneDDS>
EOF
export CYCLONEDDS_URI=file:///etc/xbot/cyclonedds.xml
ros2 daemon stop
ros2 daemon start- Set the ROSIP allowlist on Robot-XOSROSIP设置说明文档
- Add the host IP to the XOS ros allowlist
- Jump directly to the
**Underlying Joint Control SDK **section
Robot Port Usage Specification
Port usage prohibited
Commonly used built-in ports for system reserved ports:
tcp dport { 22, 80, 443, 2222 } accept
tcp dport { 5555, 8888, 1688, 1788, 1888, 1988 } accept
tcp dport { 8765, 8080, 8090 } accept
tcp dport 1788-1888 accept
Developer Available Port
Only:1024 ~ 65535
Enter the developer container
Username: developer
Initial Password: developer
Port Number: 2222
ssh developer@192.168.8.100 -p 2222 #SSH into the robot backend and enter the workspace.Underlying Joint Control SDK
Joint Control Process
flowchart TD
A[Check robot hardware status<br>(Confirm EtherCAT connection, joint power-on,<br>green power light is on)] --> B{Select mode}
B -->|Full-body mode (with XHAND)| C[Start low-level joint control service<br>/dynamic_launch<br>launch_mode: 'pos']
B -->|Full-body mode(without XHAND)| C2[Start low-level joint control service<br>/dynamic_launch<br>launch_mode: 'no_hand_pos']
C & C2 --> D[Initialize joint control service<br>/ready_service<br>(Wait about 20 seconds, interface returns success)]
D --> E[Move joints to standard start position<br>/simple_trajectory]
E --> G1[Enable control<br>/activate_service]
G1 --> H[Send joint control command<br>]
H --> I[Stop low-level joint control service<br>/stop_launch]
Integrated robot Joint Name
The joint list is as follows, and the overall structure refers to the product structure diagram
| Joint Name |
|----------------------------|
| left_shoulder_pitch_joint |
| left_shoulder_roll_joint |
| left_arm_yaw_joint |
| left_elbow_pitch_joint |
| left_elbow_yaw_joint |
| left_wrist_pitch_joint |
| left_wrist_roll_joint |
| neck_yaw_joint |
| neck_pitch_joint |
| right_shoulder_pitch_joint |
| right_shoulder_roll_joint |
| right_arm_yaw_joint |
| right_elbow_pitch_joint |
| right_elbow_yaw_joint |
| right_wrist_pitch_joint |
| right_wrist_roll_joint |
| waist_pitch_joint |
| waist_roll_joint |
| waist_yaw_joint |
| left_hip_roll_joint |
| left_hip_yaw_joint |
| left_hip_pitch_joint |
| left_knee_joint |
| left_ankle_pitch_joint |
| left_ankle_roll_joint |
| right_hip_roll_joint |
| right_hip_yaw_joint |
| right_hip_pitch_joint |
| right_knee_joint |
| right_ankle_pitch_joint |
| right_ankle_roll_joint |
| XHAND Joint Name |
|------------------------------|
| left_hand_thumb_bend_joint |
| left_hand_thumb_rota_joint1 |
| left_hand_thumb_rota_joint2 |
| left_hand_index_bend_joint |
| left_hand_index_joint1 |
| left_hand_index_joint2 |
| left_hand_mid_joint1 |
| left_hand_mid_joint2 |
| left_hand_ring_joint1 |
| left_hand_ring_joint2 |
| left_hand_pinky_joint1 |
| left_hand_pinky_joint2 |
| right_hand_thumb_bend_joint |
| right_hand_thumb_rota_joint1 |
| right_hand_thumb_rota_joint2 |
| right_hand_index_bend_joint |
| right_hand_index_joint1 |
| right_hand_index_joint2 |
| right_hand_mid_joint1 |
| right_hand_mid_joint2 |
| right_hand_ring_joint1 |
| right_hand_ring_joint2 |
| right_hand_pinky_joint1 |
| right_hand_pinky_joint2 |Joint Control Instructions
Control Mode
The current system's lower limbs only support torque control mode, while the upper limbs, including the waist, support torque control mode and position control mode. They are distinguished by different startup methods.
Under different startup modes
- For joints with torque control, only the following parameters can be set:
- velocity: Joint Target Velocity
- position: Joint Target Position
- feedforward: Feedforward Force
- kp: Proportional Gain
- kd: Differential Gain
- For joints with position control, only the position (target position of each joint) parameter needs to be set. The remaining parameters include:
- velocity: Joint Target Velocity
- feedforward: Feedforward force or torque
- kp: Proportional Gain
- kd: Differential Gain
The above parameters do not take effect in position control mode. Please ensure that only the position field is filled to avoid redundant data or misuse of the interface.
Control Frequency
The joint control frequency of L7 can reach 500Hz, and the control frequency of the dexterous hand is 83Hz (serial data)
Underlying joint control interface
1. Joint Control Command Interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/hybrid_body_controller/commands | ROS2 Topic | Issue joint control commands | xbot_common_interfaces/msg/HybridJointCommand |
xbot_common_interfaces/msg/HybridJointCommandParameter Description:- header: Standard message header (including timestamp and frame_id)
- joint_name: string[], list of joint names, corresponding to each control joint
- position: float64[], target position (rad) of each joint
- velocity: float64[], target velocity (rad/s) for each joint
- feedforward: float64[], feedforward force or torque (N·m)
- kp: float64[], proportional gain for each joint
- kd: float64[], current force/torque of differential gain for each joint
2. Hand Joint Control Command Interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/hand_controller/commands | ROS2 Topic | Issue joint control commands | xbot_common_interfaces/msg/HybridJointCommand |
xbot_common_interfaces/msg/HybridJointCommandParameter Description:- header: Standard message header (including timestamp and frame_id)
- joint_name: string[], a list of joint names, corresponding to each control joint
- position: float64[], target position (rad) of each joint
- velocity: float64[], target velocity (rad/s) for each joint
- feedforward: float64[], feedforward force or torque (N·m)
- kp: float64[], proportional gain for each joint
- kd: float64[], current force/torque of differential gain for each joint
3. Joint Status Interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/joint_states | ROS2 Topic | Issue joint control commands | sensor_msgs/msg/JointState |
sensor_msgs/msg/JointStateParameter Description:- header: Standard message header (including timestamp and frame_id)
- name: string[], all joint names
- position: float64[], target position (rad) of each joint
- velocity: float64[], target velocity (rad/s) for each joint
- effort: float64[], joint torque (N·m)
4. Hand Sensor Status Interface
XHAND
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/hand_sensor | ROS2 Topic | Publish joint state command | xbot_common_interfaces::msg::XhandHandSensor |
xbot_common_interfaces::msg::XhandHandSensorParameter Description:- header: standard message header (including timestamp and frame_id)
- hand_type: string[], hand type
- fx: int8[], force in the x direction of the fingers, unit 0.1 N
- fy: int8[], force in the y direction of the fingers, unit 0.1 N
- fz: int8[], force in the z direction of the fingers, unit 0.1 N
- temperature: uint8[], finger temperature, degrees Celsius
- calc_temperature: uint8, calculated temperature, degrees Celsius
Each Sensor contains 121 groups of fx, fy, and fz data: the first group is the resultant force, and the remaining 120 groups are component forces arranged as 10 * 12.
There are 5 Sensors in total, with IDs 0x11, 0x12, 0x13, 0x14, and 0x15.
5. Read IMU information
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/imu_feedback | ROS2 Topic | Issue joint control commands | xbot_common_interfaces/msg/Imu |
xbot_common_interfaces/msg/ImuParameter Description:- orientation_x: float64 Quaternion x component
- orientation_y: float64, y component of the quaternion
- orientation_z: float64 Quaternion z component
- orientation_w: float64 Quaternion w component
- roll: float64 Rotation angle around the X-axis (radians)
- pitch: float64 Rotation angle around the Y-axis (radians)
- yaw: float64 Rotation angle around the Z-axis (radians)
- angular_vel_x:float64 Angular velocity around the X-axis(rad/s)
- angular_vel_y: float64 Angular velocity along the Y-axis (rad/s)
- angular_vel_z: float64 Angular velocity along the Z-axis (rad/s)
- linear_acc_x: float64 X-axis linear acceleration (m/s²)
- linear_acc_y: float64 Y-axis linear acceleration (m/s²)
- linear_acc_z: float64 Z-axis linear acceleration (m/s²)
Example of Low-Level Joint Control
Control via the command line
The L7 whole robot joints use Ethercat for communication, so please confirm the robot hardware status before starting. Currently, L7 supports the following modes:
# Full-body configuration with left and right XHANDs, position mode
launch_mode: 'pos'
# Full-body configuration without XHANDs, position mode
launch_mode: 'no_hand_pos'
# Full-body configuration with left and right XHANDs, torque mode
launch_mode: 'pd'
# Full-body configuration without XHANDs, torque mode
launch_mode: 'no_hand_pd'Taking the example of starting a full-body configuration with two XHANDs (left and right), the startup script is as follows:
# SSH into the robot backend and enter the workspace
ssh developer@192.168.8.100 -p 2222
# Start the joint service
ros2 service call /dynamic_launch xbot_common_interfaces/srv/DynamicLaunch "app_name: ''
sync_control: false
launch_mode: 'pos'"
# Initialize the joint modules, this process takes about 20 seconds
ros2 service call /ready_service std_srvs/srv/Trigger {}
# Set joints to the standard initial position, this process takes about 4 seconds
ros2 action send_goal /simple_actions xbot_common_interfaces/action/SimpleActions "{action_name: 'initpose_handsdown', time_cost: 4.0}"
# Raise the forearms
ros2 action send_goal /simple_actions xbot_common_interfaces/action/SimpleActions "{action_name: 'lift_up', time_cost: 4.0}"
# Xhand both hands slightly grasp (note: execute the previous step first to lift the arms)
ros2 topic pub /hand_controller/commands xbot_common_interfaces/msg/HybridJointCommand "header:
stamp:
sec: 0
nanosec: 0
frame_id: ''
joint_name: ['left_hand_thumb_bend_joint', 'left_hand_thumb_rota_joint1', 'left_hand_thumb_rota_joint2', 'left_hand_index_bend_joint', 'left_hand_index_joint1', 'left_hand_index_joint2',
'left_hand_mid_joint1', 'left_hand_mid_joint2', 'left_hand_ring_joint1', 'left_hand_ring_joint2', 'left_hand_pinky_joint1', 'left_hand_pinky_joint2',
'right_hand_thumb_bend_joint', 'right_hand_thumb_rota_joint1', 'right_hand_thumb_rota_joint2', 'right_hand_index_bend_joint', 'right_hand_index_joint1', 'right_hand_index_joint2',
'right_hand_mid_joint1', 'right_hand_mid_joint2', 'right_hand_ring_joint1', 'right_hand_ring_joint2', 'right_hand_pinky_joint1', 'right_hand_pinky_joint2']
position: [0.5, 0.5, 1.0, 0.3, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
0.5, 0.5, 1.0, 0.3, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
velocity: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
feedforward: [350.0, 350.0, 350.0, 350.0, 350.0, 350.0, 350.0, 350.0, 350.0, 350.0, 350.0, 350.0,
350.0, 350.0, 350.0, 350.0, 350.0, 350.0, 350.0, 350.0, 350.0, 350.0, 350.0, 350.0]
kp: [100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
kd: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]"
# Enable algorithm control permission
ros2 service call /activate_service std_srvs/srv/Trigger {}
# Read joint information
ros2 topic echo /joint_states --once
# Read IMU information
ros2 topic echo /imu_feedback --once
# Stop the low-level joint control service
ros2 service call /stop_launch std_srvs/srv/Trigger {}Python example code:
import rclpy
from rclpy.node import Node
from xbot_common_interfaces.srv import DynamicLaunch, SwitchController
from std_srvs.srv import Trigger
from xbot_common_interfaces.action import SimpleTrajectory
from rclpy.action import ActionClient
from sensor_msgs.msg import JointState
from xbot_common_interfaces.msg import Imu
import time
class RobotStartupDemo(Node):
def __init__(self):
super().__init__('robot_startup_demo')
# Service clients
self.dynamic_launch_cli = self.create_client(DynamicLaunch, '/dynamic_launch')
self.ready_service_cli = self.create_client(Trigger, '/ready_service')
self.activate_cli = self.create_client(Trigger, '/activate_service')
self.stop_launch_cli = self.create_client(Trigger, '/stop_launch')
# Action client
self.traj_client = ActionClient(self, SimpleTrajectory, '/simple_trajectory')
# State reading related
self.joint_state_sub = None
self.imu_sub = None
self.joint_state_msg = None
self.imu_msg = None
def call_service(self, client, request):
future = client.call_async(request)
rclpy.spin_until_future_complete(self, future)
return future.result()
def wait_for_services(self):
self.get_logger().info('Waiting for services...')
self.dynamic_launch_cli.wait_for_service()
self.ready_service_cli.wait_for_service()
self.activate_cli.wait_for_service()
self.stop_launch_cli.wait_for_service()
def run_startup_sequence(self):
self.wait_for_services()
# 1. Start joint service
self.get_logger().info('Starting joint service...')
dyn_launch_req = DynamicLaunch.Request()
dyn_launch_req.app_name = ''
dyn_launch_req.sync_control = False
dyn_launch_req.launch_mode = 'pos'
self.call_service(self.dynamic_launch_cli, dyn_launch_req)
# 2. Initialize joint modules
self.get_logger().info('Initializing joint modules...')
self.call_service(self.ready_service_cli, Trigger.Request())
time.sleep(20) # As suggested in the documentation; can optimize waiting logic in real deployment
# 3. Reset joints to zero (send action goal)
self.get_logger().info('Setting joints to standard initial position...')
goal_msg = SimpleTrajectory.Goal()
goal_msg.traj_type = 0
goal_msg.duration = 4.0
self.traj_client.wait_for_server()
send_goal_future = self.traj_client.send_goal_async(goal_msg)
rclpy.spin_until_future_complete(self, send_goal_future)
goal_handle = send_goal_future.result()
if not goal_handle.accepted:
self.get_logger().error('Trajectory action goal was not accepted')
return
get_result_future = goal_handle.get_result_async()
rclpy.spin_until_future_complete(self, get_result_future)
time.sleep(2) # Wait for the reset process to complete
# 4. Enable algorithm control permission
self.call_service(self.activate_cli, Trigger.Request())
# 5. Read joint information
self.get_logger().info('Reading one joint state...')
self.joint_state_msg = None
self.joint_state_sub = self.create_subscription(
JointState, '/joint_states', self.joint_state_callback, 10
)
self.wait_for_msg('joint_state_msg')
# 6. Read IMU information
self.get_logger().info('Reading one IMU state...')
self.imu_msg = None
self.imu_sub = self.create_subscription(
Imu, '/imu_feedback', self.imu_callback, 10
)
self.wait_for_msg('imu_msg')
# 7. Stop low-level joint control service
self.get_logger().info('Stopping low-level joint control service...')
self.call_service(self.stop_launch_cli, Trigger.Request())
self.get_logger().info('Process finished.')
def joint_state_callback(self, msg):
if self.joint_state_msg is None:
self.joint_state_msg = msg
self.get_logger().info(f'Received joint state: {msg}')
self.joint_state_sub.destroy()
def imu_callback(self, msg):
if self.imu_msg is None:
self.imu_msg = msg
self.get_logger().info(f'Received IMU state: {msg}')
self.imu_sub.destroy()
def wait_for_msg(self, attr_name, timeout=5.0):
start = time.time()
while getattr(self, attr_name) is None and rclpy.ok():
if time.time() - start > timeout:
self.get_logger().warning(f'{attr_name} timeout while waiting')
break
rclpy.spin_once(self, timeout_sec=0.1)
def main(args=None):
rclpy.init(args=args)
node = RobotStartupDemo()
node.run_startup_sequence()
node.destroy_node()
rclpy.shutdown()
if __name__ == '__main__':
main()Zeroing the whole robot
- Remove the calibration fixture and secure the robot to the calibration fixture according to the calibration fixture specification
- After confirming the completion of the robot's installation on the calibration fixture, start robot
# SSH into the robot backend and enter the workspace
ssh developer@192.168.8.100 -p 2222
# Start the joint service in PD mode
ros2 service call /dynamic_launch xbot_common_interfaces/srv/DynamicLaunch "app_name: ''
sync_control: false
launch_mode: 'pd'"
# Initialize the joint modules, this process takes about 20 seconds
ros2 service call /ready_service std_srvs/srv/Trigger {}
# Call zero-position calibration service
ros2 service call /set_zero_pos std_srvs/srv/Trigger {}
# After returning True, stop the low-level joint control service
ros2 service call /stop_launch std_srvs/srv/Trigger {}
# Use the emergency stop remote controller, press the "D" button twice to power cycle the joints
# Start the joint service again
ros2 service call /dynamic_launch xbot_common_interfaces/srv/DynamicLaunch "app_name: ''
sync_control: false
launch_mode: 'pd'"
# Initialize the joint modules, this process takes about 20 seconds
ros2 service call /ready_service std_srvs/srv/Trigger {}
# Calibration result verification
ros2 topic echo /joint_states
# Check the position values; if the absolute value is below 0.02, calibration is successful;
# Otherwise, check whether the joint positions are in place, and after confirming, repeat the above stepsUpper-level control SDK
Note: The operation of the upper-level control SDK depends on the lower-level control. Please complete the underlying joint control service first before invoking the upper-level control.
Locomotion Interface Description
Locomotion is a bipedal robot motion control program based on reinforcement learning, which calls the underlying SDK through reinforcement learning to achieve the robot's walking and movement.
1. setMode Interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/locomotion/set_contoller_mode | ROS2 Service | Set the motion mode | xbot_common_interfaces/srv/SetRLMode |
xbot_common_interfaces/srv/SetRLModeis defined as follows:yaml# Request section: input target mode int16 controller_mode # switch between different policies int16 sub_mode # different modes within the same policy --- # Response section: return execution result bool success string messageAmong them, the numerical correspondence between controller_mode and sub_mode is as follows:
controller_mode: 4: Walking
2. move interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/locomotion/move | ROS2 Topic | Control the movement of the robot | xbot_common_interfaces/msg/LowMoveCmdsMsg |
The move interface will control the robot's movement and requires continuous sending to ensure the robot walks continuously. The robot will stop moving 1 second after sending stops.
xbot_common_interfaces/msg/LowMoveCmdsMsg message definition is as follows:
- float32[] move
Among them,move array structure description:
move[0]: Move forward and backward, range[-1, 1],1represents the maximum forward speedmove[1]: Move left and right, range[-1, 1],1represents the maximum rightward speedmove[2]: Left and right rotation, range[-1, 1],1represents the maximum right turn speedmove[3]: Height, normalized float value
3 get_status Interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/locomotion/get_status | ROS2 Topic | Real-time fine-tuning of the current pose | xbot_common_interfaces/msg/RLStatus |
Get all commands and states of the current Locomotion.
xbot_common_interfaces/msg/RLStatus message definition is as follows:
int16 controller_mode_status # current policy status
int16 sub_mode_status # current sub-mode status within the same policy
string controller_mode_name_str # name of the current policy
LocoStatus loco_status
MimicStatus mimic_statusLocoStatustype is defined as follows:- float32[] sub_move_cmds (representing the current speed)
sub_move_cmdsarray means the following:sub_move_cmds[0]: Current forward and backward movement speedsub_move_cmds[1]: Current left-right movement speedsub_move_cmds[2]:Current yawsub_move_cmds[3]: Current Height
mimic_statustype is defined as follows:- The execution status of the reserved action can be ignored
Use Locomotion
exclamation If you need to use it, please first start the robot to complete the step of "initializing the joint module" before proceeding.
Use via command line
If using the built-in walking and upper limb control algorithms, this interface needs to be called to connect the algorithm control
# SSH into the robot backend and enter the workspace
ssh developer@192.168.8.100 -p 2222
# Start robot joint motors via the lower-level SDK
# Move the robot to zero position
# Lower the robot from the hanger
# Omitted here, please refer to the low-level joint control section
# Download l3_pub_client.py
git clone https://github.com/roboterax/teleop_client.git
cd teleop_client
colcon build
cp ~/teleop_client/l3_pub_client.py ~/
cd ~/
# Enable algorithm control permission
ros2 service call /activate_service std_srvs/srv/Trigger {}
python l3_pub_client.py --type webxr --cmd start --camera-type realsense
python l3_pub_client.py --type retargetx --cmd start --mocap gamepad --hand xhand
# Start MPC algorithm
python l3_pub_client.py --type mpc --cmd start
# Start Locomotion algorithm
python l3_pub_client.py --type rl --cmd start
# RL enters ready state, allowing the robot to stand on both feet
ros2 service call /locomotion/set_contoller_mode xbot_common_interfaces/srv/SetRLMode "controller_mode: 2
sub_mode: 0"
# Start walking mode
ros2 service call /locomotion/set_contoller_mode xbot_common_interfaces/srv/SetRLMode "controller_mode: 4
sub_mode: 0"
# Robot moves forward. -r indicates message frequency is 5hz, must not be lower than 2hz, otherwise stuttering will occur. Press Ctrl+C to stop publishing, and the robot will stop
ros2 topic pub -r 5 /locomotion/move xbot_common_interfaces/msg/LowMoveCmdsMsg "move: [0.5,0.0,0.0,0.97]"
# Robot moves backward. -r indicates message frequency is 5hz, must not be lower than 2hz, otherwise stuttering will occur. Press Ctrl+C to stop publishing, and the robot will stop
ros2 topic pub -r 5 /locomotion/move xbot_common_interfaces/msg/LowMoveCmdsMsg "{move: [-0.5,0.0,0.0,0.97]}"
# Robot moves left. -r indicates message frequency is 5hz, must not be lower than 2hz, otherwise stuttering will occur. Press Ctrl+C to stop publishing, and the robot will stop
ros2 topic pub -r 5 /locomotion/move xbot_common_interfaces/msg/LowMoveCmdsMsg "move: [0.0,0.2,0.0,0.97]"
# Robot moves right. -r indicates message frequency is 5hz, must not be lower than 2hz, otherwise stuttering will occur. Press Ctrl+C to stop publishing, and the robot will stop
ros2 topic pub -r 5 /locomotion/move xbot_common_interfaces/msg/LowMoveCmdsMsg "move: [0.0,-0.2,0.0,0.97]"
# Robot rotates based on its current position. -r indicates message frequency is 5hz, must not be lower than 2hz, otherwise stuttering will occur. Press Ctrl+C to stop publishing, and the robot will stop
ros2 topic pub -r 5 /locomotion/move xbot_common_interfaces/msg/LowMoveCmdsMsg "move: [0.0,0.0,0.2,0.97]"
# After this, the robot should be lifted and the control SDK should be shut down, please refer to the low-level joint control sectionPython code example:
#!/usr/bin/env python3
import subprocess
import time
import rclpy
from rclpy.node import Node
from std_srvs.srv import Trigger
from xbot_common_interfaces.srv import SetRLMode
from xbot_common_interfaces.msg import LowMoveCmdsMsg
class LocomotionDemo(Node):
def __init__(self):
super().__init__('locomotion_demo')
self.cli_activate = self.create_client(Trigger, '/activate_service')
self.cli_set_rl_mode = self.create_client(SetRLMode, '/locomotion/set_contoller_mode')
self.move_pub = self.create_publisher(LowMoveCmdsMsg, '/locomotion/move', 10)
self.get_logger().info('Waiting for services...')
self.cli_activate.wait_for_service()
self.cli_set_rl_mode.wait_for_service()
def call_service(self, client, request):
future = client.call_async(request)
rclpy.spin_until_future_complete(self, future)
return future.result()
def set_rl_mode(self, controller_mode: int, sub_mode: int = 0):
req = SetRLMode.Request()
req.controller_mode = controller_mode
req.sub_mode = sub_mode
return self.call_service(self.cli_set_rl_mode, req)
def publish_move_at_hz(self, move_msg: LowMoveCmdsMsg, hz: float, duration_sec: float):
"""Publish move at a fixed frequency; frequency must be ≥2Hz, otherwise stuttering may occur."""
if hz < 2.0:
self.get_logger().warn(f'Publish frequency {hz} Hz is below 2 Hz, stuttering may occur')
period = 1.0 / hz
deadline = time.monotonic() + duration_sec
while time.monotonic() < deadline:
self.move_pub.publish(move_msg)
time.sleep(period)
def run_sequence(self):
# Enable Locomotion algorithm control permission
self.get_logger().info('Enabling Locomotion algorithm control permission...')
self.call_service(self.cli_activate, Trigger.Request())
time.sleep(1)
# Start Locomotion algorithm (this node must be run in a working directory where l3_pub_client.py is accessible)
self.get_logger().info('Starting Locomotion algorithm...')
subprocess.run(
['python', 'l3_pub_client.py', '--type', 'rl', '--cmd', 'start'],
check=False,
)
time.sleep(1)
# RL ready: stand on both feet
self.get_logger().info('Setting RL ready (controller_mode=2, sub_mode=0)...')
self.set_rl_mode(2, 0)
time.sleep(1)
# Walking mode
self.get_logger().info('Setting walking mode (controller_mode=4, sub_mode=0)...')
self.set_rl_mode(4, 0)
time.sleep(1)
# Continuously publish move at 5Hz; robot will stop after publishing stops
self.get_logger().info('Publishing move at 5Hz (forward 0.5, 4th dimension 0.97) for 1 second...')
move_msg = LowMoveCmdsMsg()
move_msg.move = [0.5, 0.0, 0.0, 0.97]
self.publish_move_at_hz(move_msg, hz=5.0, duration_sec=1.0)
# Back to standing / ready
self.get_logger().info('Setting RL ready (standing)...')
self.set_rl_mode(2, 0)
time.sleep(1)
self.get_logger().info('Stopping algorithm process...')
subprocess.run(
['python', 'l3_pub_client.py', '--type', 'rl', '--cmd', 'stop'],
check=False,
)
self.get_logger().info('Operation sequence completed.')
def main(args=None):
rclpy.init(args=args)
node = LocomotionDemo()
try:
node.run_sequence()
finally:
node.destroy_node()
rclpy.shutdown()
if __name__ == '__main__':
main()MPC Interface Description
exclamation When using this interface, please follow the following steps and precautions to ensure the stability and security of the operation:
- Read the current pose: Before sending control commands, the current pose of the robotic arm should be read first to serve as the starting point for trajectory control.
- Gradually approach the target: It is recommended tocontinuously send target poses in small incrementsto gradually guide the robotic arm to the target position.
- Avoid sudden movements: Please avoid sending large pose changes at once. Rapid or large-scale movements may cause instability in the robotic arm's motion or safety risks related to robot posture or motion.
- It is recommended to combine with trajectory planning: This interface is suitable for continuous control. It is recommended to combine with an external trajectory generator or smoothing algorithm to improve control accuracy and safety.
1. servoPose Interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/servo_poses | ROS2 Topic | Control the target pose of the left and right hands | xbot_common_interfaces/msg/ServoPose |
ServoPose.msgincludes three fields:- geometry_msgs/PoseStamped left_pose
- geometry_msgs/PoseStamped right_pose
- geometry_msgs/PoseStamped head_pose
geometry_msgs/PoseStampedStructure:- std_msgs/Header header
- geometry_msgs/Pose pose
2. getPose Interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/get_pose | ROS2 Topic | Obtain the current pose of the left and right hands | xbot_common_interfaces/msg/ServoPose |
ServoPose.msgincludes two fields:- geometry_msgs/PoseStamped left_pose
- geometry_msgs/PoseStamped right_pose
- geometry_msgs/PoseStamped head_pose
geometry_msgs/PoseStampedStructure:- std_msgs/Header header
- geometry_msgs/Pose pose
Use MPC
exclamation Upper limb control is a control program designed for operations on the waist, head, and both arms, precisely controlling the arm end-effector to a set position through dynamic means. If you need to use it, please first start the robot up to the step of "initializing joint modules" and then continue.
Use via command line
# SSH into the robot backend and enter the workspace
ssh developer@192.168.8.100 -p 2222
# Start robot joint motors via the lower-level SDK
# Move the robot to zero position
# Lower the robot from the hanger
# Omitted here, please refer to the low-level joint control section
# Enable algorithm control permission
ros2 service call /activate_service std_srvs/srv/Trigger {}
# Download l3_pub_client.py, used to start MPC
git clone https://github.com/roboterax/teleop_client.git
cd teleop_client
colcon build
source install/setup.bash
# Start MPC algorithm
python l3_pub_client.py --type mpc --cmd start
# Check MPC status; status=1 means started, 0 means not started
python l3_pub_client.py --type mpc --cmd query
# Enable upper limb swinging
ros2 service call /set_rl_ctrl_upperlimb std_srvs/srv/SetBool "data: true"
# Disable upper limb swinging
ros2 service call /set_rl_ctrl_upperlimb std_srvs/srv/SetBool "data: false"
# Reset MPC: 0 raise hands, 1 lower hands
# --mode 0 is also the initial pose after enabling MPC
python l3_pub_client.py --type mpc --cmd reset --mode 0 | 1
# Control arm raising via ROS command only. -r indicates message publish frequency; -r 100 means 100Hz, which controls speed
ros2 topic pub -r 100 /servo_poses xbot_common_interfaces/msg/ServoPose "{
left_pose: {
header: {frame_id: 'base_link'},
pose: {position: {x: 0.425, y: 0.3, z: 0.292}, orientation: {x: 0.612, y: -0.016, z: 0.79, w: -0.006}}
},
right_pose: {
header: {frame_id: 'base_link'},
pose: {position: {x: 0.417, y: -0.146, z: 0.382}, orientation: {x: 0.521, y: 0.1, z: 0.842, w: -0.096}}
},
head_pose: {
header: {frame_id: 'base_link'},
pose: {position: {x: 0.0, y: 0.0, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}
}
}"
# Record actions
ros2 bag record /hand_controller/commands /servo_poses -o mpc_demo
# Stop MPC algorithm
python l3_pub_client.py --type mpc --cmd stopPython code example
import rclpy
from rclpy.node import Node
from std_srvs.srv import Trigger
import subprocess
import time
import textwrap
class MPCStartupDemo(Node):
def __init__(self):
super().__init__('mpc_startup_demo')
self.cli_activate = self.create_client(Trigger, '/activate_service')
self.cli_activate.wait_for_service()
def call_activate_service(self):
self.get_logger().info('Enabling algorithm control permission...')
req = Trigger.Request()
future = self.cli_activate.call_async(req)
rclpy.spin_until_future_complete(self, future)
resp = future.result()
if resp.success:
self.get_logger().info('Algorithm control permission enabled successfully')
else:
self.get_logger().error(f'Enable failed: {resp.message}')
def launch_mpc(self):
self.get_logger().info('Starting MPC algorithm...')
# Start ros2 launch process (note: if an interactive terminal is needed, use shell=True or subprocess.Popen for async mode)
# Using Popen here allows termination via Ctrl+C
subprocess.run(["python", "l3_pub_client.py", "--type", "mpc", "--cmd", "start"])
self.get_logger().info('MPC algorithm started (press Ctrl+C to stop this script if needed)')
def publish_servo_pose_rate(self, rate_hz: int = 10):
"""Continuously publish arm-raising pose to /servo_poses at the specified frequency (default 10Hz)"""
message = textwrap.dedent(
"""
{
left_pose: {
header: {frame_id: 'base_link'},
pose: {position: {x: 0.425, y: 0.3, z: 0.292}, orientation: {x: 0.612, y: -0.016, z: 0.79, w: -0.006}}
},
right_pose: {
header: {frame_id: 'base_link'},
pose: {position: {x: 0.417, y: -0.146, z: 0.382}, orientation: {x: 0.521, y: 0.1, z: 0.842, w: -0.096}}
},
head_pose: {
header: {frame_id: 'base_link'},
pose: {position: {x: 0.0, y: 0.0, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}
}
}
"""
).strip()
self.get_logger().info(f'Publishing /servo_poses arm-raising command at {rate_hz}Hz...')
subprocess.run([
'ros2', 'topic', 'pub', '-r', str(rate_hz),
'/servo_poses', 'xbot_common_interfaces/msg/ServoPose',
message
], check=True)
def main(args=None):
rclpy.init(args=args)
node = MPCStartupDemo()
node.call_activate_service()
# Pause for 1 second to ensure the service takes effect
time.sleep(1)
node.launch_mpc()
node.publish_servo_pose_rate()
node.destroy_node()
rclpy.spin(node)
rclpy.shutdown()
subprocess.run(["python", "l3_pub_client.py", "--type", "mpc", "--cmd", "stop"])
if __name__ == '__main__':
main()Play Recorded Robot Actions
Before playing the action, please upload the recorded action to the robot via the XOS interface.
Please use teleoperation for action recording.
Interface Description:
1. upper_limb_play Interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/gesture/upper_limb_play | ROS2 Topic | Play the built-in action | std_msgs/msg/String |
std_msgs/msg/String: Name of the built-in action
2. is_play Interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/gesture/is_play | ROS2 Service | Query whether an action is currently playing | std_srvs/srv/Trigger |
std_srvs/srv/Trigger: Returns whether it is currently playing
3. stop_play Interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/gesture/stop_play | ROS2 Service | Stop playing | std_srvs/srv/Trigger |
std_srvs/srv/Trigger: Returns whether it is currently playing
4. rosbag_list Interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/gesture/rosbag_list | ROS2 Service | Query action list | xbot_common_interfaces/srv/StringMessage |
xbot_common_interfaces/srv/StringMessage- string data # No need to pass
Result
- bool result # Query success or failure
- string message # String converted from an array of a list
Example:
ros2 service call /gesture/rosbag_list xbot_common_interfaces/srv/StringMessage {}
requester: making request: xbot_common_interfaces.srv.StringMessage_Request(data='')
response:
xbot_common_interfaces.srv.StringMessage_Response(result=True, message='[{"rosbag_name": "run2", "create_time": "2025-05-09 10:20:21", "size": 40633852, "file_size": "38.75 MB", "action_type": "交互动作", "duration_ms": 96825.59, "duration_s": 96.82558999999999, "is_playing": false, "is_paused": false}, {"rosbag_name": "run3", "create_time": "2025-05-09 10:20:06", "size": 40875516, "file_size": "38.98 MB", "action_type": "交互动作", "duration_ms": 97372.486, "duration_s": 97.37248600000001, "is_playing": false, "is_paused": false}]')Use action playback
Use via command line
# SSH into the robot backend and enter the workspace
ssh developer@192.168.8.100 -p 2222
# Start robot joint motors via the lower-level SDK
# Move the robot to zero position
# Lower the robot from the hanger
# Omitted here, please refer to the low-level joint control section
# Enable algorithm control permission
ros2 service call /activate_service std_srvs/srv/Trigger {}
# Start MPC algorithm
python l3_pub_client.py --type mpc --cmd start
# Wait for MPC to finish starting
sleep 3
# For example, play an action named "hello" using the following command
# Note: the action must be uploaded to the XOS system in advance, please refer to the XOS operation documentation
ros2 topic pub -1 /gesture/upper_limb_play std_msgs/msg/String "data: 'hello'"
# Check whether a rosbag is currently playing
# Example return:
# std_srvs.srv.Trigger_Response(success=False, message='No rosbag is playing.')
ros2 service call /gesture/is_play std_srvs/srv/Trigger {}
# Wait for the action to finish playing
sleep 3
# Stop rosbag playback
# Example return:
# std_srvs.srv.Trigger_Response(success=True, message='Rosbag playback stopped.')
ros2 service call /gesture/stop_play std_srvs/srv/Trigger {}
# Query rosbag list
ros2 service call /gesture/rosbag_list xbot_common_interfaces/srv/StringMessage {}Python code example
import rclpy
from rclpy.node import Node
from std_srvs.srv import Trigger
from std_msgs.msg import String
from xbot_common_interfaces.srv import StringMessage
import subprocess
import time, json
class GestureDemo(Node):
def __init__(self):
super().__init__('gesture_demo')
# Service clients
self.cli_activate = self.create_client(Trigger, '/activate_service')
self.cli_is_play = self.create_client(Trigger, '/gesture/is_play')
self.cli_stop_play = self.create_client(Trigger, '/gesture/stop_play')
self.cli_rosbag_list = self.create_client(StringMessage, '/gesture/rosbag_list')
# Publisher
self.gesture_pub = self.create_publisher(String, '/gesture/upper_limb_play', 10)
# Wait for service interfaces to be available
self.get_logger().info('Waiting for services...')
self.cli_activate.wait_for_service()
self.cli_is_play.wait_for_service()
self.cli_stop_play.wait_for_service()
self.cli_rosbag_list.wait_for_service()
def call_service(self, client, request):
future = client.call_async(request)
rclpy.spin_until_future_complete(self, future)
return future.result()
def run_sequence(self):
# # Start robot joint motors via the lower-level SDK
# # Move the robot to zero position
# # Lower the robot from the hanger
# # Omitted here, please refer to the low-level joint control section
# # Enable algorithm control permission
self.get_logger().info('Enabling algorithm control permission...')
self.call_service(self.cli_activate, Trigger.Request())
# # Start MPC algorithm
self.get_logger().info('Starting MPC algorithm...')
subprocess.run(["python", "l3_pub_client.py --type mpc --cmd start"])
# # Wait for MPC to start
self.get_logger().info('Waiting for MPC to start...')
time.sleep(3)
# # Play the action named "hello"
self.get_logger().info("Playing action 'hello' ...")
gesture_msg = String()
gesture_msg.data = 'hello'
self.gesture_pub.publish(gesture_msg)
# # Check whether rosbag is playing
self.get_logger().info("Checking whether rosbag is playing ...")
resp = self.call_service(self.cli_is_play, Trigger.Request())
self.get_logger().info(f'Playback status: success={resp.success}, message="{resp.message}"')
# # Wait for the action to finish
self.get_logger().info('Waiting for action playback...')
time.sleep(3)
# # Stop rosbag playback
self.get_logger().info('Stopping rosbag playback ...')
resp = self.call_service(self.cli_stop_play, Trigger.Request())
self.get_logger().info(f'Stop playback: success={resp.success}, message="{resp.message}"')
# # Stop MPC algorithm
self.get_logger().info('Preparing to stop MPC algorithm...')
subprocess.run(["python", "l3_pub_client.py --type mpc --cmd stop"])
self.get_logger().info('MPC algorithm stopped')
# Query action list
self.get_logger().info('Querying action list...')
list_req = StringMessage.Request()
list_req.data = ''
resp = self.call_service(self.cli_rosbag_list, list_req)
self.get_logger().info(f'Action list response: success={resp.result}, list_str="{resp.message}"')
if resp.result and resp.message:
audio_list = json.loads(resp.message)
def main(args=None):
rclpy.init(args=args)
node = GestureDemo()
node.run_sequence()
node.destroy_node()
rclpy.shutdown()
if __name__ == '__main__':
main()Play Audio on the Robot
Before playing the audio, please upload the prepared audio to the robot via the XOS interface.
Interface Description:
1. play interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/audio_player/play | ROS2 Action | Play the built-in audio | xbot_common_interfaces/action/AudioPlay |
xbot_common_interfaces/action/AudioPlay- int32 ID=0
- int32 PATH=1
- int32 ITEM=2
- int32 mode # 1: use path, 2: use item (JSON or dictionary format string), 3: use file_name
- bool force_play # true: Force play, interrupting the currently playing audio; false: Default logic
- int32 id # Used when mode==0, not currently supported
- string path # Used when mode==1
- string item # Used when mode==2; for example:
- string file_name # Used when mode==3; for example:
- int32 timeout # Play timeout (unit: seconds) Result
- bool success # success or failure
- string message # Reason for success or failure Feedback
- float64 progress # Playback progress
2. is_play Interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/audio_player/is_play | ROS2 Service | Query whether it is currently playing | std_srvs/srv/Trigger |
std_srvs/srv/Trigger: Returns whether it is currently playing
3. stop_play Interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/audio_player/stop_play | ROS2 Service | Stop audio playback | std_srvs/srv/Trigger |
std_srvs/srv/Trigger: Returns the result of stopping playback
4. set_volume Interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/audio_player/set_volume | ROS2 Service | Volume Settings | xbot_common_interfaces/srv/SetVolume |
xbot_common_interfaces/srv/SetVolume- int32 volume # Supports integer values between 0 and 100
Result
- bool success # Adjustment succeeded or failed
- string message # Reason for success or failure
5. audio_list Interface
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/audio_player/audio_list | ROS2 Service | Query audio list | xbot_common_interfaces/srv/StringMessage |
xbot_common_interfaces/srv/StringMessage- string data # No need to pass
Result
- bool result # Query succeeded or failed
- string message # String converted from the array of audio list
Example:
ros2 service call /audio_player/audio_list xbot_common_interfaces/srv/StringMessage {}
requester: making request: xbot_common_interfaces.srv.StringMessage_Request(data='')
response:
xbot_common_interfaces.srv.StringMessage_Response(result=True, message='[{"audio_name": "我是小星.wav", "create_time": "2026-04-08 12:12:18", "size": 257742, "file_size": "251.70 KB", "duration_ms": 8053, "duration_s": 8.053}, {"audio_name": "欢迎各位领导.wav", "create_time": "2025-05-15 18:27:38", "size": 101690, "file_size": "99.31 KB", "duration_ms": 3176, "duration_s": 3.176}]')Usage Method
Use via command line
# Set volume to 50
ros2 service call /audio_player/set_volume xbot_common_interfaces/srv/SetVolume "volume: 50"
# Play the specified audio file by file name
ros2 action send_goal /audio_player/play xbot_common_interfaces/action/AudioPlay "{mode: 3, force_play: true, file_name: 'hello.wav', timeout: 0}"
# Check whether audio is currently playing
ros2 service call /audio_player/is_play std_srvs/srv/Trigger {}
# Wait for audio playback
sleep 3
# Stop audio playback
ros2 service call /audio_player/stop_play std_srvs/srv/Trigger {}
# Query audio list
ros2 service call /audio_player/audio_list xbot_common_interfaces/srv/StringMessage {}Python code example
import rclpy
from rclpy.node import Node
from std_srvs.srv import Trigger
from xbot_common_interfaces.srv import SetVolume
from xbot_common_interfaces.srv import StringMessage
from xbot_common_interfaces.action import AudioPlay
from rclpy.action import ActionClient
import time, json
class AudioPlayerDemo(Node):
def __init__(self):
super().__init__('audio_player_demo')
# Service clients
self.cli_set_volume = self.create_client(SetVolume, '/audio_player/set_volume')
self.cli_is_play = self.create_client(Trigger, '/audio_player/is_play')
self.cli_stop_play = self.create_client(Trigger, '/audio_player/stop_play')
self.cli_audio_list = self.create_client(StringMessage, '/audio_player/audio_list')
# Wait for service/action to be available
self.get_logger().info('Waiting for services and actions...')
self.cli_set_volume.wait_for_service()
self.cli_is_play.wait_for_service()
self.cli_stop_play.wait_for_service()
self.cli_audio_list.wait_for_service()
def call_service(self, client, request):
future = client.call_async(request)
rclpy.spin_until_future_complete(self, future)
return future.result()
def play_audio(self, mode=0, force_play=False, id=5, path='', timeout=0):
goal = AudioPlay.Goal()
goal.mode = mode
goal.force_play = force_play
goal.id = id
goal.path = path
goal.timeout = timeout
send_goal_future = self.audio_play_client.send_goal_async(goal)
rclpy.spin_until_future_complete(self, send_goal_future)
goal_handle = send_goal_future.result()
if not goal_handle.accepted:
self.get_logger().error('Audio playback request was not accepted')
return
# Wait for playback to finish (feedback can also be read, see below)
get_result_future = goal_handle.get_result_async()
rclpy.spin_until_future_complete(self, get_result_future)
result = get_result_future.result().result
self.get_logger().info(f'Audio playback result: success={result.success}, message={result.message}')
def run_sequence(self):
# 1. Set volume to 50
self.get_logger().info('Setting volume to 50...')
vol_req = SetVolume.Request()
vol_req.volume = 50
resp = self.call_service(self.cli_set_volume, vol_req)
self.get_logger().info(f'Volume set: success={resp.success}, message="{resp.message}"')
# # Uncomment the following line if you want to play audio by path
# self.get_logger().info('Playing specified audio by path...')
# self.play_audio(mode=1, force_play=True, id=0, path='/XOS/XOS/data/audio/replay_wav/hello.wav', timeout=0)
# 2. Check whether audio is currently playing
self.get_logger().info('Checking whether audio is playing...')
resp = self.call_service(self.cli_is_play, Trigger.Request())
self.get_logger().info(f'Is playing: success={resp.success}, message="{resp.message}"')
# 3. Wait for audio playback
self.get_logger().info('Waiting for audio playback...')
time.sleep(3)
# 4. Stop audio playback
self.get_logger().info('Stopping audio playback...')
resp = self.call_service(self.cli_stop_play, Trigger.Request())
self.get_logger().info(f'Stop playback: success={resp.success}, message="{resp.message}"')
# 5. Query audio list
self.get_logger().info('Querying audio list...')
list_req = StringMessage.Request()
list_req.data = ''
resp = self.call_service(self.cli_audio_list, list_req)
self.get_logger().info(f'Audio list response: success={resp.result}, list_str="{resp.message}"')
if resp.result and resp.message:
audio_list = json.loads(resp.message)
def main(args=None):
rclpy.init(args=args)
node = AudioPlayerDemo()
node.run_sequence()
node.destroy_node()
rclpy.shutdown()
if __name__ == '__main__':
main()Directly use audio devices in the developer environment
The robot integrates a microphone and a speaker, which can be directly used in the system
exclamation Before using the audio device, please ensure that the voice interaction function is turned off in XOS to avoid being unable to open the audio device
Usage Method
Test whether the device is functioning properly via the command line
# Log into the developer environment (password: developer)
ssh developer@192.168.8.100 -p 2222 # SSH into the robot backend and enter the workspace
# Install audio libraries
sudo apt update
sudo apt install libportaudio2 python3-pyaudio portaudio19-dev
# Install virtual environment dependencies
curl -L -A "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36" \
-o python3-pip-whl_22.0.2+dfsg-1_all.deb \
"https://mirrors.ustc.edu.cn/ubuntu/pool/universe/p/python-pip/python3-pip-whl_22.0.2+dfsg-1_all.deb"
sudo dpkg -i python3-pip-whl_22.0.2+dfsg-1_all.deb
sudo apt-get install --fix-broken python3.10-venv
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies (if installation fails, you can specify a mirror source)
# Aliyun mirror example: pip install sounddevice scipy -i https://mirrors.aliyun.com/pypi/simple/
# Tsinghua mirror example: pip install sounddevice scipy -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn
pip install sounddevice scipy
# Grant permissions to snd devices to avoid issues
sudo chmod 777 /dev/snd/*
# Read sound card information:
python3 -c "import sounddevice as sd; print(sd.query_devices())"
# If successful, you should see output similar to the following:
developer@xbot-NUC:~$ python3 -c "import sounddevice as sd; print(sd.query_devices())"
< 0 HD-Audio Generic: HDMI 0 (hw:0,3), ALSA (0 in, 8 out)
1 HD-Audio Generic: HDMI 1 (hw:0,7), ALSA (0 in, 8 out)
2 HD-Audio Generic: HDMI 2 (hw:0,8), ALSA (0 in, 8 out)
3 HD-Audio Generic: HDMI 3 (hw:0,9), ALSA (0 in, 8 out)
> 4 POROSVOC: USB Audio (hw:1,0), ALSA (1 in, 0 out)
5 HD-Audio Generic: ALC897 Analog (hw:2,0), ALSA (2 in, 2 out)
6 USB Audio Device: - (hw:3,0), ALSA (1 in, 2 out)
7 hdmi, ALSA (0 in, 8 out)Python code example
import sounddevice as sd
import numpy as np
from scipy.signal import resample
duration = 2.0 # seconds
# Adjust input and output devices as needed
sd.default.device = (6, 6) # Default audio device for L3 is device 6
# Get default device indices
input_device, output_device = sd.default.device
# Get device parameters
input_info = sd.query_devices(input_device)
output_info = sd.query_devices(output_device)
input_samplerate = int(input_info['default_samplerate'])
output_samplerate = int(output_info['default_samplerate'])
channels = input_info['max_input_channels']
print(f"🎤 Recording {duration} seconds from default input device (device {input_device}) @ {input_samplerate} Hz, channels: {channels}")
sd.default.device = (input_device, output_device)
# Recording
recording = sd.rec(int(input_samplerate * duration), samplerate=input_samplerate, channels=channels, dtype='int16')
sd.wait()
# Amplify volume, adjust as needed
amplified = recording * 1
amplified = np.clip(amplified, -32768, 32767).astype(np.int16)
# If playback sample rate differs from recording, perform resampling
if input_samplerate != output_samplerate:
print(f"🔁 Resampling audio from {input_samplerate} Hz to {output_samplerate} Hz for playback")
num_samples = int(output_samplerate * duration)
amplified = resample(amplified, num_samples).astype(np.int16)
print(f"🔊 Playing from default output device (device {output_device})...")
sd.play(amplified, samplerate=output_samplerate)
sd.wait()
print("✅ Playback finished")Obtain battery information in the developer environment
The robot is installed with a battery, and battery information can be viewed in the system
Usage Method
Obtain battery information via the command line
| Interface Name | Type | Function Description | Message Type |
|---|---|---|---|
/battery_state | ROS2 Topic | Get battery information | sensor_msgs/msg/BatteryState |
BatteryState.msg is a ROS2 standard interface, mainly using the following fields:
voltage: battery voltage, unitVtemperature: battery temperature, unit℃current: battery current, unitAcharge: current battery capacity, unitAhdesign_capacity: Battery rated capacity, unitAhpercentage: current battery level, unit%power_supply_status: charging status,0=standby, 1=charging, 2=discharging
ros2 topic echo --once /battery_stateUsing a depth camera in a developer environment
L7 Robot Realsense Camera, which can be directly used in the developer environment
Open realsense-viewer to view the device
- Download Mobaxterm for Windows environment and access: https://mobaxterm.mobatek.net/
ssh -X developer@192.168.8.100 -p 2222- Re-enter the Linux environment:
ssh -X developer@192.168.8.100 -p 2222- Launching realsense-viewer in the terminal can open the GUI for operation
realsense-viewer- By starting realsense2_camera, image-related data can be sent out in real time via ROS
ros2 launch realsense2_camera rs_launch.py
# If you want to set the resolution
ros2 launch realsense2_camera rs_align_depth_launch.py depth_module.depth_profile:=848x480x60 rgb_camera.color_profile:=848x480x60- Use ros2 topic list to view image messages
/camera/camera/color/camera_info
/camera/camera/color/image_raw
/camera/camera/color/metadata
/camera/camera/depth/camera_info
/camera/camera/depth/image_rect_raw
/camera/camera/depth/metadata
/camera/camera/extrinsics/depth_to_color
/tf_static| topic name | Data Type | Meaning |
|---|---|---|
| /camera/camera/color/camera_info | sensor_msgs/msg/CameraInfo | Internal parameters of the color camera (K matrix, distortion parameters, etc.) |
| /camera/camera/color/image_raw | sensor_msgs/msg/Image | RGB color image raw data |
| /camera/camera/color/metadata | realsense2_camera_msgs/msg/Metadata | Frame metadata (timestamp, exposure, gain, etc.) |
| /camera/camera/depth/camera_info | sensor_msgs/msg/CameraInfo | Internal parameters of the depth camera |
| /camera/camera/depth/image_rect_raw | sensor_msgs/msg/Image | Aligned or rectified depth map |
| /camera/camera/depth/metadata | realsense2_camera_msgs/msg/Metadata | Frame metadata (timestamp, exposure, gain, etc.) |
| /camera/camera/extrinsics/depth_to_color | realsense2_camera_msgs/msg/Extrinsics | Extrinsic matrix of the depth → color camera |
| /tf_static | tf2_msgs/msg/TFMessage | Static coordinate transformation (camera coordinate system, etc.) |
Recording and playback of robot actions in the developer environment
- Start teleoperation
⚠️ Teleoperation requires two people to cooperate simultaneously. Before stopping the MPC, the head-mounted display operator must not move unexpectedly.
- Record robot actions
⚠️ Note:teleoperationcan only be initiated after ensuring that human movements are consistent with the robot's movements.
# Enter developer environment
ssh developer@192.168.8.100 -p 2222 # password: developer
# If teleop_client has already been pulled
cd teleop_client
colcon build
source install/setup.bash
# If the teleop_client directory does not exist, please follow step 1 in the teleoperation service startup instructions
# Clone teleop_client
git clone https://github.com/roboterax/teleop_client
# Recording
ros2 bag record /hand_controller/commands /servo_poses -o [bag package name]
# The name after -o defines the saved package name
# Save recording: press Ctrl+C in the terminal running the recording to stop- Play robot action
# Start SDK; if already started, do not start again
python l3_pub_client.py --cmd start_sdk
# Start MPC algorithm
python l3_pub_client.py --type mpc --cmd start
# Switch MPC
python l3_pub_client.py --cmd enable_rl --mode 0
# Play
ros2 bag play [bag package name]
# [bag package name] is the recorded robot motion
# Stop MPC algorithm
python l3_pub_client.py --type mpc --cmd stop
# Stop
Ctrl-C mpc terminal
python l3_pub_client.py --cmd stop_sdkConfigure program auto-start in the developer environment
In the developer environment, you can configure programs to start automatically by modifying /ros_entrypoint.sh. This script is executed when the developer environment starts, and can be used to launch background services or user programs automatically.
Open and edit the
/ros_entrypoint.shfile.Add the command for the program to be started before the last line
exec "$@". For example:
#!/bin/bash
set -e
# setup ros2 environment
source "/opt/ros/$ROS_DISTRO/setup.bash"
sudo /usr/sbin/sshd -D &
sudo bash /usr/local/bin/maps/video.sh &
exec "$@"Note: Add & at the end of the command so that the program runs in the background.
Maintenance and Upkeep
Battery Charging and Replacement
To ensure the battery performance and service life of the robot, please charge and use it at an appropriate temperature, avoid overcharging and over-discharging, and conduct regular inspections and maintenance. The battery should be stored in a dry and well-ventilated environment, avoiding direct sunlight and extreme temperatures. When a decline in battery performance or damage is detected, it should be replaced promptly. Following these maintenance recommendations can effectively extend the battery's service life and ensure the safety of the robot.
Daily maintenance
Daily maintenance of robot batteries is very important, as it can ensure the normal operation of the robot and extend the battery's service life. The following are some basic maintenance tips and precautions:
- Battery Charging: New batteries should be fully charged before first use. Even if not used for a long time, they should be fully charged at least once a month to avoid battery aging;
- Battery Replacement: The backup battery of the robot should be replaced regularly. For example, the maintenance cycle of the robot can be one and a half years, and it should also be replaced promptly when the battery voltage drop alarm is triggered;
- Battery Usage: Battery charging usually takes only 3 - 4 hours, and the usage time can vary from 45 minutes to 4 hours depending on usage. It is recommended to keep the battery charge level between 30% and 70 - 80%, avoiding keeping the battery at 100% or below 30% for an extended period, as this will accelerate battery aging;
- Battery Storage: If the robot is not used for an extended period, the battery should be stored under appropriate conditions to avoid deep discharge and charged at least once every month;
- Battery Maintenance: During daily maintenance, attention should be paid to checking the battery voltage, promptly replacing batteries that show a voltage drop alarm, and ensuring that the power, air pressure, and hydraulic supply of the robot are turned off when replacing batteries.
- Safe Operation: When performing battery replacement or maintenance, ensure that the robot has been powered off and is in a stopped state to avoid accidental injury;
- Environmental Factors: The maintenance and upkeep of batteries should also take into account environmental factors, such as temperature and humidity, to ensure the stability and safety of battery performance.