Info
この質問は閉じられています。 編集または回答するには再度開いてください。
code generation error with pointCloud object
2 ビュー (過去 30 日間)
古いコメントを表示
Error: The library method 'vision.internal.buildable.ComputeMetricBuildable.updateBuildInfo' failed.
Caused by: Unable to determine MEX compiler: use mex -setup to configure your system.
I have checked with such compilers as mingw, VS 2019 and VS 2022. Code generation works fine for basic ros2 subscribers/publishers and other example codes I checked. For this case, I traced the error to the pointCloud object used in the function 'limit_FoV', why am I seeing this error? Is there a workaround for it?
function main_lidar_cg_Version1()
%#codegen
domainID = 0;
Name = "/trackingNode";
LidarTrackerNode = ros2node(Name, domainID);
lidar_sub = ros2subscriber(LidarTrackerNode, "/livox/lidar","sensor_msgs/PointCloud2",@mylidar_cb);
end
function mylidar_cb(message)
xyz = rosReadXYZ(message);
[pcSurvived,survivedIndices,croppedIndices] = limit_FoV (xyz);
end
function [pcSurvived,survivedIndices,croppedIndices] = limit_FoV (pointcloud_in)
% XLimits XLimits for the scene
XLimits = [0 30];
% YLimits YLimits for the scene
YLimits = [-6 6];
% ZLimits ZLimits fot the scene
ZLimits = [-2 2];
% EgoVehicleRadius Radius of ego vehicle
EgoVehicleRadius = 0;
currentPointCloud = pointCloud(pointcloud_in);
[pcSurvived,survivedIndices,croppedIndices] = cropPointCloud(currentPointCloud,XLimits,YLimits,ZLimits,EgoVehicleRadius);
end
function [ptCloudOut,indices,croppedIndices] = cropPointCloud(ptCloudIn,xLim,yLim,zLim,egoVehicleRadius)
% This method selects the point cloud within limits and removes the
% ego vehicle point cloud using findNeighborsInRadius
locations = ptCloudIn.Location;
locations = reshape(locations,[],3);
insideX = locations(:,1) < xLim(2) & locations(:,1) > xLim(1);
insideY = locations(:,2) < yLim(2) & locations(:,2) > yLim(1);
insideZ = locations(:,3) < zLim(2) & locations(:,3) > zLim(1);
inside = insideX & insideY & insideZ;
% Remove ego vehicle
nearIndices = findNeighborsInRadius(ptCloudIn,[0 0 0],egoVehicleRadius);
nonEgoIndices = true(ptCloudIn.Count,1);
nonEgoIndices(nearIndices) = false;
validIndices = inside & nonEgoIndices;
indices = find(validIndices);
croppedIndices = find(~validIndices);
ptCloudOut = select(ptCloudIn,indices);
end
0 件のコメント
回答 (0 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!