Vector Control
Overview
Control Vector through Wirepod’s
/api-sdk/* endpoints and the camera stream at
/cam-stream. Use this skill for movement, speech, camera snapshots, patrols, and exploration from the Pi.
Quick start (CLI)
Use the bundled script:
CODEBLOCK0
Find ESN/serial
If you don’t have it, read:
Tasks
1) Assume / Release control
Always assume before movement, and release if the bot tips or a human needs manual control.
CODEBLOCK1
2) Movement
- -
move sends wheel speeds (0–200 typical). Use short timed moves.
CODEBLOCK2
3) Head / Lift
CODEBLOCK3
4) Speech
Speech can be interrupted by motion/camera. If it fails, pause after speaking before moving.
CODEBLOCK4
5) Camera snapshot
/cam-stream returns MJPG. Save it and convert to JPEG if needed (ffmpeg).
CODEBLOCK5
6) Play Audio (MP3/WAV)
Streams an audio file through Vector's speaker. Automatically converts to the required format (8kHz mono WAV).
CODEBLOCK6
7) Patrol (deterministic sweep)
CODEBLOCK7
8) Explore (randomized wander)
CODEBLOCK8
References
- -
references/wirepod-api.md — endpoint list and notes.
Resources
scripts/
- -
vector_control.py — CLI for basic control + patrol/explore routines.
references/
- -
wirepod-api.md — HTTP API endpoints and usage notes.
向量控制
概述
通过Wirepod的/api-sdk/*端点和/cam-stream摄像头流控制向量机器人。使用此技能在树莓派上进行移动、语音、摄像头快照、巡逻和探索操作。
快速入门(命令行界面)
使用内置脚本:
bash
python3 skills/vector-control/scripts/vector_control.py --serial <序列号> assume
python3 skills/vector-control/scripts/vector_control.py --serial <序列号> say --text 你好 Dom
python3 skills/vector-control/scripts/vector_control.py --serial <序列号> move --lw 160 --rw 160 --time 1.5
python3 skills/vector-control/scripts/vector_control.py --serial <序列号> snapshot --out /tmp/vector.mjpg
查找序列号
如果没有,请读取:
- - /etc/wire-pod/wire-pod/jdocs/botSdkInfo.json
任务
1) 获取/释放控制
移动前始终获取控制,如果机器人倾倒或需要人工手动控制,则释放控制。
bash
python3 .../vector_control.py --serial <序列号> assume
python3 .../vector_control.py --serial <序列号> release
2) 移动
- - move发送轮速(典型值0-200)。使用短时移动。
bash
python3 .../vector_control.py --serial <序列号> move --lw 120 --rw 120 --time 1.0
3) 头部/升降
bash
python3 .../vector_control.py --serial <序列号> head --speed -2 --time 1.0
python3 .../vector_control.py --serial <序列号> lift --speed 2 --time 1.0
4) 语音
语音可能被动作/摄像头中断。如果失败,在移动前先暂停再说话。
bash
python3 .../vector_control.py --serial <序列号> say --text 悄悄前进
等待1-2秒,然后移动
5) 摄像头快照
/cam-stream返回MJPG格式。保存后如需可转换为JPEG格式(使用ffmpeg)。
bash
python3 .../vector_control.py --serial <序列号> snapshot --out /tmp/vector.mjpg
ffmpeg -y -loglevel error -i /tmp/vector.mjpg -frames:v 1 /tmp/vector.jpg
6) 播放音频(MP3/WAV)
通过向量机器人的扬声器流式播放音频文件。自动转换为所需格式(8kHz单声道WAV)。
bash
python3 .../vector_control.py --serial <序列号> play --file /path/to/music.mp3
7) 巡逻(确定性扫描)
bash
python3 .../vector_control.py --serial <序列号> patrol --steps 6 --speed 140 --step-time 1.2 --turn-time 0.8 --speak --phrase 正在巡逻
8) 探索(随机漫游)
bash
python3 .../vector_control.py --serial <序列号> explore --steps 8 --speak --phrase 正在探索
参考
- - references/wirepod-api.md — 端点列表和说明。
资源
scripts/
- - vector_control.py — 基本控制+巡逻/探索例程的命令行界面。
references/
- - wirepod-api.md — HTTP API端点和使用说明。