gazebosim / ros_gz

Integration between ROS (1 and 2) and Gazebo simulation
https://gazebosim.org
Apache License 2.0
261 stars 139 forks source link

Not able to build ros_gz_bridge #641

Open shine100 opened 1 week ago

shine100 commented 1 week ago

ROS2 version : humble 1 ros_gz_interfaces/include/ros_gz_interfaces/ros_gz_interfaces/msg/altimeter.hpp:10:10: fatal error: ros_gz_interfaces/msg/detail/altimeter__type_support.hpp: No such file or directory 10 | #include "ros_gz_interfaces/msg/detail/altimeter__type_support.hpp"

2 ros_gz_interfaces/include/ros_gz_interfaces/ros_gz_interfaces/srv/control_world.hpp:10:10: fatal error: ros_gz_interfaces/srv/detail/control_worldtype_support.hpp: No such file or directory 10 | #include "ros_gz_interfaces/srv/detail/control_worldtype_support.hpp"

3 lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.5 LTS Release: 22.04 Codename: jammy

4 git log -1 commit 5cc92f804739b8b72f71aa2551a4be893d74efc0 (HEAD -> humble, tag: 0.244.16, origin/humble) Author: Alejandro Hernández Cordero ahcorde@gmail.com Date: Mon Jul 22 16:50:33 2024 +0200

0.244.16

5 Who can tell me how to avoid the following problems? Thank you

colcon build Starting >>> ros_gz_interfaces Starting >>> ros_gz_sim Finished <<< ros_gz_interfaces [17.1s]
Starting >>> ros_gz_bridge Starting >>> ros_ign_interfaces Finished <<< ros_gz_sim [24.3s]
Starting >>> ros_ign_gazebo Finished <<< ros_ign_gazebo [17.1s]
--- stderr: ros_gz_bridge
In file included from /home/s/ros2_rosgz/src/ros_gz/ros_gz_bridge/src/service_factories/ros_gz_interfaces.cpp:22: /home/s/ros2_rosgz/install/ros_gz_interfaces/include/ros_gz_interfaces/ros_gz_interfaces/srv/control_world.hpp:10:10: fatal error: ros_gz_interfaces/srv/detail/control_world__type_support.hpp: No such file or directory 10 | #include "ros_gz_interfaces/srv/detail/control_worldtype_support.hpp" | ^~~~~~~~~~~~~~ compilation terminated. gmake[2]: [CMakeFiles/ros_gz_bridge.dir/build.make:251: CMakeFiles/ros_gz_bridge.dir/src/service_factories/ros_gz_interfaces.cpp.o] Error 1 gmake[2]: Waiting for unfinished jobs.... In file included from /home/s/ros2_rosgz/src/ros_gz/ros_gz_bridge/test/utils/ros_test_msg.hpp:50, from /home/s/ros2_rosgz/src/ros_gz/ros_gz_bridge/test/utils/ros_test_msg.cpp:15: /home/s/ros2_rosgz/install/ros_gz_interfaces/include/ros_gz_interfaces/ros_gz_interfaces/msg/altimeter.hpp:10:10: fatal error: ros_gz_interfaces/msg/detail/altimeter__type_support.hpp: No such file or directory 10 | #include "ros_gz_interfaces/msg/detail/altimetertype_support.hpp" | ^~~~~~~~~~~~~~ compilation terminated. gmake[2]: [CMakeFiles/test_utils.dir/build.make:90: CMakeFiles/test_utils.dir/test/utils/ros_test_msg.cpp.o] Error 1 gmake[2]: Waiting for unfinished jobs.... gmake[1]: [CMakeFiles/Makefile2:183: CMakeFiles/ros_gz_bridge.dir/all] Error 2 gmake[1]: Waiting for unfinished jobs.... gmake[1]: [CMakeFiles/Makefile2:368: CMakeFiles/test_utils.dir/all] Error 2 gmake: [Makefile:146: all] Error 2

Failed <<< ros_gz_bridge [31.4s, exited with code 2] Aborted <<< ros_ign_interfaces [31.9s]

Summary: 3 packages finished [49.5s] 1 package failed: ros_gz_bridge 1 package aborted: ros_ign_interfaces 1 package had stderr output: ros_gz_bridge 8 packages not processed

Then : colcon build --packages-select ros_gz_interfaces This may be promoted to an error in a future release of colcon-override-check. Starting >>> ros_gz_interfaces Finished <<< ros_gz_interfaces [16.5s]

Summary: 1 package finished [16.9s]

But : colcon build --packages-select ros_gz_bridge 1 ros2_rosgz/install/ros_gz_interfaces/include/ros_gz_interfaces/ros_gz_interfaces/msg/altimeter.hpp:10:10: fatal error: ros_gz_interfaces/msg/detail/altimeter__type_support.hpp: No such file or directory 10 | #include "ros_gz_interfaces/msg/detail/altimeter__type_support.hpp"

2 ros2_rosgz/install/ros_gz_interfaces/include/ros_gz_interfaces/ros_gz_interfaces/srv/control_world.hpp:10:10: fatal error: ros_gz_interfaces/srv/detail/control_worldtype_support.hpp: No such file or directory 10 | #include "ros_gz_interfaces/srv/detail/control_worldtype_support.hpp"

shine100 commented 1 week ago

Summary: 13 packages finished [4min 27s]

Solved it, it was caused by my local package confusion. I reinstalled ros2 and other dependencies, and now the compilation is successful