Skip to content

πŸ”₯ Fix: rosbag recorder records all topics β€” data size explodes (especially with Nav2)Β #65

Description

@PurpleSand123

🎯 Problem

The rosbag recorder in docker-compose.yml uses ros2 bag record -a which records all topics. This causes the recorded bag size to explode, especially when Nav2 is running.

Current command (docker-compose.yml L306):

ros2 bag record -a -o /workspace/rosbags/recording_$(date +%Y%m%d_%H%M%S) --exclude-topics /front_stereo_camera/left/image_raw

Only the raw camera image is excluded. All other high-bandwidth topics are still recorded.

πŸ“Š High-Bandwidth Topics Being Recorded

When Nav2 is running, the following topics publish at high frequency and/or large message sizes:

Topic Type Why it's large
/front_3d_lidar/lidar_points sensor_msgs/PointCloud2 3D LiDAR point cloud β€” very large per message
/local_costmap/costmap nav_msgs/OccupancyGrid Updated at controller frequency (~20 Hz)
/global_costmap/costmap nav_msgs/OccupancyGrid Full map-sized grid, updated periodically
/map nav_msgs/OccupancyGrid Static map (large, but infrequent)
/front_stereo_camera/left/image_raw/compressed sensor_msgs/CompressedImage The republished compressed image is still recorded
/tf tf2_msgs/TFMessage High frequency transform updates
Nav2 internal topics Various /local_costmap/costmap_raw, /global_costmap/costmap_raw, planner internals, etc.

πŸ’‘ Proposed Fix

Switch from record -a (all topics) to explicitly listing only the topics needed for data collection and evaluation:

ros2 bag record \
  /chassis/odom \
  /cmd_vel \
  /front_stereo_camera/left/image_raw/compressed \
  /joy \
  /tf \
  /tf_static \
  /start_marker \
  /goal_marker \
  /plan \
  /goal_pose \
  -o /workspace/rosbags/recording_$(date +%Y%m%d_%H%M%S)

Alternatively, use --exclude-regex to drop the known heavy topics:

ros2 bag record -a \
  --exclude-regex '.*costmap.*|.*lidar_points.*|.*image_raw$|.*bond.*|.*parameter_events.*' \
  -o /workspace/rosbags/recording_$(date +%Y%m%d_%H%M%S)

πŸ“Ž References

  • File: docker-compose.yml L290-307
  • Data processing config: costnav_isaacsim/il_baselines/data_processing/configs/processing_config.yaml (only uses /front_stereo_camera/left/image_raw)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions