ros2bagreader
Description
The ros2bagreader object is an index of the messages within a ROS
2 bag file. You can use this object to extract message data from a ROS 2 bag file or select
messages based on specific criteria. The ros2bagreader object supports
sqlite3 (DB3) and MCAP storage format.
Creation
Description
creates a bagReader = ros2bagreader(folderpath)ros2bagreader object, bagReader, that
contains all the messages from the ROS 2 bag file in the input file or folder. The
folderpath input sets the FilePath
property.
You can use the ROS 2 bag files for storing messages that are transmitted over a ROS 2 network. You can then use the resulting bag file for offline analysis and visualization.
You can read a single DB3 or MCAP file in the bag folder by specifying the
folderpath as a single file. You can also read all the DB3 or MCAP
files in the bag folder by specifying the folderpath as a folder.
Ensure that you have read and write access to the bag folder that contains the DB3 files.
However, for reading a MCAP file, you must have read access to the bag folder only.
You can read compressed ROS 2 bag files in file or
message compression mode and ZSTD compression format.
Note
To read compressed ROS 2 bag files, specify the folderpath as
the folder location.
If a ROS 2 bag file contains custom messages, create custom messages for MATLAB
using the ros2genmsg
function before creating the ros2bagreader object.
Properties
Object Functions
readMessages | Read messages from ros2bagreader object |
select | Select subset of messages in ros2bagreader |
timetable | Create timetable for selected message properties in ROS 2 bag file |
getTransform | Return transformation between two coordinate frames |
canTransform | Verify if transformation is available |