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?
0 个评论
采纳的回答
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Preprocessing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!