High-Level Motion Control Service
About 2370 wordsAbout 8 min
2025-07-0810:18:56
Provides robot system high-level motion control service. Through the
HighLevelMotionController
, you can control robot gait, tricks, and remote control via RPC communication.
Interface Definition
HighLevelMotionController
is a high-level motion controller for semantic control, supporting control operations such as walking, tricks, head movement, etc., encapsulating low-level details for upper system calls.
HighLevelMotionController
Item | Content |
---|---|
Function Name | HighLevelMotionController |
Function Declaration | HighLevelMotionController(); |
Function Overview | Constructor, initializes high-level controller state |
Notes | Constructs internal control resources |
~HighLevelMotionController
Item | Content |
---|---|
Function Name | ~HighLevelMotionController |
Function Declaration | virtual ~HighLevelMotionController(); |
Function Overview | Destructor, releases controller resources |
Notes | Used in conjunction with constructor |
Initialize
Item | Content |
---|---|
Function Name | Initialize |
Function Declaration | virtual bool Initialize() override; |
Function Overview | Initialize controller, prepare high-level control functions |
Return Value | true indicates success, false indicates failure |
Notes | Must be called before first use |
Shutdown
Item | Content |
---|---|
Function Name | Shutdown |
Function Declaration | virtual void Shutdown() override; |
Function Overview | Shutdown controller and release resources |
Notes | Used in conjunction with Initialize, safely disconnect |
SetGait
Item | Content |
---|---|
Function Name | SetGait |
Function Declaration | Status SetGait(const GaitMode gait_mode); |
Function Overview | Set robot gait mode (such as recovery stand, balance stand, humanoid walk, etc.) |
Parameter Description | gait_mode : Gait control enumeration |
Return Value | Status::OK indicates success, others indicate failure |
Notes | Blocking interface, can switch between multiple gait modes |
GetGait
Item | Content |
---|---|
Function Name | GetGait |
Function Declaration | Status GetGait(GaitMode& gait_mode); |
Function Overview | Get robot gait mode (such as recovery stand, balance stand, humanoid walk, etc.) |
Parameter Description | gait_mode : Gait control enumeration |
Return Value | Status::OK indicates success, others indicate failure |
Notes | Blocking interface, gets current gait mode |
ExecuteTrick
Item | Content |
---|---|
Function Name | ExecuteTrick |
Function Declaration | Status ExecuteTrick(const TrickAction trick_action); |
Function Overview | Execute trick actions (such as welcome, etc.) |
Parameter Description | trick_action : Trick action identifier |
Return Value | Status::OK indicates success, others indicate failure |
Notes | Blocking interface, ensure robot can currently execute tricks Note: Trick actions must be performed in GaitMode::GAIT_BALANCE_STAND(46) gait |
- Note: Trick actions must be performed in GaitMode::GAIT_BALANCE_STAND(46) gait to execute trick demonstrations
SendJoyStickCommand
Item | Content |
---|---|
Function Name | SendJoyStickCommand |
Function Declaration | Status SendJoyStickCommand(const JoystickCommand& joy_command); |
Function Overview | Send real-time joystick control commands |
Parameter Description | joy_command : Control data containing joystick coordinates |
Return Value | Status::OK indicates success, others indicate failure |
Notes | Non-blocking interface, recommended sending frequency is 20Hz |
Type Definitions
JoystickCommand
— High-Level Motion Control Joystick Command Structure
Field Name | Type | Description |
---|---|---|
left_x_axis | float | Left joystick X-axis direction value (-1.0: left, 1.0: right) |
left_y_axis | float | Left joystick Y-axis direction value (-1.0: down, 1.0: up) |
right_x_axis | float | Right joystick X-axis direction value (rotation -1.0: left, 1.0: right) |
right_y_axis | float | Right joystick Y-axis direction value (purpose not yet defined) |
Enumeration Type Definitions
GaitMode
— Robot Gait Mode Enumeration
Enumeration Value | Value | Description |
---|---|---|
GAIT_PASSIVE | 0 | Passive |
GAIT_RECOVERY_STAND | 1 | Recovery Stand |
GAIT_BALANCE_STAND | 46 | Balance Stand (supports movement) |
GAIT_ARM_SWING_WALK | 78 | Arm Swing Walk |
GAIT_HUMANOID_WALK | 79 | Humanoid Walk |
GAIT_LOWLEVL_SDK | 200 | Low-Level Control SDK Mode |
TrickAction
— Trick Action Command Enumeration
Enumeration Value | Value | Description |
---|---|---|
ACTION_CELEBRATE | 201 | Celebrate |
ACTION_SHAKE_LEFT_HAND_REACHOUT | 215 | Handshake (Left Hand) - Reach Out |
ACTION_SHAKE_LEFT_HAND_WITHDRAW | 216 | Handshake (Left Hand) - Withdraw |
ACTION_SHAKE_RIGHT_HAND_REACHOUT | 217 | Handshake (Right Hand) - Reach Out |
ACTION_SHAKE_RIGHT_HAND_WITHDRAW | 218 | Handshake (Right Hand) - Withdraw |
ACTION_SHAKE_HEAD | 220 | Shake Head |
ACTION_LEFT_GREETING | 300 | Greeting (Left Hand) |
ACTION_RIGHT_GREETING | 301 | Greeting (Right Hand) |
ACTION_TRUN_LEFT_INTRODUCE_HIGH | 304 | Turn Left Introduction - High |
ACTION_TRUN_LEFT_INTRODUCE_LOW | 305 | Turn Left Introduction - Low |
ACTION_TRUN_RIGHT_INTRODUCE_HIGH | 306 | Turn Right Introduction - High |
ACTION_TRUN_RIGHT_INTRODUCE_LOW | 307 | Turn Right Introduction - Low |
ACTION_WELCOME | 340 | Welcome |
Joystick Diagram
- The X-axis and Y-axis value ranges for left and right joysticks are [-1.0, 1.0];
- The up/right direction of the left and right joystick X-axis and Y-axis is positive, as shown in the diagram;
High-Level Motion Control Robot State Introduction
Robot motion includes recovery stand, balance stand, basic motion, and trick action states. During operation, the robot switches between different states through a state machine to achieve different control tasks. The explanations for each state are as follows:
- Recovery Stand: Recovery stand is the state connecting robot suspension landing and balance stand. The robot needs to enter the balance stand state before calling corresponding motion services to achieve robot control.
- Balance Stand: In the balance stand state, you can call various SDK interfaces to achieve robot trick actions and basic motion control.
- Basic Motion: During motion execution, you can call SDK interfaces to make the robot enter different gaits.
- Trick Actions: When entering the special action execution state, other motion control services will be suspended first, waiting for the current action to complete and enter the balance stand state before taking effect again.
Robot state switching mechanism;
High-Level Motion Control Interface
Robot high-level motion control services can be divided into basic motion control and trick action control.
- In basic motion control services, you can call corresponding interfaces to switch robot walking gaits according to different terrain scenarios and task requirements.
- In trick action control services, you can call corresponding interfaces to achieve robot built-in special tricks, such as celebrate, handshake, greeting, etc.
Gait Switching
Current Gait | Gait Switching Process | Diagram |
---|---|---|
Recovery Stand | ![]() | |
Balance Stand | ![]() | |
Arm Swing Walk | ![]() | |
Humanoid Walk | ![]() |
Trick Execution
Trick | Trick Execution Process | Diagram |
---|---|---|
Welcome | ![]() | |
Shake Head | ![]() | |
Greeting (Left Hand) | ![]() | |
Greeting (Right Hand) | ![]() | |
Handshake (Left Hand) | ![]() | |
Handshake (Right Hand) | ![]() | |
Turn Left Introduction | ![]() | |
Turn Right Introduction | ![]() |