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) 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 data from messages that are transmitted over a ROS 2 network. You can use the resulting bag file for offline analysis, visualization, and storage of ROS 2 messages.
You can read a single DB3 file in the bag folder by specifying the
folderpath
as a single file. You can also read all the DB3 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.
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 |
getTransform | Return transformation between two coordinate frames |
canTransform | Verify if transformation is available |