7.10 Skill Playback

7.10 Skill Playback

7.10.1 Overview

The A3-Ultra skill playback section relies on the various resources imported through the resource management module, including motions, audio, and emoticons. Through the interfaces provided in this section, users can perform actions such as motion playback, audio playback, and emoticon playback.

Note: To obtain lists of these resources, use the Get Resource List interface provided by the resource management module.

7.10.2 Motion Play/Pause/Reset Interface

Interface Namepb:/aimdk.protocol.MotionCommandService/SendMotionCommand
OverviewPlay the specified motion file
Interface TypeHTTP JSON RPC
URLhttp://10.42.10.12:56444/rpc/aimdk.protocol.MotionCommandService/SendMotionCommand
Input
text
{
  "motion_id": "/agibot/data/resources/default/motion/handshake/woshou1_Skeleton0.mcap",
  "duration_ms": 10000,
  "cmd_end": true,
  "cmd_pause": false,
  "cmd_reset": false,
  "cmd_repeat": false
}
  • motion_id: Absolute path of the motion file
  • duration_ms: Maximum runtime of the motion in milliseconds
  • cmd_end: Whether to automatically return to the initial pose after playback completes. true means auto reset
  • cmd_pause: Pause flag. true pauses the current motion playback
  • cmd_reset: Reset flag. true immediately stops the current motion and restores the initial pose
  • cmd_repeat: Repeat flag. true automatically repeats the motion after playback completes
Output
text
{
  "header": {
    "code": "0",
    "msg": "",
    "timestamp": {
      "seconds": "1762851946",
      "nanos": 693223585,
      "ms_since_epoch": "0"
    },
    "trace_id": "",
    "domin": ""
  },
  "state": "CommonState_SUCCESS"
}
  • state: Request status. Success is CommonState_SUCCESS, and failure is CommonState_FAILURE
Example Scriptexamples/skill_play/SendMotionCommand.py
Remarks
  • Play, pause, and stop are all implemented through the same SendMotionCommand interface, with different fields controlling the behavior
  • Motion resources can be imported through the Create Resource interface

7.10.3 Play Audio

Interface Namepb:/aimdk.protocol.HalAudioService/PlayFile
OverviewPlay the specified audio file
Interface Type HTTP JSON RPC
URLhttp://10.42.10.10:56666/rpc/aimdk.protocol.HalAudioService/PlayFile
InputPlay a WAV file (recommended):
text
{
  "header": {
    "timestamp": {
      "seconds": "0",
      "nanos": 0,
      "ms_since_epoch": "0"
    }
  },
  "pkg_name": "",
  "file_name": "Ding.wav",
  "file_path": "",
  "priority": "DEFAULT",
  "priority_weight": 0,
  "channles": 0,
  "samplerate": 0
}
Play a PCM file (channel count and sample rate required):
text
{
  "header": {
    "timestamp": {
      "seconds": "0",
      "nanos": 0,
      "ms_since_epoch": "0"
    }
  },
  "pkg_name": "",
  "file_name": "wake.pcm",
  "file_path": "",
  "priority": "DEFAULT",
  "priority_weight": 0,
  "channles": 1,
  "samplerate": 24000
}
  • header: Request header, optional
  • pkg_name: Caller identifier string, optional. If provided, it is returned unchanged in the output and can be used for log tracing
  • file_name: Audio file name. The server looks for this file under /agibot/data/var/hal_audio/file/
  • file_path: File path, optional
  • priority: Playback priority, optional. Enum names are supported. The default values are 0 and L1(1) to L10(10). A larger value means higher priority. Higher-priority audio interrupts lower-priority audio that is currently playing. Final priority = PlayPriority × 100 + priority_weight
  • priority_weight: Priority weight parameter (0-99), optional. Do not use unless required by the product
  • channles: Number of channels. Optional when the audio file is a .wav file
  • samplerate: Sample rate. Optional when the audio file is a .wav file
Output
text
{
  "pkg_name": "",
  "is_success": true
}
  • pkg_name: Caller identifier, identical to the value passed in the input
  • is_success: Whether the request was accepted
Example Scriptexamples/skill_play/PlayFile.py
Remarks
  • The audio file must be placed in /agibot/data/var/hal_audio/file/ in advance
  • Both WAV and PCM formats are supported. WAV files include their own format header and can be played directly. PCM files must provide channles and samplerate, otherwise the error plz update file channels info is returned

7.10.4 Stop Audio

Interface Namepb:/aimdk.protocol.HalAudioService/StopPlay
OverviewStop the currently playing audio
Interface Type HTTP JSON RPC
URLhttp://10.42.10.10:56666/rpc/aimdk.protocol.HalAudioService/StopPlay
Input
text
{}
  • Pass an empty request body to stop the current playback
Output
text
{
  "pkg_name": "",
  "is_success": true
}
  • is_success: Whether the stop operation succeeded
Example Scriptexamples/skill_play/StopPlay.py
Remarks
  • The call stops the audio that is currently playing immediately

7.10.5 Emoticon Playback

Interface Name/skill/pilot/face/play
OverviewUsed to play emoticons
Interface Type ros2 topic
Input
text

{
  "header": {
    "timestamp": {
      "seconds": 1763681490,
      "nanos": 943287000,
      "ms_since_epoch": 1763681490943
    }
  },
  "e_path": "/agibot/data/resources/default/emoticon/disable_voice/emoticon.mp4",
  "e_id": 15,
  "repeat": 1,
  "priority": 440,
  "is_stop": false
}
  • e_path: Directory of the emoticon file. An absolute path is required
  • e_id: Emoticon resource ID. It can be obtained through the GetResourceList interface and may be left empty
  • repeat: Number of repetitions
  • priority: Priority value. Use 440. A smaller value means a higher priority
  • is_stop: Used to display or cancel display. When stopping playback, e_path, e_id, repeat, and priority may all be left empty
