7.2 Action Playback Section
7.2 Action Playback Section
7.2.1 Overview
The A2 Lite provides basic preset action playback capabilities, with some preset actions pre-installed on the machine (additional actions can be recorded using remote operation devices to meet more personalized needs; for more information, please refer to the relevant documentation on remote operation). The list of default preset actions is as follows:
双手挥手/双手挥手
右手挥手/右手挥手
右手握手/右手握手
右手握手_长/右手握手_长
向右张望/1758103570432482028
向左张望/1758103588180395683
左手挥手/左手挥手
左手握手/左手握手
左手握手_长/左手握手_长
摆拍_我是大力士/摆拍_我是大力士
敬礼/敬礼
环顾四周/1758103607745291736
看双手/1758104272873252746
看右手/1758104294863353043
看右臂/1758103484383524451
看左手/175810431583786588
看左臂/1758103505321711264
The above action files are located in the x86 directory /agibot/data/resources/default/motion/motion_player/default. Custom recorded actions should be placed in the /agibot/data/resources/default/motion/motion_player/custom directory. The above list is obtained by specifying the following command in the corresponding directory:
find . -name "*.db" -type f | sed 's|^\./\([^/]*\)/\(.*\)\.db|\1/\2|' | sort
The specific action effects can be viewed using the motion control simulation provided in subsequent chapters or directly on the real machine.
Onboard action playback is handled by the motion_player module, which controls the arm and neck joints in JOINT_SERVO mode. The basic control principle involves reading and parsing the specified action file, playing the action file at 100 Hz, and sending /motion/control/arm_joint_command and /motion/control/neck_joint_command to the motion control module, which then performs the corresponding actions.
7.2.2 Action Playback RPC Interface
| Interface Name | pb:/aimdk.protocol.MotionCommandService/SendMotionCommand |
|---|---|
| Function Summary | Play the specified action file |
| Interface Type | HTTP JSON RPC |
| URL | http://127.0.0.1:56444/rpc/aimdk.protocol.MotionCommandService/SendMotionCommand |
| Input Parameters | text
|
| Output Parameters | text
|
| Example Script | examples/motion_player/send_motion_id.sh |
| Notes | This interface call code is T2, and can only be called under the JOINT_SERVO suffix motion control Action |
7.2.3 Action Playback Status Query RPC Interface
| Interface Name | pb:/aimdk.protocol.MotionCommandService/GetMotionStatus |
|---|---|
| Function Summary | Get the action playback status |
| Interface Type | HTTP JSON RPC |
| URL | http://127.0.0.1:56444/rpc/aimdk.protocol.MotionCommandService/GetMotionStatus |
| Input Parameters | text |
| Output Parameters | text
|
| Example Script | examples/motion_player/get_motion_status.sh |
| Notes | This interface call code is T2, and can only be called under the JOINT_SERVO suffix motion control Action |
7.2.4 Disable and Enable Action Playback Module RPC Interface
The action playback module continuously sends /motion/control/arm_joint_command and /motion/control/neck_joint_command control instructions to the motion control module in JOINT_SERVO mode. If a secondary program also sends instructions, it can cause conflicts. You can use the following interfaces to disable and enable the action playback module.
| Interface Name | pb:/aimdk.protocol.MotionCommandService/DisableMotionPlayer |
|---|---|
| Function Summary | Disable the action playback module, the process will not exit, and no instructions will be sent to the motion control module |
| Interface Type | HTTP JSON RPC |
| URL | http://127.0.0.1:56444/rpc/aimdk.protocol.MotionCommandService/DisableMotionPlayer |
| Input Parameters | text |
| Output Parameters | text
|
| Example Script | examples/motion_player/disable_motion_player.sh |
| Notes | This interface has no call code restriction |
| Interface Name | pb:/aimdk.protocol.MotionCommandService/EnableMotionPlayer |
|---|---|
| Function Summary | Enable the action playback module, start continuously sending instructions to the motion control module |
| Interface Type | HTTP JSON RPC |
| URL | http://127.0.0.1:56444/rpc/aimdk.protocol.MotionCommandService/EnableMotionPlayer |
| Input Parameters | text |
| Output Parameters | text
|
| Example Script | examples/motion_player/enable_motion_player.sh |
| Notes | This interface has no call code restriction |
7.2.5 Disable and Enable Neck Control for Action Playback RPC Interface
In some cases, it is necessary to disable the neck's action playback function separately, thereby transferring control of the neck to a secondary program for head tracking, etc. You can use the following interfaces to disable and enable neck control for action playback.
| Interface Name | pb:/aimdk.protocol.MotionCommandService/DisableNeckMotionPlayer |
|---|---|
| Function Summary | Disable the action playback module from controlling the neck motor, the process will not exit, and no neck instructions will be sent to the motion control module |
| Interface Type | HTTP JSON RPC |
| URL | http://127.0.0.1:56444/rpc/aimdk.protocol.MotionCommandService/DisableNeckMotionPlayer |
| Input Parameters | text |
| Output Parameters | text
|
| Example Script | examples/motion_player/disable_neck_motion_player.sh |
| Notes | This interface has no call code restriction |
| Interface Name | pb:/aimdk.protocol.MotionCommandService/EnableNeckMotionPlayer |
|---|---|
| Function Summary | Enable the action playback module to control the neck, start continuously sending neck control instructions to the motion control module |
| Interface Type | HTTP JSON RPC |
| URL | http://127.0.0.1:56444/rpc/aimdk.protocol.MotionCommandService/EnableNeckMotionPlayer |
| Input Parameters | text |
| Output Parameters | text
|
| Example Script | examples/motion_player/enable_neck_motion_player.sh |
| Notes | This interface has no call code restriction |