JoyIn Robot Control
Control JoyIn AI robots through the official OpenAPI. Supports W-1 (Walle) and M-1 (Mini) robots.
Setup
OpenClaw Configuration
Add the following to ~/.openclaw/openclaw.json:
CODEBLOCK0
See {baseDir}/openclaw.config.example.json5 for a full template.
Environment Variables
| Variable | Required | Description |
|---|
| INLINECODE2 | Yes | API base URL (test: https://api-open-test.joyin-ai.com) |
| INLINECODE4 |
Yes | Authorization key (contact JoyIn staff to obtain) |
|
JOYIN_DEVICE_SN | Yes | Target device serial number |
|
JOYIN_DEVICE_TYPE_ID | No |
3 for Walle (default),
2 for Mini |
OpenClaw injects these via skills.entries.*.env at agent run time. They are scoped to the run and do not leak into the global shell environment.
Tool
CODEBLOCK1
Agent Workflow Rules (IMPORTANT)
ALWAYS run preflight before sending any robot command. This checks whether the device is online, its battery level, and current work mode.
Decision flow:
CODEBLOCK2
State-aware behavior:
| current_status | Meaning | What to do |
|---|
| INLINECODE11 | Device not connected | Tell user. Do not send commands. |
| INLINECODE12 |
Ready | Proceed normally. |
|
follow | Following a person | Warn before sending conflicting commands (e.g. remote_control). Use
stop first. |
|
remote_control | Joystick active | Already in RC mode. Can send move commands directly. |
|
patrol | Patrolling | Warn before interrupting. Use
stop first. |
|
go_charge | Returning to charger | Warn before interrupting. |
|
guard | Monitoring | Warn before interrupting. |
|
ota | Firmware updating | Do NOT send any commands. Wait. |
|
build_map | Building SLAM map | Do NOT interrupt. |
|
active_action | Performing action | Conflicts with follow. Use
stop first if needed. |
Battery rules:
- - < 10% and not charging → Suggest
charge command before any movement. - < 5% → Refuse movement commands, only allow
charge and status.
Quick Examples
CODEBLOCK3
Command Reference
1. Movement — Remote Control
Enter / Exit remote control mode:
CODEBLOCK4
Chassis movement (8 directions, send continuously at ~100ms interval, robot stops when commands stop):
CODEBLOCK5
Head control (Walle only) — up/down/left/right, send continuously at ~100ms:
CODEBLOCK6
Arm control (Walle only) — leftarm or rightarm:
CODEBLOCK7
Reset position (Walle only):
CODEBLOCK8
2. Fixed Actions (Mini only)
CODEBLOCK9
3. Emergency Stop
CODEBLOCK10
4. Voice — TTS
CODEBLOCK11
5. Device Status & Preflight
CODEBLOCK12
Preflight response example (ready):
CODEBLOCK13
Preflight response example (not ready):
CODEBLOCK14
6. Live Video
CODEBLOCK15
7. ASR Result
CODEBLOCK16
8. WiFi Configuration
CODEBLOCK17
9. LLM Configuration (register your own model)
CODEBLOCK18
10. Agent Configuration
CODEBLOCK19
Device Types
| Type ID | Model | Codename | Key Capabilities |
|---|
| 3 | W-1 (Walle) | walle | Chassis + head + arm control, 8-direction joystick, position reset |
| 2 |
M-1 (Mini) | mini | Chassis control, fixed body actions (standup/car/hello/head), charging |
API Protocol
- - Base URL:
https://api-open-test.joyin-ai.com (test) - Auth: All requests carry 3 headers —
Authorization, Device-Sn, INLINECODE30 - Robot commands:
POST /v1/device/interaction/cmd with body INLINECODE32 - Response format: INLINECODE33
Important Notes
- - The device must be online for commands to work.
- Joystick commands (move/head/arm) need to be sent continuously at ~100ms intervals. The robot stops automatically when commands stop arriving.
- INLINECODE34 on TTS means the microphone will be closed after playback.
- Some APIs (LLM config, Agent config) are marked as "开发中" and may not be fully available.
JoyIn 机器人控制
通过官方 OpenAPI 控制 JoyIn AI 机器人。支持 W-1 (Walle) 和 M-1 (Mini) 机器人。
设置
OpenClaw 配置
将以下内容添加到 ~/.openclaw/openclaw.json:
json5
{
skills: {
entries: {
joyin-robot-control: {
enabled: true,
apiKey: YOURAUTHKEY,
env: {
JOYINAPIBASE: https://api-open-test.joyin-ai.com,
JOYINAUTHKEY: YOURAUTHKEY,
JOYINDEVICESN: YOURDEVICESN,
JOYINDEVICETYPE_ID: 3
}
}
}
}
}
完整模板请参见 {baseDir}/openclaw.config.example.json5。
环境变量
| 变量 | 必需 | 描述 |
|---|
| JOYINAPIBASE | 是 | API 基础 URL(测试环境:https://api-open-test.joyin-ai.com) |
| JOYINAUTHKEY |
是 | 授权密钥(请联系 JoyIn 工作人员获取) |
| JOYIN
DEVICESN | 是 | 目标设备序列号 |
| JOYIN
DEVICETYPE_ID | 否 | 3 表示 Walle(默认),2 表示 Mini |
OpenClaw 在代理运行时通过 skills.entries.*.env 注入这些变量。它们仅限于运行范围,不会泄露到全局 shell 环境中。
工具
python3 {baseDir}/scripts/robot_cmd.py [options]
代理工作流规则(重要)
在发送任何机器人命令之前,始终运行 preflight。 这将检查设备是否在线、电池电量以及当前工作模式。
决策流程:
- 1. 运行:python3 {baseDir}/scripts/robot_cmd.py preflight
- 检查结果:
- ready: false → 告知用户原因(离线/OTA/电量低)。不要发送命令。
- ready: true,带有当前模式的note → 告知用户,然后继续。
- ready: true,空闲 → 继续执行命令。
- 3. 执行请求的命令。
- 向用户报告结果。
状态感知行为:
| current_status | 含义 | 操作 |
|---|
| offline | 设备未连接 | 告知用户。不要发送命令。 |
| idle |
就绪 | 正常继续。 |
| follow | 跟随某人 | 在发送冲突命令(例如 remote_control)前发出警告。先使用 stop。 |
| remote_control | 摇杆激活 | 已处于遥控模式。可直接发送移动命令。 |
| patrol | 巡逻中 | 在中断前发出警告。先使用 stop。 |
| go_charge | 返回充电桩 | 在中断前发出警告。 |
| guard | 监控中 | 在中断前发出警告。 |
| ota | 固件更新中 | 不要发送任何命令。等待。 |
| build_map | 构建 SLAM 地图 | 不要中断。 |
| active_action | 执行动作 | 与跟随冲突。如有需要,先使用 stop。 |
电池规则:
- - < 10% 且未充电 → 建议在任何移动前使用 charge 命令。
- < 5% → 拒绝移动命令,仅允许 charge 和 status。
快速示例
bash
始终先运行预检检查
python3 {baseDir}/scripts/robot_cmd.py preflight
向前移动机器人
python3 {baseDir}/scripts/robot_cmd.py move --direction forward
停止所有移动
python3 {baseDir}/scripts/robot_cmd.py stop
让机器人说话
python3 {baseDir}/scripts/robot_cmd.py tts --text 你好,我是你的机器人助手
检查设备状态(电池、在线、充电)
python3 {baseDir}/scripts/robot_cmd.py status
获取实时视频流 URL
python3 {baseDir}/scripts/robot
cmd.py livepull_url
命令参考
1. 移动 — 遥控
进入/退出遥控模式:
bash
python3 {baseDir}/scripts/robotcmd.py rcenter
python3 {baseDir}/scripts/robotcmd.py rcexit
底盘移动(8 个方向,约 100ms 间隔持续发送,命令停止时机器人停止):
bash
python3 {baseDir}/scripts/robot_cmd.py move --direction forward
python3 {baseDir}/scripts/robot_cmd.py move --direction backward
python3 {baseDir}/scripts/robot_cmd.py move --direction left
python3 {baseDir}/scripts/robot_cmd.py move --direction right
python3 {baseDir}/scripts/robotcmd.py move --direction leftup
python3 {baseDir}/scripts/robotcmd.py move --direction rightup
python3 {baseDir}/scripts/robotcmd.py move --direction leftdown
python3 {baseDir}/scripts/robotcmd.py move --direction rightdown
停止底盘移动
python3 {baseDir}/scripts/robot
cmd.py movestop
头部控制(仅 Walle) — 上/下/左/右,约 100ms 持续发送:
bash
python3 {baseDir}/scripts/robot_cmd.py head --direction up
python3 {baseDir}/scripts/robot_cmd.py head --direction down
python3 {baseDir}/scripts/robot_cmd.py head --direction left
python3 {baseDir}/scripts/robot_cmd.py head --direction right
python3 {baseDir}/scripts/robot_cmd.py head --direction stop
手臂控制(仅 Walle) — leftarm 或 rightarm:
bash
python3 {baseDir}/scripts/robot_cmd.py arm --side left --direction up
python3 {baseDir}/scripts/robot_cmd.py arm --side left --direction down
python3 {baseDir}/scripts/robot_cmd.py arm --side left --direction stop
python3 {baseDir}/scripts/robot_cmd.py arm --side right --direction up
python3 {baseDir}/scripts/robot_cmd.py arm --side right --direction stop
复位位置(仅 Walle):
bash
python3 {baseDir}/scripts/robot_cmd.py reset --target all # 复位所有
python3 {baseDir}/scripts/robot_cmd.py reset --target head # 仅复位头部
python3 {baseDir}/scripts/robot_cmd.py reset --target arm # 仅复位手臂
2. 固定动作(仅 Mini)
bash
python3 {baseDir}/scripts/robotcmd.py caron # 上车
python3 {baseDir}/scripts/robotcmd.py caroff # 下车
python3 {baseDir}/scripts/robot_cmd.py standup # 站立
python3 {baseDir}/scripts/robotcmd.py bootoff # 收脚
python3 {baseDir}/scripts/robotcmd.py booton # 卡脚
python3 {baseDir}/scripts/robot_cmd.py hello # 打招呼
python3 {baseDir}/scripts/robotcmd.py hellooff # 收手
python3 {baseDir}/scripts/robotcmd.py headup # 抬头
python3 {baseDir}/scripts/robotcmd.py headdown # 回头(低头)
python3 {baseDir}/scripts/robot_cmd.py charge # 回充电桩
python3 {baseDir}/scripts/robotcmd.py chargestop # 停止回充
3. 紧急停止
bash
python3 {baseDir}/scripts/robot_cmd.py stop # 急停,停止所有移动和功能
4. 语音 — TTS
bash
在设备扬声器上播放文本
python3 {baseDir}/scripts/robot_cmd.py tts --text 你好世界
播放文本后关闭麦克风(keep_silent=1)
python3 {baseDir}/scripts/robot_cmd.py tts --text 请安静 --keep-silent
5. 设备状态与预检
bash
预检检查(在任何命令前始终运行此命令)
python3 {baseDir}/scripts/robot_cmd.py preflight
返回:ready (bool), currentstatus, battery, ischarging, issues[], suggestion
获取原始设备