package franka_semantic_components and franka_robot_state_broadcaster build failed from source with humble version
-
OS Version: Ubuntu 22.04
-
ROS Version: Humble
-
github branch: humble
When I build this reposity from source, some errors occurred.
Firstly, I used source package/install/local_setup.bash to set up all needed package.
Then I used colcon build to build this project.
Here is the output about franka_semantic_components:
--- stderr: franka_semantic_components
In file included from /home/qiguanxiao/ws/ws_franka_ros2/src/franka_ros2/franka_semantic_components/src/franka_semantic_component_interface.cpp:18:
/home/qiguanxiao/ws/ws_franka_ros2/src/franka_ros2/franka_semantic_components/include/franka_semantic_components/franka_semantic_component_interface.hpp:23:10: fatal error: controller_interface/helpers.hpp: No such file or directory
23 | #include "controller_interface/helpers.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/franka_semantic_components.dir/build.make:132: CMakeFiles/franka_semantic_components.dir/src/franka_semantic_component_interface.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /home/qiguanxiao/ws/ws_franka_ros2/src/franka_ros2/franka_semantic_components/include/franka_semantic_components/franka_cartesian_velocity_interface.hpp:19,
from /home/qiguanxiao/ws/ws_franka_ros2/src/franka_ros2/franka_semantic_components/src/franka_cartesian_velocity_interface.cpp:15:
/home/qiguanxiao/ws/ws_franka_ros2/src/franka_ros2/franka_semantic_components/include/franka_semantic_components/franka_semantic_component_interface.hpp:23:10: fatal error: controller_interface/helpers.hpp: No such file or directory
23 | #include "controller_interface/helpers.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/franka_semantic_components.dir/build.make:104: CMakeFiles/franka_semantic_components.dir/src/franka_cartesian_velocity_interface.cpp.o] Error 1
In file included from /home/qiguanxiao/ws/ws_franka_ros2/src/franka_ros2/franka_semantic_components/src/franka_robot_model.cpp:15:
/home/qiguanxiao/ws/ws_franka_ros2/src/franka_ros2/franka_semantic_components/include/franka_semantic_components/franka_robot_model.hpp:25:10: fatal error: semantic_components/semantic_component_interface.hpp: No such file or directory
25 | #include "semantic_components/semantic_component_interface.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/franka_semantic_components.dir/build.make:90: CMakeFiles/franka_semantic_components.dir/src/franka_robot_model.cpp.o] Error 1
In file included from /home/qiguanxiao/ws/ws_franka_ros2/src/franka_ros2/franka_semantic_components/src/franka_robot_state.cpp:15:
/home/qiguanxiao/ws/ws_franka_ros2/src/franka_ros2/franka_semantic_components/include/franka_semantic_components/franka_robot_state.hpp:25:10: fatal error: semantic_components/semantic_component_interface.hpp: No such file or directory
25 | #include "semantic_components/semantic_component_interface.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/franka_semantic_components.dir/build.make:76: CMakeFiles/franka_semantic_components.dir/src/franka_robot_state.cpp.o] Error 1
In file included from /home/qiguanxiao/ws/ws_franka_ros2/src/franka_ros2/franka_semantic_components/include/franka_semantic_components/franka_cartesian_pose_interface.hpp:24,
from /home/qiguanxiao/ws/ws_franka_ros2/src/franka_ros2/franka_semantic_components/src/franka_cartesian_pose_interface.cpp:15:
/home/qiguanxiao/ws/ws_franka_ros2/src/franka_ros2/franka_semantic_components/include/franka_semantic_components/franka_semantic_component_interface.hpp:23:10: fatal error: controller_interface/helpers.hpp: No such file or directory
23 | #include "controller_interface/helpers.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/franka_semantic_components.dir/build.make:118: CMakeFiles/franka_semantic_components.dir/src/franka_cartesian_pose_interface.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:184: CMakeFiles/franka_semantic_components.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed <<< franka_semantic_components [13.5s, exited with code 2]
I checked that the missed files are in their right install path. And I had set those packages correctly.
Then I found the package.xml file in franka_semantic_components maybe is not right. It misses the controller_interface dependency which is set in the CMakeLists.txt. So I added the dependency in package.xml and CMakeLists.txt. Then the franka_semantic_components package can be built correctly.
Here is my modified file content:
- franka_semantic_components/package.xml
<depend>rclcpp</depend>
<depend>franka_msgs</depend>
<depend>sensor_msgs</depend>
<depend>geometry_msgs</depend>
<depend>hardware_interface</depend>
<depend>controller_interface</depend> # add
<depend>franka_hardware</depend>
- franka_semantic_components/CMakeLists.txt
set(THIS_PACKAGE_INCLUDE_DEPENDS
Franka
franka_hardware
franka_msgs
geometry_msgs
sensor_msgs
hardware_interface
controller_interface # add
rclcpp_lifecycle
urdf)
Then here is the output about franka_robot_state_broadcaster:
--- stderr: franka_robot_state_broadcaster
/home/qiguanxiao/ws/ws_franka_ros2/src/franka_ros2/franka_robot_state_broadcaster/test/test_franka_robot_state_broadcaster.cpp:23:10: fatal error: ros2_control_test_assets/descriptions.hpp: No such file or directory
23 | #include "ros2_control_test_assets/descriptions.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/franka_robot_state_broadcaster_test.dir/build.make:76: CMakeFiles/franka_robot_state_broadcaster_test.dir/test/test_franka_robot_state_broadcaster.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:234: CMakeFiles/franka_robot_state_broadcaster_test.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2
---
Failed <<< franka_robot_state_broadcaster [16.9s, exited with code 2]
In the CMakeLists.txt of franka_robot_state_broadcaster, I found that the dependency ros2_control_test_assets is only set in the test stage. But the error seems like it is also needed in the build stage. So I modified the CMakeLists.txt and then it can be build correctly.
- franka_robot_state_broadcaster/CMakeLists.txt
set(THIS_PACKAGE_INCLUDE_DEPENDS
builtin_interfaces
control_msgs
controller_interface
controller_manager
ros2_control_test_assets # add
franka_msgs
franka_semantic_components
generate_parameter_library
pluginlib
rclcpp_lifecycle
rcutils
realtime_tools
sensor_msgs
visualization_msgs)
After these modifications, this project can be built correctly in humble version.
I'm now seeing the same issue on several PCs after updating ROS packages with sudo apt update && sudo apt upgrade. Seemingly there's some change to the header structure that causes this, but I wouldn't know what it is, quite strange. This fix works, but makes building docker images pretty cumbersome at the moment.
I had the same problem since i tried to rebuild my docker image today, your tips fixed my problems, thanks!