遥控模块
本文档介绍了如何通过遥控模块(Remote Control, RC)控制机器人播放动作和表情,请注意这里的动作播放只能进行简单播放,获取播放状态以及复位等操作请参考动作播放模块。
本模块 http 后端监听的端口为 59001。
RPC 接口
Section titled “RPC 接口”| 接口名 | 接口描述 | 请求消息类型 | 答复消息类型 | 备注 | 通信后端 |
|---|---|---|---|---|---|
pb:/aimdk.protocol.RcMotionPlayerService/GetMotionList | 获取动作列表 | aimdk::protocol::CommonRequest | aimdk::protocol::RcMotionListResponse | http | |
pb:/aimdk.protocol.RcMotionPlayerService/PlayerMotion | 播放动作 | aimdk::protocol::RcPlayerMotionRequest | aimdk::protocol::CommonResponse | http | |
pb:/aimdk.protocol.RcEmoticonPlayerService/GetEmoticonList | 获取表情列表 | aimdk::protocol::CommonRequest | aimdk::protocol::RcEmoticonListResponse | http | |
pb:/aimdk.protocol.RcEmoticonPlayerService/PlayerEmoticon | 播放表情 | aimdk::protocol::RcPlayerEmoticonRequest | aimdk::protocol::RcPlayerEmoticonResponse | http |
默认表情列表
Section titled “默认表情列表”相应预览图请参考 AimMaster 软件。
| emoticon_id | emoticon_name | 表情描述 |
|---|---|---|
| 1 | emoticon_prompt_words | 唤醒词提示 |
| 2 | emoticon_say_hi | 通常用在跟用户打招呼的场景。 |
| 3 | emoticon_dance | 通常用在机器人跳舞的场景 |
| 4 | emoticon_red_heart | 向用户表达比心、谢意 |
| 5 | emoticon_bye | 通常用在与用户拜拜、说再见的场景。 |
| 6 | emoticon_sending_a_heart | 通常用在向用户表达关心、递送爱心的场景。 |
| 7 | emoticon_happy | 开心、喜悦 |
| 8 | emoticon_love_u | 通常用在大胆地表达爱意的场景。 |
| 9 | emoticon_yeah | 通常用在表示好运、传达正能量的场景。 |
| 10 | emoticon_ok | 通常用在表示“没问题”“已完成”的场景。 |
| 11 | emoticon_normal | 通用表情:运动&作业状态时的通用表情 |
| 12 | emoticon_sad | 心情不好或佯装心情不美丽 |
| 13 | emoticon_welcome | 通常用在表达热烈欢迎的场景。 |
| 14 | emoticon_like | 通常用在表达点赞、认同对方的场景。 |
| 15 | emoticon_disable_voice | 语音已禁用 |
| 16 | emoticon_language_change | 中英文切换时的表情 |
| 17 | emoticon_working_mode | 在作业模式中的表情 |
| 18 | emoticon_continuous_shot_1 | 三连拍的第1个表情 |
| 19 | emoticon_continuous_shot_2 | 三连拍的第2个表情 |
| 20 | emoticon_continuous_shot_3 | 三连拍的第3个表情 |
| 21 | emoticon_thinking | 通用表情:思考态(在推理、多模态等长思考场景下使用) |
| 22 | emoticon_voice_rejection | 用户输入的话被拒识,语音专属使用 |
| 23 | emoticon_human_voice_input | 正在倾听用户说的话,语音专属使用 |
| 24 | emoticon_countdown | 三子棋游戏中的表情,游戏进入倒计时状态 |
| 25 | emoticon_draw | 三子棋游戏中的表情,代表本局平局 |
| 26 | emoticon_board | 三子棋游戏中的表情,代表正在玩三子棋游戏 |
| 27 | emoticon_lost | 三子棋游戏中的表情,代表本局A2输了 |
| 28 | emoticon_won | 三子棋游戏中的表情,代表本局A2赢了 |
| 29 | emoticon_identification_error | 三子棋游戏中的表情,代表当前对棋局识别出现异常 |
| 30 | emoticon_guiding | 用户启动了带路流程 |
Protobuf 消息类型
Section titled “Protobuf 消息类型”aimdk::protocol::RcMotionListResponse
Section titled “aimdk::protocol::RcMotionListResponse”| Field | Type | Description |
|---|---|---|
| header | aimdk::protocol::ResponseHeader | 响应头 |
| motion_list | aimdk::protocol::RcMotionInfo[] | 动作列表 |
aimdk::protocol::RcMotionInfo
Section titled “aimdk::protocol::RcMotionInfo”| Field | Type | Description |
|---|---|---|
| motion_id | uint32 | 动作id |
| motion_name | string | 动作名称 |
| time_stamp | uint64 | 时间戳 |
| is_change | bool | 是否支持修改,某人轮式不可修改,足式可以修改 |
| description | string | 描述 |
| display_name_zh | string | 显示的中文名 |
| display_name_en | string | 显示的英文名 |
| url | string | 动作下载路径 |
| thumbnail_url | string | 缩略图下载路径 |
| md5 | string | 文件 md5 |
| duration | uint32 | 动作时长 |
| motion_play_path | string | 动作播放文件 |
| type | aimdk::protocol::MotionType | 动作类型 |
aimdk::protocol::MotionType
Section titled “aimdk::protocol::MotionType”动作类型
| Name | Number | Description |
|---|---|---|
| Untyped | 0 | 未分类 |
| Speech | 1 | 定时演讲 |
| RandomInBroadcast | 2 | 播报中随机 |
| SkillMotion | 3 | 技能动作 |
| Show | 4 | 表演类 |
aimdk::protocol::RcPlayerMotionRequest
Section titled “aimdk::protocol::RcPlayerMotionRequest”| Field | Type | Description |
|---|---|---|
| header | aimdk::protocol::RequestHeader | 请求头 |
| motion_id | uint32 | 动作id |
aimdk::protocol::RcEmoticonListResponse
Section titled “aimdk::protocol::RcEmoticonListResponse”| Field | Type | Description |
|---|---|---|
| header | aimdk::protocol::ResponseHeader | 响应头 |
| emoticon_list | aimdk::protocol::RcEmoticonInfo[] | 表情列表 |
aimdk::protocol::RcEmoticonInfo
Section titled “aimdk::protocol::RcEmoticonInfo”表情Emoticon相关
| Field | Type | Description |
|---|---|---|
| emoticon_id | uint32 | 表情id |
| emoticon_name | string | 表情名称 |
| expand_name | string | 拓展名称 如”svg”,不需要加.,rc拼接的时候会加上 |
| time_stamp | uint64 | 时间戳 |
| is_change | bool | 是否支持修改,某人轮式不可修改,足式可以修改 |
| display_name_zh | string | 显示的中文名 |
| display_name_en | string | 显示的英文名 |
| description | string | 描述 |
| bqb_url | string | 表情压缩包文件下载路径 |
| emoticon_url | string | 表情文件下载路径 |
| thumbnail_url | string | 预览文件下载路径 |
| cover_url | string | 封面文件下载路径 |
| bqb_local_path | string | 表情压缩包本地路径 |
| emoticon_local_path | string | 表情文件本地路径 |
| thumbnail_local_path | string | 预览文件本地路径 |
| cover_local_path | string | 封面文件本地路径 |
| duration | uint32 | 表情时长 |
aimdk::protocol::RcPlayerEmoticonRequest
Section titled “aimdk::protocol::RcPlayerEmoticonRequest”| Field | Type | Description |
|---|---|---|
| header | aimdk::protocol::RequestHeader | 响应头 |
| emoticon_id | uint32 | 表情id |
| is_need_data | bool | 是否需要表情内容,如果为true,则rsp的emticon_data有数据 |
aimdk::protocol::RcPlayerEmoticonResponse
Section titled “aimdk::protocol::RcPlayerEmoticonResponse”| Field | Type | Description |
|---|---|---|
| header | aimdk::protocol::ResponseHeader | 请求头 |
| emoticon_id | uint32 | 表情id |
| emoticon_name | string | 表情名称 |
| expand_name | string | 拓展名称 |
| emoticon_path | string | 表情路径 |
| emticon_data | bytes | 表情内容 |
动作播放相关
Section titled “动作播放相关”#!/bin/bash
# 播放某个动作# ./a2_PlayerMotion.sh motion_id
if [ $# -eq 0 ]; then echo "arg error, need motion_id, ./a2_PlayerMotion.sh motion_id, example: " echo ./a2_PlayerMotion.sh 1 exit 0fi
curl -i \ -H 'content-type:application/json' \ -H 'timeout: 1000' \ -X POST http://192.168.100.100:59001/rpc/aimdk.protocol.RcMotionPlayerService/PlayerMotion \ -d '{"motion_id":"'$1'"}'#!/bin/bash
# 获取支持播放动作的列表curl -i \ -H 'content-type:application/json' \ -H 'timeout: 1000' \ -X POST http://192.168.100.100:59001/rpc/aimdk.protocol.RcMotionPlayerService/GetMotionList \ -d '{}'表情播放相关
Section titled “表情播放相关”#!/bin/bash
# 播放某个表情# ./a2_PlayerEmoticon.sh emoticon_id
if [ $# -eq 0 ]; then echo "arg error, need emoticon_id, ./a2_PlayerEmoticon.sh emoticon_id, example: " echo ./a2_PlayerEmoticon.sh 1 exit 0fi
curl -i \ -H 'content-type:application/json' \ -H 'timeout: 1000' \ -X POST http://192.168.100.100:59001/rpc/aimdk.protocol.RcEmoticonPlayerService/PlayerEmoticon \ -d '{"emoticon_id":"'$1'","is_need_data":false}'#!/bin/bash
# 获取表情列表curl -i \ -H 'content-type:application/json' \ -H 'timeout: 1000' \ -X POST http://192.168.100.100:59001/rpc/aimdk.protocol.RcEmoticonPlayerService/GetEmoticonList \ -d '{}'