Skip to content

Software

mola_input_rosbag1

By The MOLA SLAM framework, Spain (checked on github.com/MOLAorg (opens in a new tab)), from github.com/MOLAorg/mola_input_rosbag1 (opens in a new tab)

  • Navigation and mapping
  • Tool
  • BSD-3-Clause

A MOLA data source module that reads ROS 1 .bag files and exposes their contents as MOLA observations, without needing a ROS 1 installation.

Facts

GitHub stars
8read on 28 Nov 2026
Last update
15 Nov 2026Newest commit on develop
Maintenance
Activea commit in the last 90 days
Difficulty
Advanced

Checked on GitHub on 28 Nov 2026.

Licenses

Code
BSD-3-Clause (opens in a new tab)

Read by Robotheca from LICENSE (opens in a new tab) (BSD-3-Clause) at commit 9a9e2dc (opens in a new tab), on 21 Nov 2026.

Commercial use
Yes

At a glance

What it is
  • Reads ROS 1 bag files and turns supported message types into MOLA/MRPT observations such as IMU, images, point clouds, laser scans, GPS, odometry and poses.
  • Vendors the ROS 1 bag reader and message definitions, so it builds in a pure ROS 2 or non-ROS colcon workspace.
  • Can replay bags as a ROS 1 to ROS 2 bridge, republishing streams as ROS 2 topics and /tf in real time.
  • Looks up sensor poses from the bag's /tf and /tf_static tree relative to a configurable robot body frame.
  • Supports an optional ground-truth trajectory pre-scanned from a chosen topic, for evaluation.
  • Includes a rosbag1-info command-line tool that summarizes a bag's topics, types, duration and message counts.

Robotheca's summary of the project's documents, not the creator's words.

Robots on Robotheca
No robot on Robotheca uses it yet.
Licence
BSD-3-Clause. Commercial use: Yes. Where it was read
Install
In the creator's words: The project's README (opens in a new tab)
Maintenance
Active, last commit on 15 Nov 2026.

Use it

