High-Level Motion Control Service
About 2559 wordsAbout 9 min
2025-05-29
Provides high-level motion control services for the robot system. Through HighLevelMotionController, you can control robot gait, trick actions, and remote control via RPC communication.
Interface Definition
HighLevelMotionController
is a high-level motion controller for semantic control, supporting control operations such as walking, trick actions, head movement, etc., encapsulating low-level details for high-level 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 walking, 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 walking, 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 celebrate, wave, 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_PURE_DAMPER | 0 | Pure Damper |
GAIT_RECOVERY_STAND | 1 | Recovery stand |
GAIT_BALANCE_STAND | 46 | Balance stand (supports movement) |
GAIT_ARM_SWING_WALK | 47 | Arm swing walking |
GAIT_LOWLEVL_SDK | 200 | Low-level control SDK mode |
TrickAction
— Trick Action Command Enumeration
Enumeration Value | Value | Description |
---|---|---|
ACTION_RECOVERY_STAND | 103 | Balance stand |
ACTION_CELEBRATE | 201 | Celebrate |
ACTION_SHAKE_HAND_REACHOUT | 217 | Handshake - reach out |
ACTION_SHAKE_HAND_WITHDRAW | 218 | Handshake - withdraw |
ACTION_NOD_HEAD | 219 | Nod head |
ACTION_SHAKE_HEAD | 220 | Shake head |
ACTION_CIRCLE_HEAD | 221 | Circle head |
ACTION_GTEETING | 301 | Greeting |
ACTION_POINT_GROUND | 302 | Point ground - reach out |
ACTION_POINT_GROUND_WITH_DRAW | 303 | Point ground - withdraw |
ACTION_SPREAD_HAND | 304 | Spread hand |
ACTION_SPREAD_HAND_WITH_DRAW | 305 | Spread hand - withdraw |
ACTION_TRUN_AWAY_LEFT_INTRODUCE | 306 | Turn away left introduce |
ACTION_TRUN_BACK_LEFT_INTRODUCE | 307 | Turn back left introduce |
Joystick Diagram
- The range of left and right joystick x-axis and y-axis values is [-1.0, 1.0];
- The direction of left and right joystick x-axis and y-axis is up/right as 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 the corresponding motion services to achieve robot control.
- Balance Stand: In the balance stand state, you can call various SDK interfaces to implement 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 implement 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 Walking | ![]() | ![]() |
Trick Execution
Trick | Trick Execution Process | Diagram |
---|---|---|
Celebrate | ![]() | ![]() |
Handshake | ![]() | ![]() |
Nod head | ![]() | ![]() |
Shake head | ![]() | ![]() |
Circle head | ![]() | ![]() |
Greeting | ![]() | ![]() |
Point Ground | ![]() | ![]() |
Spread hand | ![]() | ![]() |
Turn Body | ![]() | ![]() |