The Lidar Labeler app enables you to label ground truth data in point clouds. You can use a custom reader to import the data. First, create a custom reader function. Then, load the custom reader function and corresponding point cloud data source into the Lidar Labeler.
Specify a custom reader as a function handle. The custom reader must have this syntax.
outputPointCloud = readerFcn(sourceName,currentTimestamp)
readerFcnis the name of the custom reader function.
The custom reader function loads a point cloud from
corresponds to the current timestamp specified by
For example, suppose you want to load the point cloud at the third timestamp for a
duration vector that runs from 1 to 5 seconds. To specify
currentTimestamp, at the MATLAB® command prompt, enter this
timestamps = seconds(1:5); currIdx = 3; currentTimestamp = timestamps(currIdx);
outputPointCloud from the custom reader function must be a
currentTimestamp is a scalar value
that corresponds to the current frame that the function is executing.
To import a custom data source into the app, first create a structure. This structure stores the function handle and timestamps. Specify the custom reader function handle that reads the data, and the timestamps.
sourceParams = struct(); sourceParams.FunctionHandle = readerFcn; sourceParams.Timestamps = timestamps;
To load this structure into the app, at the MATLAB command prompt, enter this code.
Alternatively, on the toolstrip of the Lidar Labeler app, select
Import > Add Point Cloud.
Then, in the Select Point Cloud dialog box, choose
Cloud as the Source Type. Specify
Custom Reader Function as the function handle and also specify
Source Name. In addition, you must import corresponding
timestamps from the MATLAB workspace.