How to install it, in the creator's words: The project's README (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit 9a9e2dc

Robotheca read the repository at two versions: the summary at d1079e4 and the facts and the README at 9a9e2dc (read on 28 Nov 2026).

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: README.md by The MOLA SLAM framework, at commit 9a9e2dc, under BSD-3-Clause (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

mola_input_rosbag1

In the "Builds" column, the top badge is for amd64 and the bottom one for arm64.

A MOLA RawDataSource module that reads ROS 1 .bag files and exposes their contents as MOLA observations, without requiring a ROS 1 installation.

The ROS 1 bag (de)serialization, message definitions, and rosbag_storage reader are vendored inside this package (see the ros1/ and mrpt_ros_bridge/ subdirectories), so the module builds and runs in a pure ROS 2 (or even non-ROS) colcon workspace.

Typical uses:

  • Feed a legacy ROS 1 dataset into MOLA LiDAR Odometry or any other MOLA consumer.
  • Turn MOLA into a ROS 1 -> ROS 2 bridge: read a .bag and re-publish its streams as ROS 2 topics + /tf, in real time (see demo below).
  • Inspect raw sensor streams in the MOLA visualizer.
Supported message types
ROS 1 message typeMOLA / MRPT observation
sensor_msgs/ImuCObservationIMU
sensor_msgs/ImageCObservationImage (mono8, mono16, rgb8, bgr8, rgba8, bgra8, bayer_rggb8, bayer_bggr8, bayer_gbrg8, bayer_grbg8)
sensor_msgs/CompressedImageCObservationImage (JPEG, PNG, BMP, TGA, GIF, PSD, HDR, PNM)
sensor_msgs/PointCloud2CObservationPointCloud (XYZ / XYZI / XYZIRT) or CObservationRotatingScan
livox_ros_driver/CustomMsg, livox_ros_driver2/CustomMsgCObservationPointCloud (XYZIRT: intensity=reflectivity, ring=line, time=offset_time)
sensor_msgs/LaserScanCObservation2DRangeScan
sensor_msgs/NavSatFixCObservationGPS
nav_msgs/OdometryCObservationOdometry (planar; see note below)
geometry_msgs/PoseStamped, geometry_msgs/PoseWithCovarianceStampedCObservationRobotPose (full SE(3) + 6x6 covariance)
tf2_msgs/TFMessage (/tf, /tf_static)transform tree (sensor pose lookup)

CObservationOdometry is a planar type: it holds only (x, y, yaw) and a 2D twist (vx, vy, wz). For a 3D odometry source -- a legged robot, a VIO, an aerial platform -- that discards z, roll, pitch and the covariance the source publishes. To keep them, ask for the SE(3) type explicitly:

sensors:
  - topic: /state_estimator/odometry
    sensorLabel: odom
    type: CObservationRobotPose   # instead of the automatic CObservationOdometry

The automatic mapping is unchanged, so existing configurations keep the planar behavior. A source that publishes an all-zero covariance is given a default of 10 cm / 2 deg rather than being read as an exact measurement.

Topics with no known mapping are ignored (a one-time warning is logged).

Sensor poses and /tf

The pose of each sensor in the robot body frame is looked up from the bag's /tf and /tf_static tree, as the transform base_link_frame_id -> <message frame_id>.

  • Set base_link_frame_id to the name of your robot body frame. Note that many ROS 1 bags use namespaced frames (e.g. r1/base_link instead of base_link).
  • If the relevant transform is not yet available when a message is read (e.g. the first few messages before any /tf), that single observation is dropped and a throttled warning lists the currently known tf frames, which is handy for discovering the correct base_link_frame_id.
  • If your bag has no /tf, override the pose per sensor with fixed_sensor_pose (see the example in rosbag1_lidar.yaml).
Parameters
ParamRequiredDefaultDescription
rosbag_filenameyes-Path to the input .bag file, or a YAML sequence of paths to merge and replay jointly in time order (e.g. a sensors bag plus a separate ground-truth-only bag).
base_link_frame_idnobase_linkRobot body frame for tf pose lookup.
time_warp_scaleno1.0Playback speed multiplier.
read_ahead_lengthno15Number of messages pre-read ahead.
start_pausednofalseStart playback paused.
sensorsnoautoExplicit list of topics, types, and pose overrides. If omitted, all topics with a known mapping are exposed automatically using the topic name as sensorLabel.
ground_truth_topicno-Topic (geometry_msgs/PoseStamped or nav_msgs/Odometry) pre-scanned at start-up into a full trajectory, exposed via the mola::OfflineDatasetSource ground-truth API (hasGroundTruthTrajectory() / getGroundTruthTrajectory()), e.g. for evo-style evaluation. This is independent from (and can be combined with) listing the same topic under sensors for normal per-timestep publishing as a CObservationRobotPose/CObservationOdometry.
ground_truth_tum_fileno-Ground-truth trajectory as a TUM text file (t x y z qx qy qz qw, # comments allowed), exposed through the same ground-truth API, e.g. to draw it in the GUI. Takes precedence over ground_truth_topic.

See mola-cli-launchs/rosbag1_lidar.yaml for a fully documented sensors example, and mola-cli-launchs/rosbag1_botanicgarden.yaml for an example combining multiple input bags with ground_truth_topic.

Demos

Two ready-to-use mola-cli launch files are provided under mola-cli-launchs/.

1. Visualize raw LiDAR streams
ROSBAG1_FILE=/path/to/dataset.bag \
  mola-cli src/mola_input_rosbag1/mola-cli-launchs/rosbag1_lidar.yaml
2. ROS 1 -> ROS 2 bridge

Example for the NTU Viral dataset:

ROSBAG1_FILE=/mnt/storage/ntu-viral/eee_01/eee_01.bag \
mola-cli \
  src/mola_input_rosbag1/mola-cli-launchs/rosbag1_ntu_viral.yaml \
  src/mola_input_rosbag1/mola-cli-launchs/publish_to_ros2.yam

Then, in another terminal with ROS 2 sourced:

ros2 topic list
ros2 topic echo /your_topic
rviz2

If your bag uses namespaced frames, point the body frame at the right one, e.g.:

MOLA_BASE_LINK_FRAME=r1/base_link \
ROSBAG1_FILE=/path/to/dataset.bag \
  mola-cli src/mola_input_rosbag1/mola-cli-launchs/rosbag1_to_ros2.yaml
CLI tools
rosbag1-info

An equivalent to ROS 1's rosbag info, but built on the vendored ROS 1 bag reader so it runs in a pure ROS 2 (or non-ROS) environment. Once this package is built and the workspace sourced, the tool is on the PATH:

rosbag1-info /path/to/dataset.bag

It prints the bag path and version, recording duration, start/end wall-clock times, file size, total message count, compression, the message types (with their md5sums), and, per topic, the message count, average frequency and type:

path:        /path/to/dataset.bag
version:     2.0
duration:    208.8s (3min 28s)
start:       Oct 18 2022 06:12:24.58 (1666066344.58)
end:         Oct 18 2022 06:15:53.36 (1666066553.36)
size:        1.9 GB
messages:    150843
compression: none
types:       nav_msgs/Odometry [cd5e73d190d741a2f92e81eda573aca7]
             sensor_msgs/Imu [6a62c6daae103f4ff57a132d6f95cec2]
             sensor_msgs/PointCloud2 [1158d486dd51d683ce2f1be655c3c181]
topics:      /imu/data          73279 msgs @   399.6 Hz : sensor_msgs/Imu
             /odom              37195 msgs @   200.0 Hz : nav_msgs/Odometry
             /velodyne_points    2071 msgs @     9.9 Hz : sensor_msgs/PointCloud2
mola-sm-attach-from-rosbag1

Adds observations from a bag (e.g. camera images, for visual place recognition) to the keyframes of an existing .simplemap. Each observation goes to the keyframe closest in time (--max-age, default 0.5 s), and each keyframe keeps the closest one per topic, so none is stored twice. Images are written as jpg/png files to <output>_Images/ (the external files of the input map are hard-linked there too); observations already in the map are not added again.

mola-sm-attach-from-rosbag1 -i map.simplemap -o map_cam.simplemap \
  --rosbag1 dataset.bag --topic /camera/image_raw:camera_left

--topic is repeatable (TOPIC or TOPIC:LABEL), one label per topic: each keyframe gets one observation per label. Use --fixed-sensor-pose "x y z yaw pitch roll" for bags without /tf, and --image-format png or inline to change how images are stored.

The ROS 2 version is mola-sm-attach-from-rosbag2 (package mola_input_rosbag2).

Building
cd ~/ros2_ws
colcon build --packages-select mola_input_rosbag1

The vendored ROS 1 reader needs Boost, BZip2 and lz4 development packages (already present in a standard ROS 2 desktop install).

Credits
  • The vendored ROS 1 rosbag_storage / roscpp_core sources under ros1/ are taken from Traj-LO (opens in a new tab) (originally Willow Garage, BSD license).
  • ROS <-> MRPT message conversions come from the mrpt_ros_bridge (opens in a new tab) ros1 branch, vendored as a git submodule.
  • Bag iteration logic is adapted from MRPT's rosbag2rawlog.

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.