The library method 'vision.in​ternal.bui​ldable.Com​puteMetric​Buildable.​updateBuil​dInfo' failed

cfg = coder.config("exe");
cfg.Hardware = coder.hardware("Robot Operating System 2 (ROS 2)");
cfg.Hardware.DeployTo = "Localhost";
cfg.Hardware.BuildAction = "Build and run";
cfg.HardwareImplementation.ProdHWDeviceType = "Intel->x86-64 (Windows64)";
cfg.HardwareImplementation.ProdLongLongMode = true; % Use 'long long' for Int64 or Uint64 data types
codegen xxx -config cfg
The library method 'vision.internal.buildable.ComputeMetricBuildable.updateBuildInfo' failed.
Caused by:
Unable to determine MEX compiler: use mex -setup to configure your system.

Answers (1)

Hello Andinet,
As the error message suggested, please use
>> mex -setup
to set up the compiler so that MATLAB can find the compiler in your system. You may also need
>> mex -setup C++
If setting up compiler does not resolve this issue, we may need to look at the m-file you are trying to generate code from.
Thanks,
Josh

3 Comments

I have cycled through mingw, VS 2019 and VS 2022. It works fine for basic ros2 subscriber and publishers. Here is the function that I am calling inside a lidar callback function to segment pointcloud2 data.
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
Here are two functions: the entry function and callback function. I am tracing the error to the pointCloud object used in the function 'limit_FoV', is there a workaround ?
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
Hi Andinet,
Sorry for late response. I tried to generate code from my side and confirm that there is an issue when pointCloud during code generation on Windows. I tried to generate code with the same setup on linux and it works.
Couple releases ago, I believe I was able to do the same thing on Windows too, so I've raised an internal ticket for the corresponding team to look into this issue.
Please reach out to MathWorks technical support if you are still looking for some workaround.
Thanks,
Josh

Sign in to comment.

Categories

Asked:

on 1 May 2023

Commented:

on 11 May 2023

Community Treasure Hunt

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

Start Hunting!