CMake Error during ROS2 creating custom msg and srv files tutorial
I'm following the ROS2 tutorials, currently on the creating custom msg and srv files. (https://docs.ros.org/en/humble/Tutorials/Beginner-Client-Libraries/Custom-ROS2-Interfaces.html#build-the-tutorial-interfaces-package) Currently at step 5, when I run the following command:
colcon build --packages-select tutorial_interfaces
I get the following error message:
Starting >>> tutorialinterfaces --- stderr: tutorialinterfaces CMake Error at CMakeLists.txt:18: Parse error. Expected a command name, got quoted argument with text "msg/Num.msg".
Failed <<< tutorial_interfaces [0.02s, exited with code 1]
I'm using Ros2 Humble, Ubuntu 22.04.2 with kernel: 5.10.16.3-microsoft-standard-WSL2, CMake version 3.22.1 on Windows 10.
Here is the CMakeLists.txt file I'm working with:
cmakeminimumrequired(VERSION 3.8) project(tutorial_interfaces)
if(CMAKECOMPILERISGNUCXX OR CMAKECXXCOMPILERID MATCHES "Clang") addcompileoptions(-Wall -Wextra -Wpedantic) endif()
find dependencies
findpackage(amentcmake REQUIRED)
uncomment the following section in order to fill in
further dependencies manually.
find_package( REQUIRED)
findpackage(geometrymsgs REQUIRED) findpackage(rosidldefault_generators REQUIRED)
rosidlgenerateinterfaces(${PROJECTNAME}srv "srv/MySrv.srv" LIBRARYNAME ${PROECTNAME}) "msg/Num.msg" "msg/Sphere.msg" "srv/AddThreeInts.srv" DEPENDENCIES geometrymsgs # Add packages that above messages depend on, in this case geometrymsgs for Sphere.msg )
if(BUILDTESTING) findpackage(amentlintauto REQUIRED) # the following line skips the linter which checks for copyrights # comment the line when a copyright and license is added to all source files set(amentcmakecopyrightFOUND TRUE) # the following line skips cpplint (only works in a git repo) # comment the line when this package is in a git repo and when # a copyright and license is added to all source files set(amentcmakecpplintFOUND TRUE) amentlintautofindtest_dependencies() endif()
ament_package()
I have deleted and rebuilt the workspace twice and it has not fixed my issue.
Asked by Salc on 2023-07-31 16:10:32 UTC
Comments