一键导入
robot-navigate
Navigate the robot to predefined goal locations.(将机器人导航至预定义目标位置。)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Navigate the robot to predefined goal locations.(将机器人导航至预定义目标位置。)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Search and install agent skills from ClawHub, the public skill registry.
Schedule reminders and recurring tasks.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Google Calendar: Show upcoming events across all calendars.
Google Calendar: Create a new event.
Google Calendar: Manage calendars and events.
| name | robot-navigate |
| description | Navigate the robot to predefined goal locations.(将机器人导航至预定义目标位置。) |
| metadata | {"nanobot":{"emoji":"🧭"}} |
Navigate the robot to predefined goal locations, and record new goals.
This skill covers the full robot navigation lifecycle, comprising four sub-functions with the following execution order:
Mapping → Pose Initialization → Mark Waypoints (repeatable) → Navigate
Get SLAM State can be called at any time to query the current system state.
All underlying scripts live in {baseDir}/scripts/.
BEFORE executing any motion-related command:
1. Run: curl -s http://localhost:18790/api/home/status | jq '.data.available | any(. == "运动")'
2. If the output is false: STOP and tell the user "Motion mode is not enabled"
4. If found: Proceed with the motion command
DO NOT skip this check. DO NOT execute motion commands without verification.
Trigger: The user asks the robot to map a new environment, or the existing map needs to be rebuilt.
Workflow:
Capture the current camera frame.
Inform the user: "Mapping is about to begin. Are you ready?"
Wait for the user to confirm they are ready.
Start mapping:
uv run {baseDir}/scripts/build_map.py start
Inform the user: "Mapping has started. Please use the remote control to drive the robot in a complete loop around the area to be mapped. Let me know when you are done."
Wait for the user to confirm the robot has completed the loop.
End mapping:
uv run {baseDir}/scripts/build_map.py end
---
## Sub-function 2: Pose Initialization (Relocation)
**Trigger:** After mapping is complete and before first use of navigation, or when the robot has lost its position and needs to relocalize.
**Workflow:**
1. Capture the current camera frame。
2. Start relocation:
```bash
uv run {baseDir}/scripts/init_pose.py eth0
statusCode == 0 → initialized is saved as true in slam_state.json. Inform the user that initialization succeeded.statusCode != 0 → Inform the user: "The robot is not within the mapped area. Please move the robot back into the mapped area and try again." Do not proceed with any navigation operations.Trigger: The user says "I want to add a new navigation waypoint" or similar.
Prerequisite: Pose initialization (sub-function 2) must have been completed. If not, prompt the user to run initialization first.
This sub-function involves a multi-turn dialogue, as follows:
1. Capture the current camera frame。
2. Robot replies:
"Please make sure you are within the mapped area, then use the remote
control to drive the robot to the position you want to mark. Let me
know when you are done."
3. Wait for the user to confirm (e.g. "Done", "I've marked it", "OK", etc.).
4. Robot replies:
"Please give this waypoint a name."
5. Wait for the user to provide a name (e.g. "fridge").
6. Record the waypoint:
uv run {baseDir}/scripts/record_goal.py <goal_name>
7. Read the returned result:
- Outputs "已保存目标点: <name>" → Inform the user the waypoint was saved,
e.g. "The current position has been marked as 'fridge'."
- Outputs "获取当前位置失败" → Inform the user that marking failed.
Trigger: The user asks the robot to go to a previously marked waypoint.
Workflow:
cat {baseDir}/scripts/slam_state.json
Confirm has_map == true and initialized == true. If any condition is not met → Inform the user which prerequisite is missing.
uv run {baseDir}/scripts/nav_to_goal.py --list
Confirm the target waypoint is in the returned list. If not → Inform the user the waypoint does not exist.
Capture the current camera frame。
Start navigation:
uv run {baseDir}/scripts/nav_to_goal.py --target <goal_name>
Read the returned result:
is_arrived: true → Inform the user the robot has arrived at the target.Collision handling (built into nav_to_goal.py):
Trigger: Whenever the current navigation system state needs to be queried, or as a prerequisite check before executing navigation.
Workflow:
Capture the current camera frame。
Get SLAM state and goal list:
cat {baseDir}/scripts/slam_state.json
uv run {baseDir}/scripts/nav_to_goal.py --list
State fields in slam_state.json:
| Field | Description |
|---|---|
has_map | Whether a map has been built |
initialized | Whether pose initialization has been completed |
current_goal | The goal the robot is currently navigating to (if any) |
Trigger: The user asks to delete the current map, clear all navigation data, or start fresh.
Workflow:
Warn the user: "This will permanently delete the current map and all saved waypoints. Are you sure you want to continue?"
Wait for the user to confirm.
Delete the map state and waypoint files:
rm -f {baseDir}/scripts/slam_state.json
rm -f {baseDir}/scripts/poses.json
record_goal.py to save the robot's current position as a new named goal, with the goal stored in {baseDir}/scripts/poses.json.--list to dynamically view all available goals from poses.json.将机器人导航至预定义目标位置,并记录新的目标点。
在执行以下所有子功能前,先检查运动模式是否已启用:
curl http://localhost:18790/api/home/status | jq .data.available
返回值应包含 "运动",例如:
["对话", "视觉识别", "运动"]
若列表中没有 "运动",说明运动模式未开启,请告知用户:"请先开启运动模式",不要继续执行后续命令。
本技能涵盖完整的机器人导航生命周期,由四个子功能组成,执行顺序如下:
建图 → 位置初始化 → 标记目标点(可重复)→ 导航
获取 SLAM 状态可在任意时刻调用,用于查询当前系统状态。
所有底层脚本位于 {baseDir}/scripts/ 目录下。
在执行任何运动相关命令之前:
1. 运行:curl -s http://localhost:18790/api/home/status | jq '.data.available | any(. == "运动")'
2. 如果输出为 false:立即停止并告知用户"运动模式未启用"
3. 如果输出为 true:继续执行运动命令
不要跳过此检查。未经验证不要执行运动命令。
触发条件: 用户要求机器人对新环境建图,或现有地图需要重建。
工作流程:
采集当前摄像头帧。
告知用户:"建图即将开始,请问您准备好了吗?"
等待用户确认已准备好。
开始建图:
uv run {baseDir}/scripts/build_map.py start
告知用户:"建图已开始,请使用遥控器驾驶机器人绕待建图区域完整行驶一圈,完成后请告知我。"
等待用户确认机器人已完成绕行。
结束建图:
uv run {baseDir}/scripts/build_map.py end
---
## 子功能 2:位置初始化(重定位)
**触发条件:** 建图完成后首次使用导航前,或机器人丢失位置需要重新定位时。
**工作流程:**
1. 采集当前摄像头帧。
2. 开始重定位:
```bash
uv run {baseDir}/scripts/init_pose.py eth0
statusCode == 0 → slam_state.json 中 initialized 已保存为 true。告知用户初始化成功。statusCode != 0 → 告知用户:"机器人不在已建图区域内。请将机器人移回已建图区域后重试。" 不得继续执行任何导航操作。触发条件: 用户说"我想添加一个新的目标点"或类似表述。
前提条件: 必须已完成位置初始化(子功能 2)。若未完成,提示用户先执行初始化。
本子功能涉及多轮对话,流程如下:
1. 采集当前摄像头帧。
2. 机器人回复:
"请确保您在已建图区域内,然后使用遥控器将机器人驾驶至您想要标记的位置。完成后请告知我。"
3. 等待用户确认(例如"完成了"、"我标好了"、"好的"等)。
4. 机器人回复:
"请为该路径点命名。"
5. 等待用户提供名称(例如"冰箱")。
6. 记录路径点:
```bash
uv run {baseDir}/scripts/record_goal.py <目标名称>
示例: 将当前位置记录为"厨房":
uv run {baseDir}/scripts/record_goal.py 厨房
---
## 子功能 4:导航
**触发条件:** 用户要求机器人前往之前标记的路径点。
**工作流程:**
1. 检查前提条件 — 获取当前 SLAM 状态:
```bash
cat {baseDir}/scripts/slam_state.json
确认 has_map == true 且 initialized == true。若任一条件不满足 → 告知用户缺少哪项前提条件。
uv run {baseDir}/scripts/nav_to_goal.py --list
确认目标路径点在返回列表中。若不存在 → 告知用户该路径点不存在。
采集当前摄像头帧。
开始导航:
uv run {baseDir}/scripts/nav_to_goal.py --target <目标名称>
示例: 导航至客厅:
uv run {baseDir}/scripts/nav_to_goal.py -t 客厅
读取返回结果:
is_arrived: true → 告知用户机器人已到达目标位置。message 字段内容)。碰撞处理(内置于 nav_to_goal.py 中):
触发条件: 任何需要查询当前导航系统状态时,或作为执行导航前的前提条件检查。
工作流程:
采集当前摄像头帧。
获取 SLAM 状态和目标点列表:
cat {baseDir}/scripts/slam_state.json
uv run {baseDir}/scripts/nav_to_goal.py --list
slam_state.json 中的状态字段:
| 字段 | 描述 |
|---|---|
has_map | 是否已建图 |
initialized | 是否已完成位姿初始化 |
current_goal | 机器人当前正在导航的目标点(如有) |
触发条件: 用户要求删除当前地图、清除所有导航数据,或希望重新开始建图。
工作流程:
警告用户: "此操作将永久删除当前地图及所有已保存的目标点,是否确认继续?"
等待用户确认。
删除地图状态文件和目标点文件:
rm -f {baseDir}/scripts/slam_state.json
rm -f {baseDir}/scripts/poses.json
record_goal.py 将机器人当前位置保存为新的命名目标,目标存储于 {baseDir}/scripts/poses.json。--list 可从 poses.json 动态查看所有可用目标。