Main Content

driving.connector.Connector Class

Namespace: driving.connector

Interface to connect external tool to Ground Truth Labeler app

Description

The driving.connector.Connector class creates an interface between a custom visualization or analysis tool and a signal in the Ground Truth Labeler app. You can use the connector with video and image sequence signals only.

The driving.connector.Connector class is a handle class.

Creation

The Connector class that is inherited from the Connector interface is called a client.

The client can:

  • Sync an external tool to each frame change event for a specific signal loaded into the Ground Truth Labeler. Syncing allows you to control the external tool through the range slider and playback controls of the app.

  • Control the current time in the external tool and the corresponding display in the app.

  • Export custom labeled data from an external tool via the app.

To connect an external tool to the Ground Truth Labeler app, follow these steps:

  1. Define a client class that inherits from driving.connector.Connector. You can use the Connector class template to define a class and implement your custom visualization or analysis tool. At the MATLAB® command prompt, enter:

    driving.connector.Connector.openTemplateInEditor
    Follow the steps found in the template.

  2. Save the file to any folder on the MATLAB path. Alternatively, save the file to a folder and add the folder to MATLAB path by using the addpath function.

Properties

expand all

Start time of the signal, specified as a real scalar in seconds.

Attributes:

GetAccess
public
SetAccess
private

End time of the signal, specified as a real scalar in seconds.

Attributes:

GetAccess
public
SetAccess
private

Start of the time interval in the app, specified as a real scalar in seconds. To set the start time, use the start flag interval in the app.

Attributes:

GetAccess
public
SetAccess
private

Time of the frame currently displaying in the app for the connected signal, specified as a real scalar in seconds. If the slider is between two timestamps, then the currently displaying frame is the frame that is at the previous timestamp. For more details, see Control Playback of Signal Frames for Labeling.

Attributes:

GetAccess
public
SetAccess
private

End of the time interval in the app, specified as a real scalar in seconds. To set the end time, use the end flag interval in the app.

Attributes:

GetAccess
public
SetAccess
private

Timestamps for the connected signal, specified as a duration vector. This signal must be the main signal. If you change the main signal, the TimeVector property updates to the timestamps for new main signal.

Attributes:

GetAccess
public
SetAccess
private

Label data imported from the external tool, specified as a two-column table. The first column contains the timestamps of the connected signal and the second column contains the label information that you specify for the corresponding timestamp.

  • The first column contains the timestamps for that signal

  • The second column contains the label information that you specify for the corresponding timestamp.

Attributes:

GetAccess
public
SetAccess
private

Names of labels, specified as a character vector, a string scalar, a cell array of character vectors, or a string array. These names must be valid MATLAB variables that correspond to the label names specified in the second column of LabelData.

Attributes:

GetAccess
public
SetAccess
public
Dependent
true

Descriptions of labels, specified as a character vector, a string scalar, a cell array of character vectors, or a string array. Each description of LabelDescription corresponds to a label specified in LabelName.

Attributes:

GetAccess
public
SetAccess
public

Methods

expand all

Examples

collapse all

Connect a lidar display tool to the Ground Truth Labeler app. Use the app and tool to display synchronized lidar and video data.

Specify the name of a video signal to load into the app.

signalName = '01_city_c2s_fcw_10s.mp4';

Add the path to the function handle for the lidar display tool.

path = fullfile(toolboxdir('driving'),'drivingdemos');
addpath(path)

Connect the lidar display to the app.

groundTruthLabeler(signalName,'ConnectorTargetHandle',@LidarDisplay);

After the app loads the video and lidar display tool, remove the path to the function handle.

rmpath(path)

Tips

  • For an example of an external tool, see this driving.connector.Connector class implementation. This class implements a lidar visualization tool. You can use this code as a starting point for creating your own tools.

    edit LidarDisplay

  • To keep an external tool synchronized with the app, specify timestamps that are at the same frame rate as the signals loaded in the app. If the tool visualizes data at a timestamp that is between two frames, then the app displays the frame that is at the previous timestamp. For more details, see Control Playback of Signal Frames for Labeling.

Version History

Introduced in R2017a