Error in ros2genmsg (line 467) buildPackage(builder, [], ' --merge-install', colconMakeArgs);

13 vues (au cours des 30 derniers jours)
I received this error when using the ros2genmsg function (the image shows the structure of the folder containing the action interface, I was currently in the folder "ros2CustomMessages":
>> ros2genmsg(pwd)
Identifying message files in folder 'C:/Studium/TUM/Master/2. Semester/MTT Tutor/ROS2Interface/ros2CustomMessages'..Validating message files in folder 'C:/Studium/TUM/Master/2. Semester/MTT Tutor/ROS2Interface/ros2CustomMessages'..Done.
Done.
[1/1] Generating MATLAB interfaces for custom message packages... Done.
Running colcon build in folder 'C:/Studium/TUM/Master/2. Semester/MTT Tutor/ROS2Interface/ros2CustomMessages/matlab_msg_gen/win64'.
Build in progress. This may take several minutes...Error using ros.internal.ROSProjectBuilder/buildPackage
Error building package: build_log.
Error in ros2genmsg (line 467)
buildPackage(builder, [], ' --merge-install', colconMakeArgs);
The build_log said the following:
Traceback (most recent call last): File "C:/Program Files/MATLAB/R2023b/sys/ros2/win64/ros2/share/ament_cmake_core/cmake/core/package_xml_2_cmake.py", line 150, in <module> main() File "C:/Program Files/MATLAB/R2023b/sys/ros2/win64/ros2/share/ament_cmake_core/cmake/core/package_xml_2_cmake.py", line 53, in main raise e File "C:/Program Files/MATLAB/R2023b/sys/ros2/win64/ros2/share/ament_cmake_core/cmake/core/package_xml_2_cmake.py", line 49, in main package = parse_package_string( ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\paqua\AppData\Roaming\MathWorks\MATLAB\R2023b\ros2\win64\venv\lib\site-packages\catkin_pkg\package.py", line 788, in parse_package_string pkg.validate(warnings=warnings) File "C:\Users\paqua\AppData\Roaming\MathWorks\MATLAB\R2023b\ros2\win64\venv\lib\site-packages\catkin_pkg\package.py", line 330, in validate raise InvalidPackage('\n'.join(errors), self.filename) catkin_pkg.package.InvalidPackage: Error(s) in package 'C:/Studium/TUM/Master/2. Semester/MTT Tutor/ROS2Interface/ros2CustomMessages/matlab_msg_gen/win64/src/action_msgs/package.xml': The package "action_msgs" must not "build_depend" on a package with the same name as this package The package "action_msgs" must not "build_export_depend" on a package with the same name as this package The package "action_msgs" must not "exec_depend" on a package with the same name as this package

Réponse acceptée

Josh Chen
Josh Chen le 9 Mar 2024
Hi Quan,
As the build log message mentioned, the culprit is that the package name of your custom message is "action_msgs", which is exactly the same as one of the ROS(2) Package that any custom message generation for action requires (See this page for the "action_msgs" package). Hence, during the code generation process, CMake got confused.
To address this issue, please rename your package to another name.
e.g. change the folder "action_msgs" to "my_action_msgs".
Hope this helps,
Thanks,
Josh

Plus de réponses (0)

Catégories

En savoir plus sur Custom Message Support dans Help Center et File Exchange

Tags

Produits


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by