Added Script to Convert Sensor Data to ROS ".bag" Files#109
Merged
Averyyy merged 11 commits intoinfra_a_mainfrom Feb 17, 2025
Merged
Added Script to Convert Sensor Data to ROS ".bag" Files#109Averyyy merged 11 commits intoinfra_a_mainfrom
Averyyy merged 11 commits intoinfra_a_mainfrom
Conversation
|
Collaborator
|
lgtm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


A script was written to convert images, depth maps, and point clouds to a ROS .bag file. The script assumes that all the data is in a single directory and it sorts it by file type, then matches all the 3 file types by looking at the order in which they were collected. For example, color1.png is matched with depth1.tif and lidar1.npz.
The script can be run from the terminal by specifying the directory where the data is located and where the bag file will be saved.
To visualize the .bag file, split the terminal and run in the first one:
rosbag play output.bagand in the second one:
rvizIn RVIZ, add the data from the sensors by pressing "Add" in the bottom left corner and select which data you want to examine using the "By topic" option. RGB images and depth maps will appear in the bottom left corner of the window and point clouds will appear in the 3D map. You will be able to see the point clouds by setting "Fixed Frame" under "Global Options" to "Velodyne".