ros2bagwriter
Create and write logs to ROS 2 bag log file
Description
Use the ros2bagwriter
object to create a ROS 2 bag log file
(.db3
) in a folder that you specify. Use the write
function to write logs to the ROS 2 bag file. Each log contains a topic, its corresponding
timestamp, and a ROS 2 message. After writing the logs to the ROS 2 bag file, call the
delete
function to close the opened ROS 2 bag file, create the
metadata.yaml
file, and remove the object from memory.
Note
The ros2bagwriter
object locks the created ROS 2 bag file. Delete and
clear the ros2bagwriter
object to use the ROS 2 bag file.
Creation
Description
creates a ROS 2 bag file in the location specified by bagwriter
= ros2bagwriter(path
)path
and
returns its corresponding ros2bagwriter
object. Use the object to write
records into the ROS 2 bag file. Use the path
input argument to set
the Path
property.
The name of the ROS 2 bag file is the name of the folder containing it. If the folders
specified in path
are not in the directory, the object creates them
and places the ROS 2 bag file accordingly.
Properties
Examples
Version History
Introduced in R2022b