Load signals from rosbag sources into Ground Truth Labeler app
vision.labeler.loading.RosbagSource class creates an interface for
loading signals from rosbag files into the Ground
Truth Labeler app. In the Add/Remove Signal dialog box of the app, when
Source Type is set to
Rosbag, this class
controls the parameters in that dialog box.
To access this dialog box, in the app, select Open > Add Signals.
The default implementation of this class loads signals from these ROS message types:
This class requires ROS Toolbox.
vision.labeler.loading.RosbagSource class is a
When you export labels from a Ground Truth Labeler app session that contains
rosbag sources, the exported
groundTruthMultisignal object stores instances of this class in its
To create a
RosbagSource object programmatically, such as when
programmatically creating a
groundTruthMultisignal object, use the
vision.labeler.loading.RosbagSource function (described here).
rosbagSource = vision.labeler.loading.RosbagSource
RosbagSource object for loading signals from rosbag data
sources. To specify the data source and the parameters required to load the source, use
Name— Name of source type
"Rosbag"(default) | string scalar
Name of the type of source that this class loads, specified as a string scalar.
Description— Description of class functionality
"A rosbag reader"(default) | string scalar
Description of the functionality that this class provides, specified as a string scalar.
SourceName— Name of data source
(default) | string scalar
Name of the data source, specified as a string scalar. Typically,
SourceName is the name of the file from which the signal is
SourceParams— Parameters for loading signals from rosbag data source
(default) | empty structure
Parameters for loading signals from a rosbag data source, specified as an empty
structure. When you load image or lidar signals from a rosbag, do not specify the signal
timestamps or any other parameters. The
loadSource method reads these
parameters from the rosbag.
SignalName— Names of signals in data source
(default) | string vector
Names of the signals that can be loaded from the data source, specified as a string vector.
SignalType— Types of signals in data source
(default) | vector of
Types of the signals that can be loaded from the data source, specified as a vector of
vision.labeler.loading.SignalType enumerations. Each signal listed in the
SignalName property is of the type in the corresponding position of
Timestamp— Timestamps of signals in data source
(default) | cell array of
Timestamps of the signals that can be loaded from the data source, specified as a cell array
duration vectors. Each signal listed in the
SignalName property has the timestamps in the corresponding
NumSignals— Number of signals in data source
0(default) | integer
Number of signals that can be read from the data source, specified as an integer.
NumSignals is equal to the number of signals in the
Customize the loading panel for the data source object. In the loading dialog box of the Ground Truth Labeler app, this method is invoked when you select the data source type from the Source Type list.
Obtain the data needed to load the data source object currently selected in the loading panel. In the loading dialog box of the Ground Truth Labeler app, this method is invoked when you click Add Source . The method returns these outputs.
[sourceName,sourceParams] = getLoadPanelData(sourceObj)
Both of these outputs are passed to the
Load a data source object into the Ground Truth Labeler app. In the loading dialog box of the app, this method is invoked after you click Add Source and the
Read a frame of data from a signal contained in a data source object at the specified timestamp index. The index must be in the bounds of the length of the timestamps for that signal.
frame = readFrame(sourceObj,signalName,tsIndex)
Check the load panel for the loading dialog box of the Ground Truth Labeler app. This method opens a dialog box similar to the loading dialog box that opens in the app when, on the app toolstrip, you select Open > Add Signals. Use this method to preview how the
You can this class as a starting point for creating a custom data source loading class. To view the source code for this class, use this command: