Low Level Motion Control Service
About 1429 wordsAbout 5 min
2025-05-29
Provides low-level motion control services for the robot system. Through LowLevelMotionController, you can use topic-based communication to send joint commands and receive joint states.
Interface Definition
LowLevelMotionController
is a motion controller for low-level development, supporting direct control and state subscription of leg and other moving parts.
LowLevelMotionController
Item | Description |
---|---|
Function Name | LowLevelMotionController |
Declaration | LowLevelMotionController(); |
Overview | Constructor, initializes the low-level controller object. |
Note | Constructs internal resources. |
~LowLevelMotionController
Item | Description |
---|---|
Function Name | ~LowLevelMotionController |
Declaration | virtual ~LowLevelMotionController(); |
Overview | Destructor, releases resources. |
Note | Cleans up low-level resources. |
Initialize
Item | Description |
---|---|
Function Name | Initialize |
Declaration | virtual bool Initialize() override; |
Overview | Initializes the controller and establishes low-level connections. |
Return Value | true means success, false means failure. |
Note | Must be initialized on first call. |
Shutdown
Item | Description |
---|---|
Function Name | Shutdown |
Declaration | virtual void Shutdown() override; |
Overview | Shuts down the controller and releases low-level resources. |
Note | Used together with Initialize. |
SetPeriodMs
Item | Description |
---|---|
Function Name | SetPeriodMs |
Declaration | void SetPeriodMs(uint64_t period_ms); |
Overview | Set control period time (milliseconds). |
Parameter | period_ms : Period time in milliseconds. |
Note | Non-blocking interface. The controller uses this period parameter internally to set the frequency of joint command sending. |
SubscribeLegState
Item | Description |
---|---|
Function Name | SubscribeLegState |
Declaration | void SubscribeLegState(LegJointStateCallback callback); |
Overview | Subscribe to leg joint state data. |
Parameter | callback: Callback function to handle received leg joint state data. |
Note | Non-blocking interface. |
PublishLegCommand
Item | Description |
---|---|
Function Name | PublishLegCommand |
Declaration | Status PublishLegCommand(const LegJointCommand& command); |
Overview | Publish leg joint control command. |
Parameter | command: Leg joint control command containing target position/velocity and other control information. |
Return Value | Status::OK means success, others mean failure. |
Note | Non-blocking interface. |
EnableSendMsg
Item | Description |
---|---|
Function Name | EnableSendMsg |
Declaration | void EnableSendMsg(bool enable); |
Overview | LCM channel switch |
Parameter | enable: LCM channel switch information |
Note | When using high-level motion control, turn off the LCM channel; when using low-level motion control, turn on the LCM channel. |
Type Definitions
SingleLegJointCommand
— Control command for a single leg joint
Field Name | Type | Description |
---|---|---|
q_des | float | Desired joint position |
dq_des | float | Desired joint velocity |
tau_des | float | Desired feedforward torque |
kp | float | P gain, must be positive |
kd | float | D gain, must be positive |
LegJointCommand
— Control command for the entire leg
Field Name | Type | Description |
---|---|---|
timestamp | int64_t | Timestamp (unit: nanoseconds) |
cmd | std::array<SingleLegJointCommand, kLegJointNum> | Array of control commands |
SingleLegJointState
— State of a single leg joint
Field Name | Type | Description |
---|---|---|
q | float | Actual joint position |
dq | float | Actual joint velocity |
tau_est | float | Estimated torque |
LegState
— State information for the entire leg
Field Name | Type | Description |
---|---|---|
timestamp | int64_t | Timestamp (unit: nanoseconds) |
state | std::array<SingleLegJointState, kLegJointNum> | All leg joint states |
URDF Reference
Introduction to Low Level Motion Control Robot States
The robot's low-level motion mainly provides three-loop joint control for developers to enable secondary development of robot motion capabilities. The basic control state switching mechanism: