Read Data
Libraries:
ROS Toolbox /
ROS 2
Description
The Read Data block plays back ROS 2 bag log files by outputting the most
recent message from the log file, based on the current simulation time. You must load a ROS 2
bag file in DB3 or MCAP file format and specify a topic, using the Topic
parameter, to get a stream of messages from the file. The block outputs messages of this topic
from the file in sync with the simulation time. If a folder contains multiple ROS 2 bag files,
you can also read them using the Read Data block by loading the
metadata
file with .yaml
extension.
In the Read Data block mask, select Load logfile data to specify a ROS 2 bag file to load. In the Load Logfile dialog box, specify the full path to the log file, or select Browse and navigate to the bag file you want to load. To start playback at a certain point in the file, specify Start time offset in seconds. To specify how long the block plays back this file from the specified start time, specify Duration in seconds. By default, the block outputs all messages for the specified topic in the file.