How each robot turns a command into motion, from the highest level we can command down to the motors.
M20 Pro
DEEP Robotics’ M20 SDK repository exposes three levels of control:
- High level: a body-velocity interface (forward, lateral and yaw rate).
- Mid level: a joint-angle and wheel-velocity interface, which the RL locomotion policy drives.
- Low level: a motor SDK for commanding the joint motors directly.
1. High level: body velocity
The simplest way to control the M20 is to send it a body velocity. The command comes from a user or a planner and generally feeds a locomotion policy, which works out how to move the joints (see the next section):
| Command | Training range |
|---|---|
| vx (forward) | ±2.0 m/s |
| vy (lateral) | ±1.0 m/s |
| wz (yaw rate) | ±2.0 rad/s |
There is no command for body height, pitch, gait or mode. The controller app, our planners and the m20-android-sdk all work at this level.
2. Down to the joints: the RL policy
A reinforcement-learning policy turns the velocity command into joint targets. At each step (50 Hz), it reads the command and the robot’s state and outputs 16 targets, one per joint. A PD controller turns those targets into motor torques at 200 Hz.
| Joints | The policy sets |
|---|---|
| 12 leg joints (hip ×2 and knee, on each leg) | A target angle for each joint |
| 4 wheels | A target speed for each wheel |
Working at this level means writing our own policy or controller that outputs joint angles and wheel speeds in place of DEEP Robotics’ one, while the PD loop stays the same.
3. Low level: the motors
Below the PD loop, the motor SDK would let us command each joint motor directly. With access to it, we could replace the PD loop as well and run our own low-level controllers, such as torque control, on all 16 joints.
X30 Pro
The X30 can be commanded at three levels, all through DEEP Robotics’ official interfaces:
- Navigation tasks: a list of waypoints, sent to
robot_serveron the navigation computer. - Body velocity and gait: forward, lateral and yaw rate, plus which gait to walk in.
- The motion controller: UDP commands straight to the motion computer, described in the vendor’s API documentation.
1. Navigation tasks
robot_server listens on TCP port 30000. Each waypoint carries its pose, floor, gait, speed, navigation mode, terrain mode and obstacle-avoidance setting, and the vendor’s planner and path tracker drive each leg. Our route_manager and the Route Control panel speak this protocol; see Waypoint Navigation.
2. Body velocity and gait
Velocity commands go through the vendor’s safety_node on the perception computer, which brakes for obstacles and caps every command, before they reach the motion computer:
joystick or planner ─► (our terrain_gait_gate) ─► /cmd_vel ─► safety_node ─► /cmd_vel_corrected ─► motion computer
| Command | safety_node cap (navigation mode) |
|---|---|
| vx (forward / back) | 0.6 / 0.6 m/s |
| vy (lateral) | 0.15 m/s |
| wz (yaw rate) | 0.45 rad/s |
Each gait has its own top speed, from the vendor’s API documentation (Appendix B), before the caps above:
| Gait | Forward / back / lateral (m/s) | Yaw (rad/s) | /set_gait |
|---|---|---|---|
| Walk | 1.2 / 0.75 / 0.15 | 0.45 | 0 |
| Slope | 0.7 / 0.75 / 0.25 | 0.5 | 2 |
| Off-road | 0.3 / 0.4 / 0.1 | 0.5 | 1 |
| Stair | 0.3 / 0.3 / 0.2 | 0.8 | 6 |
| L-Walk (RL) | 1.0 / 1.0 / 0.5 | 1.2 | – |
| Mountain (RL) | 1.0 / 1.0 / 0.8 | 1.2 | – |
- Gait changes go on
/set_gait(std_msgs/Int32) and are confirmed on/robot_gait_state, which uses its own numbering (6 = stair, 32–34 = the RL gaits). Change gait only while standing still. Ourterrain_gaitdoes this for you. - Turning differs per gait. Walk turns on the spot but takes very wide turns while moving; slope and the RL gaits turn well while moving. Our controllers model this per gait.
- Who is in control is set by
/vel_source; commands from a planner are used only when the robot isn’t in manual mode.
3. The motion controller
The motion computer runs DEEP Robotics’ controller, which holds both model-based gaits (walk, slope, stair) and reinforcement-learning policies (L-Walk, Mountain, Silent and others). It takes UDP commands on port 43893, documented in the vendor’s API manual.
The same RL policies also run in MuJoCo through the robot’s SDK, which gives us a safe place to try new commands and controllers before they reach the real robot:
The X30 walk policy in MuJoCo.
The X30 silent-gait policy in MuJoCo.