CMake Error during ROS2 creating custom msg and srv files tutorial

asked 2023-07-31 16:10:32 -0500

Salc gravatar image

I'm following the ROS2 tutorials, currently on the creating custom msg and srv files. (https://docs.ros.org/en/humble/Tutori...) Currently at step 5, when I run the following command:

colcon build --packages-select tutorial_interfaces

I get the following error message:

Starting >>> tutorial_interfaces --- stderr: tutorial_interfaces 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:

cmake_minimum_required(VERSION 3.8) project(tutorial_interfaces)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) endif()

find dependencies

find_package(ament_cmake REQUIRED)

uncomment the following section in order to fill in

further dependencies manually.

find_package(<dependency> REQUIRED)

find_package(geometry_msgs REQUIRED) find_package(rosidl_default_generators REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}_srv "srv/MySrv.srv" LIBRARY_NAME ${PROECT_NAME}) "msg/Num.msg" "msg/Sphere.msg" "srv/AddThreeInts.srv" DEPENDENCIES geometry_msgs # Add packages that above messages depend on, in this case geometry_msgs for Sphere.msg )

if(BUILD_TESTING) find_package(ament_lint_auto 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(ament_cmake_copyright_FOUND 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(ament_cmake_cpplint_FOUND TRUE) ament_lint_auto_find_test_dependencies() endif()

ament_package()

I have deleted and rebuilt the workspace twice and it has not fixed my issue.

edit retag flag offensive close merge delete