一键导入
rtabmap-slam
RTAB-Map SLAM integration with CouchVision. Use when working on visual SLAM, loop closure, keyframe tuning, or debugging map building issues.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
RTAB-Map SLAM integration with CouchVision. Use when working on visual SLAM, loop closure, keyframe tuning, or debugging map building issues.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Docker on macOS via Colima. Use when running Docker containers, debugging container issues, or working with docker-compose on Mac.
Deploying and benchmarking on Jetson Orin Nano. Use when deploying code to Jetson, running TensorRT inference, monitoring GPU usage, or benchmarking performance.
CouchVision perception stack — YOLOv8 + YOLOP + TensorRT + RTAB-Map SLAM. Use when working on object detection, lane segmentation, model export, SLAM, or running the perception stack on Mac or Jetson.
ROS2 Jazzy on macOS Apple Silicon. Use when running ROS2 commands, debugging DDS discovery, launching rviz2, or working with the CouchVision bridge.
基于 SOC 职业分类
| name | rtabmap-slam |
| description | RTAB-Map SLAM integration with CouchVision. Use when working on visual SLAM, loop closure, keyframe tuning, or debugging map building issues. |
RTAB-Map (Real-Time Appearance-Based Mapping) provides visual SLAM for CouchVision. It builds an occupancy grid map from RGB-D data and publishes the map→odom transform.
/camera/image/compressed (from Python)
│
▼
republish node (decompresses)
│
▼
/camera/image (raw RGB 512×384)
│
├──────────────────────────────┐
│ │
▼ ▼
/camera/depth/image (32FC1) /camera/camera_info
│ │
└──────────────────────────────┘
│
▼
RTAB-Map
│
├─→ /map (OccupancyGrid)
├─→ /mapPath (trajectory)
├─→ /tf (map→odom)
└─→ /mapData, /mapGraph, etc.
| File | Purpose |
|---|---|
perception/launch/nav2_planner.launch.py | ROS2 launch file with RTAB-Map node |
perception/config/rtabmap_params.yaml | RTAB-Map configuration |
perception/src/couch_perception/nav2_planner.py | Python script that publishes resized images |
perception/src/couch_perception/gpu_utils.py | GPU-accelerated image resize (cv2.cuda on Jetson) |
make full-stack BAG=bags/walk_around_university_all_data.mcap
# Connect Foxglove to ws://localhost:8765
Check for WM=N in logs where N > 1:
docker compose -f perception/docker-compose.nav2.yml logs | grep "WM="
# Good: (local map=2, WM=6)
# Bad: (local map=1, WM=1)
Root cause of WM=1: RGB and depth images must have compatible resolutions.
Original problem:
"RGB size modulo depth size is not 0. Ignoring depth mask"Fix in nav2_planner.py:
from couch_perception.gpu_utils import resize_image, resize_depth
# Resize both to common resolution for SLAM
target_size = (512, 384)
rgb_resized = resize_image(frame.image, target_size, cv2.INTER_AREA)
depth_resized = resize_depth(frame.depth, target_size)
Also scale camera intrinsics:
scale_x = target_w / intrinsics.width
scale_y = target_h / intrinsics.height
fx = intrinsics.K[0, 0] * scale_x
fy = intrinsics.K[1, 1] * scale_y
cx = intrinsics.K[0, 2] * scale_x
cy = intrinsics.K[1, 2] * scale_y
Located in perception/config/rtabmap_params.yaml:
# Feature detection (ORB)
Kp/MaxFeatures: "500" # More features = better keyframes
Kp/DetectorStrategy: "6" # 6 = ORB
Vis/FeatureType: "6" # Must match detector
# Keyframe management
Mem/RehearsalSimilarity: "0.2" # Lower = more distinct keyframes (default 0.6)
Mem/IncrementalMemory: "true" # Build map incrementally
Vis/MinInliers: "15" # Minimum features for valid keyframe
# Graph density
Rtabmap/CreateIntermediateNodes: "true" # Denser pose graph
# Performance
Rtabmap/DetectionRate: "1.0" # Process 1 frame per second
Db/Sqlite3InMemory: "true" # Faster database operations
If WM stays at 1-2:
Kp/MaxFeatures: "1000"Mem/RehearsalSimilarity: "0.1"Vis/FeatureType must equal Kp/DetectorStrategy/map — OccupancyGrid (the SLAM map)/mapPath — Trajectory (where robot has been)/tf — Transform treemapRTAB-Map isn't receiving synchronized messages. Check:
/camera/image, /camera/depth/image, /camera/camera_info)Old keyframes have too few features. This happens when early frames were captured before good images arrived. The system will work better as more good keyframes accumulate.
/map topic in 3D panelmap/map is publishing: ros2 topic hz /map| Topic | Type | Purpose |
|---|---|---|
/map | OccupancyGrid | 2D occupancy map |
/mapPath | Path | SLAM trajectory |
/mapData | MapData | Full map data for saving |
/mapGraph | MapGraph | Pose graph visualization |
/rtabmap/republish_node_data | Service | Republish specific nodes |
map (RTAB-Map publishes map→odom)
└── odom (static: identity)
└── base_link (static: identity)
├── camera (static: identity)
└── imu (static: identity)
RTAB-Map corrects drift by adjusting the map→odom transform.