Example Scriptexamples/skill_play/face_play.py
Remarks
  • The ROS2 message type is ros2_plugin_proto/msg/RosMsgWrapper. Before using it, run source prebuilt/ros2_plugin_proto_aarch64/share/ros2_plugin_proto/local_setup.bash
  • This message is transmitted through iceoryx by default. To use ros2 topic transport instead, log in to the MDU and change the communication mode of /skill/pilot/face/play under aimrt/channel/sub_topics_options in /agibot/software/v0/config/skillpilot/skillpilot.yaml to [ mqtt, ros2 ]. Restart the robot after modification
  • The emoticon list can be obtained through the resource list interface

7.10.6 Skill Status Interface

Interface Name/skill/pilot/skill_status
OverviewSkill status interface
Interface Type ros2 topic
Output
text

{
  "core": 3,
  "battery": 0,
  "auto_charging": 1
}
  • Part of the meaning of core is shown below. Other values are omitted:
CoreState_Working = CoreState_Initial
CoreState_Avatar = 6; // Avatar
CoreState_Collecting = 9; // Data collection
CoreState_MapBuilding = 13; // Mapping
  • Part of the meaning of battery is shown below. Other values are omitted:
BatteryState_DualBattery_NotCharging_Normal = 6;
BatteryState_DualBattery_NotCharging_LowPower = 7;
BatteryState_DualBattery_Charging = 8;
BatteryState_SingleBattery_NotCharging = 9;
BatteryState_SingleBattery_Charging = 10;
BatteryState_NoBattery_Charging = 11;
  • The meaning of auto_charging is as follows:
AutoChargingState_Idle = 1; // Idle and ready
AutoChargingState_Navigating = 2; // Navigating
AutoChargingState_NaviSuccess = 3; // Navigation succeeded
AutoChargingState_NaviFailed = 4; // Navigation failed
AutoChargingState_Plugging = 5; // Plugging in
AutoChargingState_PlugSuccess = 6; // Plug-in succeeded
AutoChargingState_PlugFailed = 7; // Plug-in failed
AutoChargingState_Charging = 8; // Charging
AutoChargingState_Unplugging = 9; // Unplugging
AutoChargingState_UnplugSuccess = 10; // Unplug succeeded
AutoChargingState_UnplugFailed = 11; // Unplug failed
AutoChargingState_Finished = 12; // Autonomous charging flow completed
AutoChargingState_Failed = 13; // Autonomous charging flow failed
Example Scriptexamples/skill_play/skill_status.py
Remarks
  • The ROS2 message type is ros2_plugin_proto/msg/RosMsgWrapper. Before using it, run source prebuilt/ros2_plugin_proto_aarch64/share/ros2_plugin_proto/local_setup.bash
  • Only part of the important output fields is shown here. Other output fields can be ignored
  • This message is transmitted through iceoryx by default. To use ros2 topic transport instead, log in to the MDU and change the communication mode of /skill/pilot/skill_status under aimrt/channel/pub_topics_options in /agibot/software/v0/config/skillpilot/skillpilot.yaml to [ mqtt, ros2 ]. Restart the robot after modification

7.10.7 Autonomous Charging Interface

Interface Namepb:/aimdk.protocol.SkillPilotService/AutoCharging
OverviewAutonomous charging interface
Interface Type RPC
Input
text

{
  "header": 3,
  "command": 1,
  "trigger": 3
}
  • The meaning of command is as follows:
AutoChargingCommand_START = 1; // Start autonomous charging
AutoChargingCommand_STOP = 3; // Stop/end (while navigating: stop navigation and stay in place; while plugging in: complete plugging then unplug; while charging: unplug; while unplugging: no action)
AutoChargingCommand_RESET = 4; // Reset after failure (call after Stop to restore autonomous charging to Idle; if not called, it automatically recovers after 10 seconds)
  • The meaning of trigger is as follows:
AutoChargingTrigger_AGENT = 1; // Agent (voice/agent initiated)
AutoChargingTrigger_AIMMASTER = 2; // AimMaster (manual click in app)
AutoChargingTrigger_LOW_POWER = 3; // Automatically triggered by low battery
AutoChargingTrigger_IDLE_TIMEOUT = 4; // Automatically triggered after a long idle timeout
Output
text
{
  "available_time": "",
  "session_id": ""
}
  • session_id: A UUID is returned if the skill is scheduled successfully
Example Scriptexamples/skill_play/auto_charging.py
Remarks
  • The ROS2 message type is ros2_plugin_proto/msg/RosMsgWrapper. Before using it, run source prebuilt/ros2_plugin_proto_aarch64/share/ros2_plugin_proto/local_setup.bash
  • Only part of the important output fields is shown here. Other output fields can be ignored

7.10.8 Dance Playback Interface

Interface Namepb:/aimdk.protocol.SkillPilotService/SkillPackage
OverviewDance playback interface
Interface Type rpc
Input
text

{
  "source": "custom",
  "command": "Start",
  "path": "/agibot/data/resources/default/skill/Charleston",
  "session_id": ""
}
  • source: Used only for logging. Set it to custom
  • command: Supported values are Start, Pause, and Stop
  • path: Path of the dance resource. Related information can be obtained from the resource management section
  • session_id: Skill session ID, mainly used for pause and stop operations
Output
text
{"header":{
    "code":"0",
    "msg":" transition succeed",
    "trace_id":"",
    "domin":"skillpilot"},
 "available_time":"0",
 "session_id":"ae82ee85-e90e-4802-87bd-f1e2ad09874c"}
Example Scriptexamples/skill_play/dance_play.py
Remarks
  • When calling this interface, keep a two-meter obstacle-free area around the robot