Skip to content

Overview

The Lite3 Motion SDK is a low-level UDP motion control library responsible for direct communication with Lite3 robot firmware, implementing the deployment of Model Predictive Control (MPC) algorithms on the Lite3. Developers can read onboard perception data (joint states, IMU, contact forces, etc.) and send control commands to 12 joints. The main workflow is as follows:

Test Workflow

The responsibilities of the Motion SDK include:

  • Receiving joint states, IMU data, and contact force information reported by the robot via UDP
  • Sending 12-joint control commands to the robot via UDP
  • Managing control authority handover between the SDK and the robot
  • Providing auxiliary tools such as timers and trajectory planning
Lite3_MotionSDK/
├── include/
│ ├── common/
│ │ ├── basesocket.hpp # Socket base class
│ │ ├── command.h # Command protocol definitions
│ │ ├── udpserver.hpp # UDP server (port binding, broadcast)
│ │ └── udpsocket.hpp # UDP send/receive implementation
│ ├── dr_timer.h # High-precision timer (timerfd + epoll)
│ ├── motionexample.h # Stand-up example interface
│ ├── receiver.h # Data receiver
│ ├── robot_types.h # Robot data type definitions
│ └── sender.h # Command sender
├── src/
│ └── motionexample.cpp # Stand-up example implementation
├── lib/
│ ├── eigen3/ # Eigen matrix library
│ ├── libdeeprobotics_legged_sdk_aarch64.so # ARM pre-compiled library
│ └── libdeeprobotics_legged_sdk_x86_64.so # x86 pre-compiled library
├── main.cpp # Entry example
├── CMakeLists.txt # Build configuration
└── LICENSE

The Motion SDK provides 5 control parameter interfaces at the low-speed end (joint end): posgoalpos_{goal}, velgoalvel_{goal}, kpkp, kdkd, tfft_{ff}.

When the SDK has commands to send, the low-level controller prioritizes the SDK control commands and distributes them to the 12 joints. The target joint torque is computed from the 5 control parameters as:

T=kp×(posgoal−posreal)+kd×(velgoal−velreal)+tffT = kp \times (pos_{goal} - pos_{real}) + kd \times (vel_{goal} - vel_{real}) + t_{ff}

The driver converts the final target joint torque into the desired current and performs closed-loop control at 20kHz.

The control workflow is shown below:

Control Flow

Control Modeposgoalpos_{goal}velgoalvel_{goal}kpkpkdkdtfft_{ff}Description
Position control3.1403000Motor output shaft stabilizes at a fixed position
Velocity control05010Motor rotates at target velocity
Damping control00010Pure damping, no active torque
Torque control00003Pure feedforward torque output
Zero-torque control00000Joint swings freely
Mixed control3.1403011Position + damping + feedforward

When the SDK has no commands to send, after a 1-second timeout, the low-level controller reclaims control authority and enters damping protection mode for a period before clearing joint commands. Therefore, developers must ensure continuous command delivery or proactively return control authority.

ResourceDescription
Lite3_MotionSDKMotion SDK repository