ROS2/Jammy/Humble plugin compilation error: fatal error: gazebo_ros/node.hpp: No such file or directory

asked 2023-04-15 09:57:31 -0500

askesis gravatar image

I have a plugin project that compiles OK on ROS2/Focal/Foxy in a Docker container.

After upgrading the Docker container to ROS2/Jammy/Humble the compilation fails with "fatal error: gazebo_ros/node.hpp: No such file or directory". For the full compilation output: see below. However "gazebo_ros/node.hpp" is on the disk: see the output of "locate gazebo_ros/node.hpp" below.

I suspect that I am missing a cmake-related package or that there is a bug in an installed cmake-related package. I have installed ros-humble-desktop, ros-humble-ros-gz and ros-humble-gazebo-ros-pkgs.

Does anyone have any idea? Do I need to provide more information? If so, what?

TIA

Joost

Compilation and locate output:

user@7bff3c3fced1:/data/workspace$ colcon build --base-path src --packages-select ros_gazebo_demo Starting >>> ros_gazebo_demo --- stderr: ros_gazebo_demo
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions.

CMake Warning (dev) at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message): The package name passed to find_package_handle_standard_args (PkgConfig) does not match the name of the calling package (gazebo). This can lead to problems in calling code that expects find_package result variables (e.g., _FOUND) to follow a certain pattern. Call Stack (most recent call first): /usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args) /usr/lib/x86_64-linux-gnu/cmake/gazebo/gazebo-config.cmake:72 (include) CMakeLists.txt:11 (find_package) This warning is for project developers. Use -Wno-dev to suppress it.

CMake Deprecation Warning at /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_target_interfaces.cmake:32 (message): Use rosidl_get_typesupport_target() and target_link_libraries() instead of rosidl_target_interfaces() Call Stack (most recent call first): CMakeLists.txt:35 (rosidl_target_interfaces)

CMake Deprecation Warning at /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_target_interfaces.cmake:32 (message): Use rosidl_get_typesupport_target() and target_link_libraries() instead of rosidl_target_interfaces() Call Stack (most recent call first): CMakeLists.txt:44 (rosidl_target_interfaces)

In file included from /data/workspace/src/ros_gazebo_demo/src/cube_low_level.cpp:3: /data/workspace/src/ros_gazebo_demo/include/cube_low_level.hpp:10:10: fatal error: gazebo_ros/node.hpp: No such file or directory 10 | #include <gazebo_ros node.hpp=""> | ^~~~~~~~~~~~~~~~~~~~~ compilation terminated. gmake[2]: * [CMakeFiles/cube_low_level.dir/build.make:76: CMakeFiles/cube_low_level.dir/src/cube_low_level.cpp.o] Error 1 gmake[1]: [CMakeFiles/Makefile2:596: CMakeFiles/cube_low_level.dir/all] Error 2 gmake[1]: ** Waiting for unfinished jobs....

gmake: * [Makefile:146: all] Error 2

Failed <<< ros_gazebo_demo [7.44s, exited with code 2]

Summary: 0 packages finished [7.61s] 1 package failed: ros_gazebo_demo 1 package had stderr output: ros_gazebo_demo

user@7bff3c3fced1:/data/workspace$ locate gazebo_ros/node.hpp /opt/ros/humble/include/gazebo_ros/node.hpp

edit retag flag offensive close merge delete