ROS Noetic Navigation - Cartographer

# ROS Noetic Navigation - Cartographer Edition

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "ROS Noetic Navigation - Cartographer" with this command: npx skills add threelevelchord/ros-noetic-nav-cartographer

ROS Noetic Navigation - Cartographer Edition

专为使用Cartographer定位的ROS Noetic导航系统设计。通过TF获取位姿,通过rosbridge与move_base交互。

🚨 重要:前置条件

必须启动 rosbridge_server

source /opt/ros/noetic/setup.bash
roslaunch rosbridge_server rosbridge_tcp.launch

Cartographer导航系统

# 示例启动命令(根据实际项目调整)
roslaunch robot_navigation navigation_with_cartographer_cpp.launch

如果没有运行rosbridge,所有导航命令都会失败!

与原版(AMCL)的区别

特性原版 (AMCL)Cartographer版
定位算法AMCLCartographer
位姿获取/amcl_pose TopicTF变换
地图格式.pgm + .yaml.pbstream
重定位自动需手动设置初始位姿

文件结构

ros-noetic-nav-cartographer/
├── SKILL.md                      # 本说明文档
├── waypoints.json                # Cartographer专用航点
└── scripts/
    ├── waypoints_manager.py      # 航点管理
    ├── nav.py                    # 导航脚本(单点+巡航)
    └── get_pose_tf.py            # 通过TF获取位姿

配置

TOOLS.md 中添加:

### ROS Noetic Navigation - Cartographer

- workspace: ~/robot5  # 根据实际项目调整
- rosbridge_host: localhost
- rosbridge_port: 9090
- pose_tf_target: base_link      # 小车坐标系
- pose_tf_source: map            # 地图坐标系
- waypoints_file: ~/.openclaw/workspace/skills/ros-noetic-nav-cartographer/waypoints.json
- map_file: ~/robot5/src/robot_navigation/maps/my_map.pbstream

使用方法

1. 查看当前位置(TF方式)

# 基本查询
python3 scripts/get_pose_tf.py

# 指定坐标系
python3 scripts/get_pose_tf.py --target-frame base_footprint --source-frame map

# JSON格式输出
python3 scripts/get_pose_tf.py --json

2. 航点管理

# 列出所有航点
python3 scripts/waypoints_manager.py list

# 添加航点
python3 scripts/waypoints_manager.py add 充电座 --x 0.0 --y 0.0 --yaw 0
python3 scripts/waypoints_manager.py add 客厅 --x 3.0 --y 2.0 --yaw 90

# 获取航点
python3 scripts/waypoints_manager.py get 客厅

# 删除航点
python3 scripts/waypoints_manager.py remove 客厅

3. 导航

单点导航

# 使用命名航点
python3 scripts/nav.py goto 客厅

# 自然语言命令
python3 scripts/nav.py cmd "去客厅"

多航点巡航

# 巡航多个航点
python3 scripts/nav.py cruise 卧室 餐厅 书房

# 自然语言命令
python3 scripts/nav.py cmd "去卧室 餐厅 书房"

自定义rosbridge地址

python3 scripts/nav.py goto 客厅 --host 192.168.1.100 --port 9090

参数说明

参数说明默认值
--hostrosbridge主机localhost
--portrosbridge端口9090
--timeout导航超时(秒)180
--target-frameTF目标坐标系(小车)base_link
--source-frameTF源坐标系(地图)map

首次设置流程

  1. 启动rosbridge

    roslaunch rosbridge_server rosbridge_tcp.launch
    
  2. 启动Cartographer导航

    roslaunch robot_navigation navigation_with_cartographer_cpp.launch
    
  3. 在RViz中手动重定位(2D Pose Estimate)

  4. 驾驶小车到目标位置,记录航点:

    # 获取当前位置
    python3 scripts/get_pose_tf.py
    
    # 保存航点
    python3 scripts/waypoints_manager.py add 客厅 --x <x值> --y <y值> --yaw <角度>
    
  5. 测试导航

    python3 scripts/nav.py goto 客厅
    

依赖

  • Python 3
  • ROS Noetic
  • rosbridge_server (TCP, 端口9090)
  • tf2_ros, tf (ROS Python库)
  • Cartographer ROS

注意事项

  1. rosbridge检查:每次使用前确保rosbridge已启动
  2. 重定位:Cartographer需要手动设置初始位姿(RViz的2D Pose Estimate)
  3. TF延迟:TF变换可能有短暂延迟,get_pose_tf.py会等待最多5秒
  4. 坐标系:确保TF树中有 map -> base_link 变换
  5. 航点独立性:Cartographer和AMCL的航点文件相互独立,因为地图坐标系不同

故障排查

rosbridge连接失败

# 检查rosbridge是否运行
curl http://localhost:9090

# 启动rosbridge
roslaunch rosbridge_server rosbridge_tcp.launch

TF获取失败

# 检查TF树
rosrun tf view_frames

# 检查Cartographer是否正常发布TF
rostopic echo /tf

# 检查话题
rostopic list | grep cartographer

导航无响应

# 检查move_base状态
rostopic echo /move_base/status

# 检查目标是否发布
rostopic echo /move_base_simple/goal

适用场景

  • 使用Cartographer进行SLAM和定位的项目
  • 需要高精度定位的机器人
  • 大规模环境下的导航
  • 需要保存和加载地图的长期运行项目

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

ROS Noetic Navigation

通过rosbridge与ROS Noetic导航系统交互,支持地图读取、航点管理、单点导航和多点巡航,基于AMCL定位。

Registry SourceRecently Updated
700Profile unavailable
General

Habitat-GS-Navigator

Navigate and interact with photo-realistic 3DGS environments via the Habitat-GS Bridge. Use when: user asks to explore a 3D scene, perform embodied navigatio...

Registry SourceRecently Updated
1930Profile unavailable
General

Flash Flood Desert Survival — Oman Wadi Shab | AI Experience

Feel the pulse‑pounding urgency of surviving a sudden flash flood in Oman's stark desert canyons. Navigate collapsing stone channels as sensors fail, using s...

Registry SourceRecently Updated
920Profile unavailable
General

Rub' al Khali Sandstorm Survival Experience | AI Experience

Feel the raw tension of survival as a blinding sandstorm strips away digital safety nets, forcing you to trust instinct and simple tools. Navigate shifting d...

Registry SourceRecently Updated
720Profile unavailable