slamlab-offline-importer
Converts the sensor data of a ROS 2 bag into the input files of slamlab-offline: point clouds, IMU and GNSS measurements, reference trajectories and images. It reads the bag directly and needs no ROS installation.
slamlab-offline-importer <config_filepath>The single required argument is the path to a YAML configuration file. The executable reads the slamlab_offline_importer section.
slamlab-offline-importer --check <config_filepath>checks the configuration against the bag (are the topics in the bag, do they have a supported type) without converting anything. --help prints the usage, --version the version.
- Storage: MCAP (
.mcap) and SQLite (.db3) bags, as single files or as directories of files, including bags split into several files (read in the order of their index,bag_2beforebag_10).metadata.yamlis not needed: the topics, their types and the time range come from the bag files. MCAP files without summary section (e.g. of interrupted recordings) are read too; listing their topics takes an extra pass over the file. - Messages:
| Section | Message types |
|---|---|
clouds | sensor_msgs/PointCloud2, point_cloud_interfaces/CompressedPointCloud2 (Cloudini) |
imu | sensor_msgs/Imu |
gnss | sensor_msgs/NavSatFix, gps_msgs/GPSFix |
trajectories | nav_msgs/Odometry |
images | sensor_msgs/Image (mono8, rgb8, bgr8, rgba8, bgra8), sensor_msgs/CompressedImage (JPEG, PNG, H.264, H.265) |
The bag is read once for all topics; point clouds and images are converted in parallel.
Output
Section titled “Output”All files are written below output_dirpath. A topic is named by its name without the leading / and with - for /, e.g. /ouster/points becomes ouster-points.
| Section | Files |
|---|---|
clouds | clouds/<topic>/<sec>.<nsec>.laz: one LAZ file per message (see point cloud file formats), named after the header stamp. Points with the integer attributes row, col and intensity and a stamp per point, sorted by stamp. |
imu | imu/<topic>.csv: sec,nsec,angular_velocity_x,angular_velocity_y,angular_velocity_z,linear_acceleration_x,linear_acceleration_y,linear_acceleration_z |
gnss | gnss/<topic>.csv: sec,nsec,x,y,z,cov_00,...,cov_22 with UTM coordinates plus the shift; gnss/<topic>.shift: the applied shift and the UTM zone |
trajectories | trajectory/<topic>.txt: TUM (timestamp tx ty tz qx qy qz qw) or KITTI |
images | images/<topic>/<sec>.<nsec>.jpg |
The clouds directory and the imu and gnss files are the inputs clouds_dirpath, imu_measurements_filepath and absolute_position_measurements_filepath of slamlab_offline.
The importer logs the fields and the point stamps of the first cloud of each topic, e.g. point stamps from +0.000 ms to +99.954 ms relative to the header. Check them to see if the point stamps are configured right.