Files
vSLAM_ws/ROS_TOPIC_MAP.md
trung09122002 f9a1873753 upload
2026-09-12 15:38:10 +07:00

95 lines
14 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ROS Topic Map
Use verified target-repository facts only. Keep unknown values as `Unknown / needs confirmation`.
All interfaces are ROS 1 (Noetic). "Queue" columns are ROS 1 publisher/subscriber queue sizes — ROS 1 has no QoS profiles. Rates marked *(sim)* come from Gazebo plugin `update_rate`/`updateRate` values; real-hardware rates are unverified because no sensor is connected yet.
Parity rule (`docs/ARCHITECTURE.md` §6): simulation and real hardware publish the **same topic name, frame_id, and message type**. Only the publisher differs.
## Raw Sensors
| Topic | ROS 1/ROS 2 | Message Type | Publishers | Subscribers | Rate | QoS/Queue | Notes |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `/scan_raw` | ROS 1 | `sensor_msgs/LaserScan` | sim: `richbeam_lidar` gpu_ray plugin (`libgazebo_ros_gpu_laser.so`); real: `lidar_scan_node` (pkg `lidar`, RichbeamTechnology driver) | `scan_filter` only | 25 Hz | 10 | **Raw, untrusted.** Nothing else may subscribe. Sim publishes an honest 270° / 1081 samples; the real driver publishes a scan that *claims* ±180° with `range_min=0.0` / `range_max=100.0` regardless of the device's true 270° / 0.05–40 m. See `docs/HARDWARE.md` §2 for the three driver bugs. |
| `/scan` | ROS 1 | `sensor_msgs/LaserScan` | `scan_filter` (`laser_filters/scan_to_scan_filter_chain`) | `safety_monitor` (1), `slam_core` (10), `move_base` obstacle_layer, RTAB-Map | 25 Hz | sub 1 / 10 | frame `laser_link`. **Sanitised**: header `range_min`/`range_max` corrected to 0.05 / 40.0, zero returns → NaN, body-occluded arc beyond ±118° blanked to `range_max+1`. Effective FOV ~236° of the device's 270°. Identical chain in sim and on hardware. |
| `/imu/data_raw` | ROS 1 | `sensor_msgs/Imu` | sim: `libgazebo_ros_imu_sensor`; real: `imu_bridge_node.py` (MCU over serial) | `wheel_odom` (100), `gravity_align` (200), `slam_core` (200), `ekf_odom` (20) | 200 Hz *(sim)* | pub 100 (real) | frame `imu_link`. `ekf_odom` fuses **only** angular velocity Z — linear acceleration is deliberately excluded. Roll/pitch are consumed by `gravity_align`, never estimated. |
| `/joint_states` | ROS 1 | `sensor_msgs/JointState` | sim: `diff_drive_controller` (`publishWheelJointState`); L0: `joint_state_publisher` (fake); real: MCU firmware | `wheel_odom` (50), `robot_state_publisher` | ~50 Hz *(sim)* | sub 50 | Joints `left_wheel_joint` / `right_wheel_joint` are **the encoder interface** — identical name in all three sources so `wheel_odom_node` cannot tell where it is running. |
| `/camera/depth/image_rect_raw` | ROS 1 | `sensor_msgs/Image` | sim: `libgazebo_ros_openni_kinect`; real: `realsense2_camera` | `depth_to_cloud` nodelet | 30 Hz | — | 640×480. Resolution chosen for Min-Z ~22 cm over 848×480's ~30 cm. |
| `/camera/depth/camera_info` | ROS 1 | `sensor_msgs/CameraInfo` | same as above | `depth_to_cloud` nodelet | 30 Hz | — | |
| `/camera/infra1/image_rect_raw` | ROS 1 | `sensor_msgs/Image` | sim: openni_kinect `imageTopicName`; real: `realsense2_camera` | none in-repo | 30 Hz | — | Recorded to bag for a possible ORB-SLAM3 branch (GĐ6). D410 has no RGB, so IR is the only image stream. |
| `/camera/infra1/camera_info` | ROS 1 | `sensor_msgs/CameraInfo` | same as above | none in-repo | 30 Hz | — | |
| `/camera/infra2/image_rect_raw` | ROS 1 | `sensor_msgs/Image` | **real only** (`enable_infra2:=true`) | none in-repo | 30 Hz | — | ⚠️ Sim/real asymmetry: the Gazebo plugin publishes only infra1. Do not expect a stereo IR pair in simulation. |
| `/camera/infra2/camera_info` | ROS 1 | `sensor_msgs/CameraInfo` | **real only** | none in-repo | 30 Hz | — | |
| `/camera/depth/points` | ROS 1 | `sensor_msgs/PointCloud2` | sim: openni_kinect `pointCloudTopicName` | **none — intentionally unused** | 30 Hz | — | The pipeline rebuilds the cloud with `depth_image_proc` instead, because both sources publish identical depth image + camera_info. Real driver sets `enable_pointcloud:=false`. |
| `/baro/pressure` | ROS 1 | `sensor_msgs/FluidPressure` | sim: `baro_sim`; real: `imu_bridge` (BMP390) | `floor_detector` (10) | 25 Hz *(sim)* | pub 10 | Only short-term *differences* are usable — absolute pressure drifts hundreds of Pa/hour with weather while one floor is ~40–45 Pa. |
| `/baro/temperature` | ROS 1 | `sensor_msgs/Temperature` | `imu_bridge` — **real only** | none in-repo | Unknown / needs confirmation | pub 10 | `baro_sim` does not publish this. |
| `/bumper` | ROS 1 | `std_msgs/Bool` | **no publisher** — hardware not purchased | `safety_monitor` (1) | — | sub 1 | Covers the depth camera's Min-Z blind zone. Ideally cuts motor power in hardware, not through ROS. |
| `/ultrasonic/*` | ROS 1 | `sensor_msgs/Range` | **no publisher** — hardware not purchased | `safety_monitor`, one sub per entry in `ultrasonic_topics` | — | sub 1 each | ⚠️ `ultrasonic_topics` is currently `[]`. Ultrasound is the **only** sensor in this set that detects glass and mirrors (940 nm LiDAR and IR depth both pass through). Empty list = glass is invisible to the robot. |
## Odometry And State Estimation
| Topic | ROS 1/ROS 2 | Message Type | Publishers | Subscribers | Rate | QoS/Queue | Notes |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `/odom` | ROS 1 | `nav_msgs/Odometry` | `wheel_odom` | `ekf_odom` (`odom0`, 10) | tied to `/joint_states` | pub 50 | `header.frame_id=odom`, `child_frame_id=base_footprint`. This node does **not** broadcast TF. EKF fuses velocities only (`vx`, `vyaw`), never absolute pose. |
| `/odometry/filtered` | ROS 1 | `nav_msgs/Odometry` | `ekf_odom` (`robot_localization`) | `slam_core` (50, remapped from `odom`) | 50 Hz | — | The smooth, never-blind odometry source. Owner of TF `odom → base_footprint`. |
| `/wheel_odom/slip_metric` | ROS 1 | `std_msgs/Float64` | `wheel_odom` | none — diagnostic | tied to `/joint_states` | pub 10 | Compares gyro Z against encoder-derived yaw rate. ≈0 means good traction. Restaurant floors carry water and grease; on slip the covariance is multiplied by 100 rather than the data being discarded. |
| `/slam/pose` | ROS 1 | `geometry_msgs/PoseWithCovarianceStamped` | `slam_core` | `eval_ate.py` (200), `repeatability.py` | keyframe-driven (0.25 m / 0.20 rad) | pub 10 | frame `map`. ⚠️ Back-end is **passthrough** — GTSAM is not installed, so this is integrated odometry and it will drift. |
## Perception
| Topic | ROS 1/ROS 2 | Message Type | Publishers | Subscribers | Rate | QoS/Queue | Notes |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `/perception/cloud_raw` | ROS 1 | `sensor_msgs/PointCloud2` | `depth_to_cloud` (`depth_image_proc/point_cloud_xyz`) | `depth_filter` (5) | 30 Hz | 5 | Camera optical frame. All three cloud topics live inside one nodelet manager — ~4.9 MB/frame at 30 Hz would cost ~147 MB/s per process hop. |
| `/perception/cloud_filtered` | ROS 1 | `sensor_msgs/PointCloud2` | `depth_filter` (`perception_3d/DepthFilterNodelet`) | `gravity_align` (5) | 30 Hz | 5 | Range gate 0.22–4.0 m, 3 cm voxel, temporal confirmation (`min_hits: 3`). Still in the camera optical frame. |
| `/perception/cloud_aligned` | ROS 1 | `sensor_msgs/PointCloud2` | `gravity_align` (`perception_3d/GravityAlignNodelet`) | `octomap_server`, `move_base` obstacle_layer (`camera_cloud`) | 30 Hz | 5 | frame `base_footprint`, tilt-compensated using roll/pitch measured from IMU. This is the layer that sees what 2D LiDAR cannot: overhanging table tops, low objects, hanging objects, steps. |
| `/gravity_align/roll_pitch` | ROS 1 | `std_msgs/Float64MultiArray` | `gravity_align` | none — diagnostic | 200 Hz (per IMU sample) | pub 10 | Payload is `[roll, pitch, accel_ok]`. Near zero when the robot is still on level floor. |
| `/octomap_full` | ROS 1 | `octomap_msgs/Octomap` | `octomap_server` | none in-repo | on cloud input | — | 0.05 m resolution, occupancy band z ∈ [0.05, 1.10]. |
## Map, Localization And Multi-Floor
| Topic | ROS 1/ROS 2 | Message Type | Publishers | Subscribers | Rate | QoS/Queue | Notes |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `/map` | ROS 1 | `nav_msgs/OccupancyGrid` | **three mutually exclusive sources**: `rtabmap` (`grid_map` remapped, mapping + localization), `map_server`, `multi_map_manager` (multi-floor, latched) | `move_base` global_costmap `static_layer` | on update / latched | latched for `map_server` and `multi_map_manager` | The remap exists so `move_base` and the costmaps never need to know which mode is running. Exactly one publisher must be active. ⚠️ `octomap_server` does **not** publish here — its `projected_map` is remapped to `/octomap_grid` (debug only); see `docs/SIM_VS_REAL.md` §5 for why a projected octomap grid is unusable for navigation. |
| `/map_metadata` | ROS 1 | `nav_msgs/MapMetaData` | `map_server`, `multi_map_manager` | standard consumers | latched | 1 | |
| `/map_name` | ROS 1 | `std_msgs/String` | `multi_map_manager` | none in-repo | latched | 1 | Which floor map is currently loaded. |
| `/initialpose` | ROS 1 | `geometry_msgs/PoseWithCovarianceStamped` | `dock_init`, `global_scan_init`, RViz "2D Pose Estimate" | `rtabmap` (via `initialpose` → `/initialpose` remap) | on demand (`delay: 3.0` after start) | — | frame `map`. ⚠️ There is **no `amcl`** in this system — RTAB-Map does localization itself; see `localization.launch` for why. Startup pose comes from the charging dock — a *known* pose — so global relocalization is not needed for ~95% of real starts. ⚠️ Dock pose in `floors.yaml` is still `0,0,0` and must be measured after a real map exists. |
| `/floor/current` | ROS 1 | `std_msgs/Int32` | `floor_detector` | `multi_map_manager` (1) | on change | 1, latched | |
| `/floor/status` | ROS 1 | `std_msgs/String` | `floor_detector` | none in-repo | on change | 1, latched | |
| `/floor/tag_hint` | ROS 1 | `std_msgs/Int32` | `apriltag_ros` — **not installed** | `floor_detector` (5) | — | sub 5 | Barometer says *that* the floor changed; AprilTag says *which* floor. Hotel floors look identical, so geometric and visual recognition both fail — this is the absolute identity source. `tag_to_floor` mapping is in `floors.yaml`. |
## Control And Safety
| Topic | ROS 1/ROS 2 | Message Type | Publishers | Subscribers | Rate | QoS/Queue | Notes |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `/cmd_vel` | ROS 1 | `geometry_msgs/Twist` | `move_base`, teleop (L6) | `safety_monitor` (1) | 10 Hz (`controller_frequency`) | 1 | Never wired straight to motors. |
| `/cmd_vel_safe` | ROS 1 | `geometry_msgs/Twist` | `safety_monitor` | sim: `diff_drive_controller` (`commandTopic`); real: motor driver | 10 Hz | pub 1 | Gazebo plays the motor and therefore sits **behind** the safety layer, exactly as on real hardware. ⚠️ At L5 there is no `safety_monitor`, so nothing bridges `/cmd_vel` → `/cmd_vel_safe` and the robot will not move — this is intentional. For L1–L5 teleop, publish here directly. |
| `/safety/status` | ROS 1 | `std_msgs/String` | `safety_monitor` | none — operator inspection | on change | 1, latched | The isolation test: `rosnode kill /slam_core`, then confirm this topic is still alive. |
## Evaluation And Simulation-Only
| Topic | ROS 1/ROS 2 | Message Type | Publishers | Subscribers | Rate | QoS/Queue | Notes |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `/ground_truth/odom` | ROS 1 | `nav_msgs/Odometry` | `libgazebo_ros_p3d` (`ground_truth_odom`) | `baro_sim` (1), `eval_ate.py` (200), `repeatability.py` (10) | 50 Hz | — | ⚠️ **Evaluation only.** No estimator may subscribe — this is one of the three hard rules in `README.md`. The topic does not exist on real hardware. `header.frame_id` is `world`, which is *not* in the TF tree. |
| `/gazebo/odom_unused` | ROS 1 | `nav_msgs/Odometry` | `diff_drive_controller` (`odometryTopic`) | **none — intentionally** | 50 Hz | — | Gazebo's perfect odometry is parked on a deliberately useless name so it cannot be consumed by accident; `wheel_odom_node` must be tested instead, slip detection included. |
| `/repeatability/mark` | ROS 1 | `std_msgs/Empty` | manual (`rostopic pub`) | `repeatability.py` (10) | on demand | 10 | Marks arrival at a waypoint. Repeatability matters more than ATE for a serving robot. |
| `/elevator/status` | ROS 1 | `std_msgs/String` | `elevator_sim` | none in-repo | on change | 1, latched | Sim only. |
| `/elevator/goto_floor` | ROS 1 | `std_msgs/Int32` | manual / external | `elevator_sim` (1) | on demand | 1 | Sim only. |
| `/gazebo/set_model_state` | ROS 1 | `gazebo_msgs/ModelState` | `elevator_sim` | Gazebo | on demand | 1 | Teleports the robot model between floor heights to fake an elevator ride. |
| `/tf`, `/tf_static` | ROS 1 | `tf2_msgs/TFMessage` | see `TF_FRAME_MAP.md` | all TF consumers | — | — | Bag recording captures `/tf_static` only; `/tf` is regenerated on replay. |
## Services
| Service | Type | Server | Clients | Notes |
| --- | --- | --- | --- | --- |
| `/safety/reset` | `std_srvs/Trigger` | `safety_monitor` | operator | Clears a latched safety stop. |
| `/safety/estop` | `std_srvs/Trigger` | `safety_monitor` | operator | Software e-stop. A mechanical bumper that cuts motor power in hardware is still the preferred path. |
| `/dock_init/set_dock_pose` | `std_srvs/Trigger` | `dock_init` | operator | Re-publishes the configured dock pose to `/initialpose`. |
Standard services from third-party nodes (`move_base/make_plan`, `move_base/clear_costmaps`, `amcl/global_localization`, `map_server/static_map`, Gazebo services) are available when those nodes run but are not defined in this repo.
## Actions
| Action | Type | Server | Clients | Notes |
| --- | --- | --- | --- | --- |
| `/move_base` | `move_base_msgs/MoveBaseAction` | `move_base` | RViz "2D Nav Goal", any external task scheduler | The only action interface in the system. **No custom actions are defined in this repository.** |