Read Data
Play back data from ROS 2 log file
- Library:
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 log file (.db3
) 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.
In the Read Data block mask, select Load logfile data
to specify a ROS 2 bag log file (.db3
) to load. In the Load Logfile dialog
box, specify the full path to the log file, or select Browse and navigate to the logfile you
want to load. To start playback at a certain point in the file, specify a Start time
offset, in seconds. To specify how long the block plays back this file, from the
specified start time, specify a Duration, in seconds. By default, the
block outputs all messages for the specified topic in the file.
Ports
Output
Parameters
Model Examples
Version History
Introduced in R2021b