Recording a Good Bag¶
A map is only as good as the recording behind it. This page is the checklist for
recording a bag that the browser app (or lidarslam-map) can turn
into a clean map. The app's check links here when something is missing.
日本語版
Before you go¶
- Storage. A LiDAR records a few megabytes per second (a Livox MID-360 as PointCloud2 is about 4–6 MB/s; Velodyne packets are smaller). Plan about 1 GB per 3–5 minutes, and record to a fast disk (NVMe/SSD). A slow or full disk drops messages, which shows up as gaps in the map.
- A short test first. Record 30 seconds, drop the bag into the app, and see that the check passes before the long run.
What to record¶
Always the LiDAR and its IMU; add GNSS if you want the map placed on the globe.
| Sensor | Driver | Record |
|---|---|---|
| Livox MID-360 | livox_ros_driver2 |
/livox/lidar and /livox/imu. xfer_format 0 (PointCloud2) or 1 (CustomMsg): both work. |
| Ouster | ouster-ros |
/ouster/points, /ouster/imu and /ouster/metadata: the metadata is the sensor's own calibration, which the app uses to place the LiDAR and the IMU. |
| Velodyne | velodyne_driver |
/velodyne_packets (smaller) or /velodyne_points, and the IMU you use with it. |
| any | GNSS receiver | a sensor_msgs/NavSatFix topic (optional). |
ros2 bag record /livox/lidar /livox/imu # Livox MID-360
ros2 bag record /ouster/points /ouster/imu /ouster/metadata # Ouster
rosbag record /velodyne_packets /imu/data # ROS 1, Velodyne
ROS 1 bags (rosbag record, also with --lz4 or --bz2) and ROS 2 bags
(.db3 or .mcap) both work; zip a ROS 2 bag folder to upload it as one file.
Every point needs its time¶
A LiDAR scan takes about 0.1 s, during which the sensor moves. Each point must
carry its own time so the motion can be taken out. The usual drivers do this by
default:
- Livox: offset_time, or timestamp;
- Ouster: t;
- Velodyne: time.
If the app says the points have no time field, turn per-point timestamps on in the driver and record again.
The IMU¶
Record the IMU at 100 Hz or more. Below 50 Hz the motion between and within scans is poorly known. A LiDAR with a built-in IMU (Livox MID-360, Ouster) publishes it as its own topic: record that topic.
Where the LiDAR and the IMU sit¶
The odometry has to know how the LiDAR and the IMU are placed relative to each
other.
- In one housing with the same frame (Livox MID-360), nothing is needed.
- Ouster bags with /ouster/metadata are set up automatically from the
sensor's calibration.
- A separate IMU needs the offset between the two:
extrinsic_lidar2base_quat_xyzw_xyz / extrinsic_imu2base_quat_xyzw_xyz.
Enter it under Advanced in the app; a rough measurement to within a few
centimetres and degrees is far better than none.
Clocks¶
The LiDAR and the IMU must share a clock. If the check reports that their first times are seconds apart, or that times go backwards, synchronise the devices (PTP, the driver's time sync) and record again.
How to move¶
- Stand still for 2–3 seconds at the start. The odometry measures gravity and the IMU's bias while the sensor is still.
- Move smoothly at walking or slow driving speed; avoid quick spins and hard shakes. Hand-held: hold the sensor steady, not swinging.
- Keep things in view. In long featureless corridors, tunnels or open fields the scans cannot tell how far you moved, and the map comes out too short there. Go slower, keep walls, doors and objects in view, and leave the stretch at a place with structure.
- Come back to places you have seen, ideally to the start. Loop closure recognises a revisited place and removes the drift that built up.
GNSS¶
For a map placed on the globe (and the OpenStreetMap view), record a
NavSatFix topic and start once the receiver has a fix (status ≥ 0). The app
fits the path to the fixes, so the drive should cover at least a few metres in
open sky.
Check it¶
Drop the bag into the browser app. The check lists what passes and what to fix before mapping, and after mapping What happened while mapping points at the places to look at.