| # Foxglove Visualization |
|
|
| Language: English | [简体中文](foxglove_visualization.zh-CN.md) |
|
|
| This guide shows how to inspect the dataset in Foxglove with ToF heatmaps, RGB images, LiDAR point clouds, MAVROS IMU curves, and 3D odometry. |
|
|
| The raw rosbag remains the source data. The Foxglove bag is a visualization artifact generated with `scripts/foxglove_visual.py`. |
|
|
| ## Ready-To-Open Example |
|
|
| The Hugging Face dataset includes a Foxglove example: |
|
|
| ```text |
| examples/foxglove/visual_demo.bag |
| ``` |
|
|
| It is generated from session: |
|
|
| ```text |
| raw/sessions/2026-05-20_030414_odom_run029/bag.bag |
| ``` |
|
|
| Open the example bag in Foxglove, then create the panels below. |
|
|
| ## Recommended Layout |
|
|
| | Panel | Topic / setting | |
| | --- | --- | |
| | Image | `/foxglove/tof/overview/compressed` | |
| | Image | `/camera/color/image_raw` | |
| | 3D | `Fixed frame = odom`, `Display frame = odom` | |
| | 3D point cloud | `/foxglove/livox/points` | |
| | 3D path | `/foxglove/odom/path` | |
| | 3D odometry | `/fusion_odometry/lazy_point_odom` or `/ekf_quat/ekf_odom` | |
| | Plot | `/mavros/imu/data_raw.angular_velocity.{x,y,z}` | |
| | Plot | `/mavros/imu/data_raw.linear_acceleration.{x,y,z}` | |
|
|
| For this dataset, set both 3D frame fields to: |
|
|
| ```text |
| Fixed frame: odom |
| Display frame: odom |
| ``` |
|
|
| The visualization bag provides this TF chain: |
|
|
| ```text |
| odom -> base_link -> livox_frame |
| base_link -> base_link_frd |
| odom -> odom_ned |
| ``` |
|
|
| Use `odom` for the main 3D view. `odom_ned` and `base_link_frd` are auxiliary frames for NED/FRD conventions. |
|
|
| ## Topic Guide |
|
|
| | Topic | Type | What it shows | |
| | --- | --- | --- | |
| | `/foxglove/tof/overview/compressed` | `sensor_msgs/CompressedImage` | Six-node Nooploop TOFSense-M 8x8 cascade heatmap | |
| | `/nlink_tofsensem_cascade` | `nlink_parser/TofsenseMCascade` | Original ToF numeric data | |
| | `/camera/color/image_raw` | `sensor_msgs/Image` | Intel RealSense D435i RGB stream | |
| | `/camera/color/camera_info` | `sensor_msgs/CameraInfo` | RGB camera intrinsics | |
| | `/livox/lidar` | `livox_ros_driver2/CustomMsg` | Original Livox MID360s packet topic | |
| | `/foxglove/livox/points` | `sensor_msgs/PointCloud2` | Foxglove-ready LiDAR point cloud | |
| | `/foxglove/odom/path` | `nav_msgs/Path` | Accumulated odometry trajectory for 3D display | |
| | `/mavros/imu/data` | `sensor_msgs/Imu` | Filtered flight-controller IMU | |
| | `/mavros/imu/data_raw` | `sensor_msgs/Imu` | Raw flight-controller IMU | |
| | `/fusion_odometry/lazy_point_odom` | `nav_msgs/Odometry` | Main odometry for 3D trajectory | |
| | `/ekf_quat/ekf_odom` | `nav_msgs/Odometry` | EKF odometry, when present | |
| | `/tf` | `tf2_msgs/TFMessage` | Dynamic odometry transform | |
| | `/tf_static` | `tf2_msgs/TFMessage` | Static camera, LiDAR, and frame transforms | |
|
|
| Foxglove does not reliably render Livox custom messages directly. Use `/foxglove/livox/points` for the 3D point cloud. |
|
|
| ## ToF Panel |
|
|
| Add an Image panel and select: |
|
|
| ```text |
| /foxglove/tof/overview/compressed |
| ``` |
|
|
| The overview image contains six TOFSense-M nodes. Each node shows: |
|
|
| | Field | Meaning | |
| | --- | --- | |
| | `dis` | distance in millimeters | |
| | `dis_status` | per-pixel distance status | |
| | `signal_strength` | per-pixel return strength | |
|
|
| Valid pixels are colorized by distance. Invalid or missing pixels are drawn in gray. |
|
|
| ## LiDAR Panel |
|
|
| Add a 3D panel and select: |
|
|
| ```text |
| /foxglove/livox/points |
| ``` |
|
|
| Recommended point-cloud settings: |
|
|
| | Setting | Value | |
| | --- | --- | |
| | Point size | `1.0` to `1.5` | |
| | Point shape | Circle | |
| | Color mode | Color map | |
| | Color field | `intensity` | |
| | Stixel view | Off | |
|
|
| If Stixel view is enabled, Foxglove draws pillar-like vertical structures. That is useful for obstacle-style views, but it is not the best mode for checking the raw point cloud. |
|
|
| ## Odometry And TF |
|
|
| Add odometry display in the same 3D panel: |
|
|
| ```text |
| /fusion_odometry/lazy_point_odom |
| ``` |
|
|
| For the already-traveled trajectory line, add: |
|
|
| ```text |
| /foxglove/odom/path |
| ``` |
|
|
| If that topic is not available in a selected session, use: |
|
|
| ```text |
| /ekf_quat/ekf_odom |
| ``` |
|
|
| The generated bag injects dynamic TF from odometry, so the 3D view can resolve: |
|
|
| ```text |
| odom -> base_link -> livox_frame |
| ``` |
|
|
| This is the frame path required to show the LiDAR point cloud together with the odometry trajectory. |
|
|
| ## IMU Plots |
|
|
| Add a Plot panel and select angular velocity: |
|
|
| ```text |
| /mavros/imu/data_raw.angular_velocity.x |
| /mavros/imu/data_raw.angular_velocity.y |
| /mavros/imu/data_raw.angular_velocity.z |
| ``` |
|
|
| For acceleration, add: |
|
|
| ```text |
| /mavros/imu/data_raw.linear_acceleration.x |
| /mavros/imu/data_raw.linear_acceleration.y |
| /mavros/imu/data_raw.linear_acceleration.z |
| ``` |
|
|
| Use `/mavros/imu/data` when you want the filtered MAVROS IMU stream, and `/mavros/imu/data_raw` when you want the raw flight-controller IMU stream. |
|
|
| ## Generate A Visualization Bag |
|
|
| Build the ROS1 helper image once: |
|
|
| ```bash |
| make docker-build |
| ``` |
|
|
| Generate a 30 second all-modality example: |
|
|
| ```bash |
| docker/ros1_noetic/run.sh 'python3 scripts/foxglove_visual.py \ |
| --input-bag raw/sessions/2026-05-20_030414_odom_run029/bag.bag \ |
| --output-bag outputs_tmp/foxglove_samples/run029_mid30s_all_modalities_foxglove.bag \ |
| --start-offset-sec 189.891 \ |
| --duration-sec 30 \ |
| --copy-mode custom \ |
| --keep-topics /tf_static,/camera/color/image_raw,/camera/color/camera_info,/livox/lidar,/mavros/imu/data,/mavros/imu/data_raw,/nlink_tofsensem_cascade,/fusion_odometry/lazy_point_odom,/ekf_quat/ekf_odom \ |
| --tof-rate-hz 15 \ |
| --tf-rate-hz 30 \ |
| --tf-parent-frame odom \ |
| --force' |
| ``` |
|
|
| Generate a ToF + odometry focused bag: |
|
|
| ```bash |
| docker/ros1_noetic/run.sh 'python3 scripts/foxglove_visual.py \ |
| --input-bag raw/sessions/2026-05-20_030414_odom_run029/bag.bag \ |
| --output-bag outputs_tmp/foxglove_samples/run029_tof_odom_foxglove.bag \ |
| --copy-mode custom \ |
| --keep-topics /tf_static,/mavros/imu/data,/mavros/imu/data_raw,/nlink_tofsensem_cascade,/fusion_odometry/lazy_point_odom,/ekf_quat/ekf_odom \ |
| --tof-rate-hz 15 \ |
| --tf-rate-hz 30 \ |
| --tf-parent-frame odom \ |
| --force' |
| ``` |
|
|
| ## Useful Options |
|
|
| | Option | Purpose | |
| | --- | --- | |
| | `--start-offset-sec` | Start from an offset relative to the raw bag start | |
| | `--duration-sec` | Convert only a time window | |
| | `--copy-mode custom` | Keep exactly the original topics listed in `--keep-topics` | |
| | `--keep-topics` | Original raw topics to copy into the visualization bag | |
| | `--tof-rate-hz` | ToF overview image rate; `15` matches the nominal TOFSense-M 8x8 rate | |
| | `--tof-image-mode overview` | Write only the six-node overview image | |
| | `--tof-image-mode both` | Write overview plus per-node ToF images | |
| | `--convert-livox-pointcloud2` | Convert `/livox/lidar` to `/foxglove/livox/points` | |
| | `--livox-calibration` | LiDAR-to-body calibration YAML used for `/tf_static` | |
| | `--tf-parent-frame odom` | Use `odom -> base_link` for injected dynamic TF | |
| | `--bag-compression bz2` | Compress the generated bag | |
|
|
| ## Troubleshooting |
|
|
| | Symptom | Check | |
| | --- | --- | |
| | ToF image panel says waiting for messages | Make sure `/foxglove/tof/overview/compressed` exists in the bag | |
| | LiDAR topic has a warning icon | Use `/foxglove/livox/points`, not raw `/livox/lidar` | |
| | Point cloud does not appear in 3D | Confirm `Fixed frame = odom` and `Display frame = odom` | |
| | Point cloud looks like vertical pillars | Turn Stixel view off | |
| | Odometry and point cloud are not aligned | Confirm `/tf` and `/tf_static` are enabled | |
| | RGB panel is blank | Use an Image panel for `/camera/color/image_raw` | |
|
|
| To inspect the generated bag before opening it: |
|
|
| ```bash |
| docker/ros1_noetic/run.sh 'rosbag info outputs_tmp/foxglove_samples/run029_mid30s_all_modalities_foxglove.bag' |
| ``` |
|
|