compiler error during ros code generation

8 次查看(过去 30 天)
Running colcon build in folder '/test'.
Build in progress. This may take several minutes...Error building package: build_log.
Error(s) encountered while building "mynode2"
------------------------------------------------------------------------
Build error: C++ compiler produced errors. See the Build Log for further details.
More information
Code generation failed: View Error Report
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Mex is configured to use Microsoft Visual 2022 for C++, I have also switched to the 2019 option. I have reason to believe that this had to do with changes made in the latest 2023b release. I generated code with the 2023a a while back, but with the same compiler setting I am now seeing compiler errors in 2023b. The Python environment is created with v3.10.
I am testing code generation with the following basic ROS2 publisher node.
function mynode2
%#codegen
%setenv('RMW_IMPLEMENTATION','rmw_cyclonedds_cpp')
domainID = 10;
Name = "/PosePrintNode";
PoseNode = ros2node(Name, domainID);
pose_sub = ros2publisher(PoseNode, ...
"/chatter","geometry_msgs/Pose");
% Display X position
msg = ros2message("geometry_msgs/Pose");
while (1)
msg.position.x = rand(1);
fprintf("Position = %f\n",msg.position.x)
send(pose_sub,msg)
end
end
  4 个评论
Denis Gurchenkov
Denis Gurchenkov 2023-9-20
The error log you posteed contains this: View Error Report
This is a hyperlink that should open a UI window, and at the bottom, there is a "build log" tab. Can you look there, what is the contents?
Andinet
Andinet 2023-9-22
CMake Error at C:/Program Files/MATLAB/R2023b/bin/win64/cmake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) Call Stack (most recent call first): C:/Program Files/MATLAB/R2023b/bin/win64/cmake/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE) C:/Program Files/MATLAB/R2023b/bin/win64/cmake/share/cmake-3.25/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args) CMakeLists.txt:19 (find_package) -- Configuring incomplete, errors occurred!

请先登录,再进行评论。

回答(1 个)

Denis Gurchenkov
Denis Gurchenkov 2023-9-26
Hi Andinet, I suspect there is some kind of cmake configuraiton issue on your system. Google search for "could not find pkgconfig" gives links like this one:

类别

Help CenterFile Exchange 中查找有关 Custom Message Support 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by