ros2 / geometry2

A set of ROS packages for keeping track of coordinate transforms.
BSD 3-Clause "New" or "Revised" License
119 stars 195 forks source link

Can't build tf2_geometry_msgs: "fatal error: kdl/frames.hpp: No such file or directory" #519

Closed Kaju-Bubanja closed 2 years ago

Kaju-Bubanja commented 2 years ago

Bug report

Required Info:

Steps to reproduce issue

Trying to build tf2_geometry_msgs leads to following error

colcon build --symlink-install --packages-up-to tf2_geometry_msgs
Starting >>> ament_package
Starting >>> ament_lint
Starting >>> ament_cppcheck
Starting >>> gtest_vendor
Starting >>> fastcdr
Starting >>> osrf_testing_tools_cpp
Starting >>> google_benchmark_vendor
Starting >>> osrf_pycommon
Finished <<< fastcdr [0.71s]                                                                                                                                                                                      
Starting >>> ament_pycodestyle
Finished <<< google_benchmark_vendor [0.78s]                                                                                                                                    
Finished <<< gtest_vendor [0.97s]                                                                                                                                                                      
Starting >>> gmock_vendor                                                                                                                                                                       
Finished <<< osrf_testing_tools_cpp [1.05s]
Finished <<< gmock_vendor [0.17s]                                                                                                                                                     
Finished <<< ament_package [1.34s]                                                                                                                      
Starting >>> ament_cmake_core
Finished <<< osrf_pycommon [1.35s]
Finished <<< ament_lint [1.37s]
Starting >>> ament_flake8
Finished <<< ament_cppcheck [1.38s]                                                                                                         
Finished <<< ament_cmake_core [0.25s]                                                                                 
Starting >>> ament_cmake_libraries
Starting >>> ament_cmake_export_libraries
Starting >>> ament_cmake_python
Starting >>> ament_cmake_include_directories
Starting >>> ament_cmake_export_definitions
Starting >>> ament_cmake_export_include_directories
Finished <<< ament_pycodestyle [0.95s]
Starting >>> ament_cmake_export_link_flags                                                                                                                                       
Finished <<< ament_cmake_libraries [0.20s]                                                                                                                                             
Starting >>> ament_cmake_export_dependencies
Finished <<< ament_cmake_python [0.23s]
Finished <<< ament_cmake_include_directories [0.23s]
Starting >>> ament_cmake_test
Finished <<< ament_cmake_export_definitions [0.24s]
Starting >>> ament_cmake_version
Starting >>> ament_cmake_target_dependencies
Finished <<< ament_cmake_export_libraries [0.28s]
Finished <<< ament_cmake_export_include_directories [0.26s]
Starting >>> ament_cmake_export_targets                                                                                                                                               
Starting >>> ament_cmake_export_interfaces
Finished <<< ament_cmake_export_link_flags [0.24s]
Starting >>> test_interface_files
Finished <<< ament_cmake_export_dependencies [0.25s]                                                                                                                                
Finished <<< ament_cmake_version [0.21s]
Finished <<< ament_cmake_target_dependencies [0.21s]
Finished <<< ament_cmake_export_targets [0.23s]                                                                                                                                          
Finished <<< ament_cmake_export_interfaces [0.23s]
Finished <<< test_interface_files [0.19s]
Finished <<< ament_flake8 [0.86s]                                                           
Starting >>> ament_pep257
Finished <<< ament_cmake_test [0.40s]
Starting >>> ament_cmake_gtest
Starting >>> ament_lint_auto
Starting >>> ament_cmake_pytest
Starting >>> ament_cmake_google_benchmark
Finished <<< ament_cmake_gtest [0.27s]                                                                                                                                                                        
Starting >>> ament_cmake_gen_version_h
Starting >>> ament_cmake_gmock
Finished <<< ament_lint_auto [0.29s]
Finished <<< ament_cmake_pytest [0.31s]
Finished <<< ament_cmake_gmock [0.12s]                                                                                                                                          
Finished <<< ament_cmake_gen_version_h [0.19s]                                                                                                   
Starting >>> ament_cmake
Finished <<< ament_cmake_google_benchmark [0.51s]
Finished <<< ament_cmake [0.10s]                                                       
Starting >>> uncrustify_vendor
Starting >>> pybind11_vendor
Finished <<< uncrustify_vendor [0.13s]                                                                                           
Finished <<< pybind11_vendor [0.13s]
Finished <<< ament_pep257 [0.85s]             
Starting >>> ament_copyright
Finished <<< ament_copyright [0.79s]             
Starting >>> ament_lint_cmake
Starting >>> ament_xmllint
Starting >>> ament_cpplint
Starting >>> ament_uncrustify                                                                               
Starting >>> domain_coordinator
Starting >>> ament_index_python
Finished <<< ament_lint_cmake [1.71s]                                                                                                                                                         
Starting >>> ament_cmake_lint_cmake
Finished <<< ament_xmllint [1.72s]                                                                                                                                                                  
Finished <<< ament_cpplint [1.72s]
Starting >>> rosidl_cli
Starting >>> rpyutils
Finished <<< ament_uncrustify [1.74s]
Finished <<< ament_index_python [1.73s]
Finished <<< domain_coordinator [1.74s]
Starting >>> launch
Finished <<< ament_cmake_lint_cmake [0.60s]                                                                                     
Starting >>> ament_cmake_copyright
Finished <<< ament_cmake_copyright [0.10s]                                                                                     
Starting >>> ament_cmake_xmllint
Starting >>> ament_cmake_cppcheck
Starting >>> ament_cmake_cpplint
Starting >>> ament_cmake_uncrustify                                                                                                                                               
Starting >>> ament_cmake_flake8
Finished <<< ament_cmake_cppcheck [0.18s]                                                                                                                                                                   
Starting >>> ament_cmake_pep257
Finished <<< ament_cmake_cpplint [0.22s]                                                                                                                                                                        
Finished <<< ament_cmake_uncrustify [0.23s]
Finished <<< ament_cmake_xmllint [0.26s]
Starting >>> foonathan_memory_vendor
Finished <<< ament_cmake_flake8 [0.26s]
Finished <<< ament_cmake_pep257 [0.20s]                                                                                                                            
Starting >>> ament_lint_common
Finished <<< foonathan_memory_vendor [0.17s]                                                                                                                        
Starting >>> fastrtps
Finished <<< ament_lint_common [0.14s]                                                                                                               
Starting >>> ament_cmake_ros
Starting >>> rosidl_typesupport_interface
Starting >>> fastrtps_cmake_module
Starting >>> python_cmake_module
Finished <<< rosidl_cli [1.26s]
Finished <<< rpyutils [1.26s]
Starting >>> rosidl_adapter
Starting >>> rti_connext_dds_cmake_module
Finished <<< launch [1.25s]
Starting >>> performance_test_fixture
Finished <<< ament_cmake_ros [0.27s]                                                                                                                                                       
Starting >>> tracetools
Finished <<< fastrtps_cmake_module [0.27s]
Starting >>> ament_index_cpp                                                                                                                                                          
Finished <<< python_cmake_module [0.28s]
Finished <<< rti_connext_dds_cmake_module [0.24s]
Starting >>> rmw_implementation_cmake
Starting >>> spdlog_vendor
Finished <<< rosidl_typesupport_interface [0.39s]                                                                                                                                                           
Starting >>> mimick_vendor
Finished <<< fastrtps [0.50s]
Starting >>> launch_xml
Finished <<< performance_test_fixture [0.35s]
Starting >>> console_bridge_vendor
Finished <<< tracetools [0.49s]                                                                                                                                                                               
Finished <<< spdlog_vendor [0.44s]
Starting >>> launch_yaml
Finished <<< ament_index_cpp [0.48s]
Finished <<< rmw_implementation_cmake [0.46s]
Finished <<< mimick_vendor [0.39s]
Finished <<< rosidl_adapter [0.73s]
Starting >>> rosidl_parser
Finished <<< console_bridge_vendor [0.57s]                                                                                                       
Finished <<< launch_xml [0.92s]                                                                             
Finished <<< rosidl_parser [0.55s]
Starting >>> rosidl_cmake
Finished <<< launch_yaml [0.91s]                                                     
Starting >>> launch_testing
Finished <<< rosidl_cmake [0.53s]                                                         
Finished <<< launch_testing [0.87s]              
Starting >>> launch_testing_ament_cmake
Finished <<< launch_testing_ament_cmake [0.10s]                    
Starting >>> rcutils
Finished <<< rcutils [0.64s]                         
Starting >>> rosidl_runtime_c
Starting >>> rcpputils
Finished <<< rosidl_runtime_c [0.22s]                                                                 
Starting >>> rosidl_runtime_cpp
Starting >>> rmw
Starting >>> rosidl_generator_c
Starting >>> rosidl_typesupport_introspection_c
Finished <<< rcpputils [0.31s]                                                                                                                                                                         
Starting >>> rcl_logging_interface
Starting >>> libyaml_vendor
Starting >>> class_loader
Finished <<< rosidl_runtime_cpp [0.28s]                                                                                                                                                        
Finished <<< rmw [0.44s]                                                                                                                                                                            
Finished <<< rcl_logging_interface [0.35s]
Starting >>> rcl_logging_noop
Starting >>> rcl_logging_spdlog
Finished <<< libyaml_vendor [0.36s]
Starting >>> rcl_yaml_param_parser
Finished <<< class_loader [0.42s]                                                                                                                                                           
Finished <<< rosidl_typesupport_introspection_c [0.61s]                                                                                                                                                     
Starting >>> rosidl_typesupport_introspection_cpp
Finished <<< rosidl_generator_c [0.65s]
Starting >>> rosidl_generator_cpp
Finished <<< rcl_logging_noop [0.23s]
Finished <<< rcl_logging_spdlog [0.28s]                                                                                                                                                              
Finished <<< rcl_yaml_param_parser [0.31s]                                                                                                                                   
Finished <<< rosidl_typesupport_introspection_cpp [0.46s]                                                                              
Finished <<< rosidl_generator_cpp [0.45s]
Starting >>> rosidl_typesupport_fastrtps_cpp
Finished <<< rosidl_typesupport_fastrtps_cpp [0.46s]                         
Starting >>> rosidl_typesupport_fastrtps_c
Finished <<< rosidl_typesupport_fastrtps_c [0.47s]                         
Starting >>> rosidl_typesupport_c
Finished <<< rosidl_typesupport_c [0.49s]                         
Starting >>> rosidl_generator_py
Starting >>> rosidl_typesupport_cpp
Finished <<< rosidl_typesupport_cpp [0.52s]                                                                             
Finished <<< rosidl_generator_py [0.62s]                      
Starting >>> rosidl_default_runtime
Starting >>> rosidl_default_generators
Finished <<< rosidl_default_runtime [0.16s]                                                                             
Finished <<< rosidl_default_generators [0.16s]
Starting >>> builtin_interfaces
Starting >>> rmw_dds_common
Starting >>> unique_identifier_msgs
Starting >>> lifecycle_msgs
Finished <<< builtin_interfaces [0.65s]                                                                                                                                                      
Starting >>> rcl_interfaces
Starting >>> std_msgs
Starting >>> rosgraph_msgs
Starting >>> statistics_msgs
Finished <<< unique_identifier_msgs [0.71s]                                                                                                                                                                       
Starting >>> action_msgs
Finished <<< rmw_dds_common [0.78s]                                                                                                                                                          
Starting >>> rmw_connextdds_common
Starting >>> rmw_fastrtps_shared_cpp
Finished <<< lifecycle_msgs [1.03s]                                                                                                                                                                         
Finished <<< rmw_connextdds_common [0.52s]                                                                                                                                                                     
Starting >>> rmw_connextdds
Starting >>> rmw_connextddsmicro
Finished <<< rosgraph_msgs [0.94s]                                                                                                                                                                              
Finished <<< statistics_msgs [0.96s]
Finished <<< rmw_connextddsmicro [0.33s]
Finished <<< rmw_connextdds [0.37s]
Finished <<< rmw_fastrtps_shared_cpp [0.89s]                                                                                                                          
Finished <<< action_msgs [1.01s]
Starting >>> test_msgs
Finished <<< rcl_interfaces [1.17s]                                                                                
Starting >>> composition_interfaces
Finished <<< std_msgs [1.48s]                                                                                                           
Starting >>> geometry_msgs
Finished <<< composition_interfaces [0.66s]                                                                                                     
Finished <<< test_msgs [0.92s]                                                                     
Starting >>> rmw_fastrtps_cpp
Starting >>> rmw_fastrtps_dynamic_cpp
Finished <<< rmw_fastrtps_cpp [0.34s]                                                                                                                  
Finished <<< rmw_fastrtps_dynamic_cpp [0.36s]
Starting >>> rmw_implementation
Finished <<< geometry_msgs [1.04s]                                                               
Starting >>> tf2
Starting >>> sensor_msgs                                                                  
Starting >>> tf2_msgs
Finished <<< rmw_implementation [0.27s]                                                                                                         
Starting >>> rcl
Finished <<< tf2 [0.31s]                                                                                                              
Finished <<< tf2_msgs [0.77s]                                                                                             
Finished <<< rcl [0.90s]                                                                     
Starting >>> libstatistics_collector
Starting >>> rcl_action                                                                             
Starting >>> rcl_lifecycle
Finished <<< rcl_lifecycle [0.37s]                                                                                                                                            
Finished <<< sensor_msgs [1.41s]                                                                                                           
Finished <<< rcl_action [0.42s]
Starting >>> rclpy
Finished <<< libstatistics_collector [0.52s]                                                  
Starting >>> rclcpp
Finished <<< rclpy [0.79s]                                                                
Starting >>> tf2_py
Finished <<< rclcpp [1.21s]                                                              
Starting >>> rclcpp_action
Starting >>> rclcpp_components
Starting >>> rclcpp_lifecycle
Finished <<< tf2_py [0.79s]                                                                                                                                             
Starting >>> tf2_ros_py
Finished <<< rclcpp_components [0.44s]                                                                                                                              
Finished <<< rclcpp_action [0.46s]
Finished <<< rclcpp_lifecycle [0.69s]                                                       
Starting >>> message_filters
Finished <<< message_filters [0.61s]                                                          
Starting >>> tf2_ros
Finished <<< tf2_ros_py [1.23s]                                                  
Finished <<< tf2_ros [0.45s]                          
Starting >>> tf2_geometry_msgs
--- stderr: tf2_geometry_msgs                                  
In file included from /home/user/ros2_rolling/src/ros2/geometry2/tf2_geometry_msgs/test/test_tf2_geometry_msgs.cpp:45:
/home/user/ros2_rolling/src/ros2/geometry2/tf2_geometry_msgs/include/tf2_geometry_msgs/tf2_geometry_msgs.hpp:51:10: fatal error: kdl/frames.hpp: No such file or directory
   51 | #include "kdl/frames.hpp"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/test_tf2_geometry_msgs.dir/build.make:63: CMakeFiles/test_tf2_geometry_msgs.dir/test/test_tf2_geometry_msgs.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:184: CMakeFiles/test_tf2_geometry_msgs.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:141: all] Error 2
