Running Mapper with a rosbag2¶
The mapper has no ROS 2 node of its own: it is a MOLA module, loaded together
with the other modules of the system by mola-cli. The provided launch file
reads a rosbag2 and runs LIO, the state estimator and the mapper.
Launch file¶
mola-cli-launchs/lio_smoother_mapper_from_rosbag2.yaml (installed in
share/mola_mapper/mola-cli-launchs) loads:
mola::Rosbag2Dataset: reads the bag and feeds the other modules.mola::LidarOdometry: the front end (pipeline frommola_lidar_odometry).mola::state_estimation_smoother::StateEstimationSmoother: the state estimator queried by LIO.mola::mapper::Mapper: parameters fromparams/mapper.yaml.Optionally, a GUI module.
export MOLA_INPUT_ROSBAG2=/path/to/bag
export MOLA_LIDAR_TOPIC=/ouster/points
export MOLA_IMU_TOPIC=/ouster/imu
export MOLA_GNSS_TOPIC=/gps/fix # optional
export MOLA_MAPPER_OUTPUT_TUM=/tmp/mapper.tum
mola-cli $(ros2 pkg prefix mola_mapper)/share/mola_mapper/mola-cli-launchs/lio_smoother_mapper_from_rosbag2.yaml
Environment variables of the launch file:
Variable |
Default |
Description |
|---|---|---|
|
(required) |
Path to the rosbag2. |
|
|
LiDAR topic (sensor label |
|
|
IMU topic (sensor label |
|
empty, |
Optional second IMU topic and its sensor label. |
|
empty |
GNSS topic (sensor label |
|
empty |
Camera image topics (labels |
|
empty |
Wheel odometry topic (sensor label |
|
|
Vehicle frame and TF topics read from the bag. |
|
|
Map frame ( |
|
|
|
|
|
Enable the GUI and the LiDAR preview. |
|
|
Dataset playback controls. |
|
|
LIO pipeline file. |
|
smoother default |
State estimator parameters. |
|
|
Mapper parameters (relative to the launch file). |
The mapper settings (MOLA_MAPPER_*) are listed in Configuration parameters.
Useful combinations:
A live geo-referenced estimate too:
MOLA_ESTIMATE_GEO_REF=true(the state estimator geo-references itself on the fly from the same GNSS readings as the mapper).Gyroscope factors:
MOLA_MAPPER_GYRO_LABELS=imu, optionally withMOLA_NAVSTATE_IMU_BIAS_TRACKING=truein the state estimator.Gravity factors:
MOLA_MAPPER_GRAVITY_IMU_LABELS=imu.
When the bag ends, stop the application (or set MOLA_QUIT_ON_DATASET_END=true):
the mapper then runs its final loop closure passes and writes the outputs.
Topics and TF¶
The launch file loads no ROS 2 bridge module, so it publishes no ROS 2 topics
nor /tf. Results are read from the output files (see Configuration parameters).