How to fix gazebo_ros building error?

asked 2022-03-07 02:24:33 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hello, I've been trying to setup the Turtlebot3 simulation using the e-manual for several days now, but I'm still running into the same problem over and over again. I am using Ubuntu 20.04 and ROS2 Foxy. Following the instruction of the manual made me install Gazebo for ROS using the debian package:

sudo apt-get install ros-foxy-gazebo-*

After i follow the manual for the installation of the simulation I run into the following error when building the workspace:

CMake Error at CMakeLists.txt:19 (find_package): By not providing "Findgazebo_ros_pkgs.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by
"gazebo_ros_pkgs", but CMake did not find one.

Could not find a package configuration file provided by "gazebo_ros_pkgs" with any of the following names:


Add the installation prefix of "gazebo_ros_pkgs" to CMAKE_PREFIX_PATH or set "gazebo_ros_pkgs_DIR" to a directory containing one of the above files. If "gazebo_ros_pkgs" provides a separate development package or SDK, be sure it has been installed.

--- Failed <<< turtlebot3_gazebo [ Exited with code 1 ]

Summary: 12 packages finished [9.23s] 1 package failed: turtlebot3_gazebo
1 package had stderr output: turtlebot3_gazebo 1 package not processed

Browsing through the forums for answers I found out that installing the gazebo_ros packages would help. so i did that following these instructions which make me run into the following problem while building:

CMake Error in CMakeLists.txt: Imported target "dart" includes non-existent path


in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:

  • The path was deleted, renamed, or moved to another location.

  • An install or uninstall procedure did not complete successfully.

  • The installation package was faulty and references files it does not provide.

CMake Generate step failed. Build files cannot be regenerated correctly.

Failed <<< gazebo_ros [30.4s, exited with code 1]

Summary: 9 packages finished [41.5s] 1 package failed: gazebo_ros 1 package had stderr output: gazebo_ros 2 packages not processed

Does anyone know how to fix this? Sicerly Niklas

edit retag flag offensive close merge delete