Utility scripts for inspecting and debugging rosbag files.
- ROS 2 Humble (or later) environment sourced
- Python 3.10+
# 1. Source ROS 2 environment (provides rclpy, rosbag2_py, sensor_msgs, etc.)
source /opt/ros/humble/setup.bash
# 2. Install additional Python dependencies
pip install --user -r requirements.txtDecode and inspect PointCloud2 messages from rosbag files.
# Decode all PointCloud2 topics
python3 scripts/decode_pointcloud2.py /path/to/bag.mcap
# Show every 5000th point
python3 scripts/decode_pointcloud2.py /path/to/bag.mcap --point-step 5000Plot the value distribution of a PointCloud2 field across all topics in a rosbag.
# Plot intensity distribution
python3 scripts/plot_field_distribution.py /path/to/bag.mcap intensity
# Specify number of bins
python3 scripts/plot_field_distribution.py /path/to/bag.mcap intensity --bins 100
# Save to file
python3 scripts/plot_field_distribution.py /path/to/bag.mcap intensity -o distribution.png