Issue loading file in LiDAR labeler using custom point cloud reader

4 次查看(过去 30 天)
I am trying to use MATLAB's lidar labeler app to manually label some ground truth data. The lidar data I have is stored in a custom format, and I would like to use my own ground removal algorithm. So I chose to use the 'Custom Point Cloud' option as detailed here.
regardless of the sourcename I try to give it, the function call shown below,
lidarLabeler(sourceName,@FunctionHandle,timestamps);
results in the following error: "filename" must be a string scalar or character vector. Error in lidar.internal.lidarLabeler.lidarLabelerInternal
To ensure sourceName is of the proper data type, I tried doing the following:
fileFilter = '*.pcap';
[File_name,Directory]= uigetfile(fileFilter,'Open a .pcap file');
fileName = [Directory File_name];
and I tried passing fileName to the lidar labeLabeler and still have the same issue. Please advise on how to properly pass the file name to lidar labeler?

采纳的回答

Vijeta
Vijeta 2023-6-14
编辑:Vijeta 2023-6-14
Hi,
Based on the error you are receiving, it appears that the sourceName input argument in lidarLabeler(sourceName, @FunctionHandle, timestamps) must be a string scalar or character vector. This means that you must pass a file name as a string or character vector, rather than a variable containing a file name.
In the code snippet you provided, you are correctly using uigetfile to open a file and obtain its name as a string. However, it looks like you are combining the directory and file name using square brackets (fileName = [Directory File_name];) which results in a character array, not a string scalar. Instead, you should use fullfile to concatenate directory and file name as a string:
[fileName, directory] = uigetfile(fileFilter, 'Open a .pcap file');
sourceName = fullfile(directory, fileName);
This will create a string scalar with the full path to the file, which you can then pass to the lidarLabeler function.
Note that the fullfile function takes care of the appropriate separator character for the platform you are working on (e.g., '' on Windows, '/' on Linux/Mac), so you don't need to manually add it or worry about platform-specific issues.
You can refer to these resources
  1 个评论
Vamsi Krishna Bandaru
@Vijeta, Thank you for the reply. The solution you provided works for any file in the local drive of a windows computer. When i tried to point to a file that is stored on a network drive, i receive the same error : "sourceName" must be a string scalar or character vector.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Preprocessing 的更多信息

产品


版本

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by