---
Failed   <<< tf2_geometry_msgs [0.52s, exited with code 2]

Summary: 133 packages finished [23.0s]
  1 package failed: tf2_geometry_msgs
  1 package had stderr output: tf2_geometry_msgs

Expected behavior

No compilation error

Actual behavior

See error above

Additional information

clalancette commented 2 years ago

It looks like you are probably missing orocos_kdl_vendor from your installation, which tf2_geometry_msgs requires. I would suggest doing the following in the root of your workspace:

$ rm -f ros2.repos
$ wget https://raw.githubusercontent.com/ros2/ros2/master/ros2.repos
$ vcs import src < ros2.repos
$ vcs pull src

And then run your compile again.

Kaju-Bubanja commented 2 years ago

That didn't really fix it, I didn't have the package, then I cloned it and built it all without problems, but I still get the same error when building tf2_geometry_msgs, I tried to source the workspace to be save but that didn't help either. Also I feel like the workflow with sourcing after building changed. Because now I get a bunch of overlay warnings, they were never a problem and the topic seems to be quite complex, but that's just a side info

Kaju-Bubanja commented 2 years ago

What seems odd to me is that in the package.xml it says <depend>orocos_kdl_vendor</depend> but in the CMakeLists.txt it says find_package(orocos_kdl REQUIRED) usually these two names are the same. Is that deliberate here?

clalancette commented 2 years ago

What seems odd to me is that in the package.xml it says <depend>orocos_kdl_vendor</depend> but in the CMakeLists.txt it says find_package(orocos_kdl REQUIRED) usually these two names are the same. Is that deliberate here?

Yes, that's the way it is supposed to be here.

I'll suggest completely cleaning the workspace (remove the build, install, and log directories), and then try building again.

Kaju-Bubanja commented 2 years ago

Thank you, getting the missing package and installing from a clean workspace fixed the issue