TixiaoShan / LIO-SAM

LIO-SAM: Tightly-coupled Lidar Inertial Odometry via Smoothing and Mapping
BSD 3-Clause "New" or "Revised" License
3.2k stars 1.21k forks source link

ros2 galactic unknown Cmake command "rosidl_get_typesupport_target" #468

Open 123Bruceche opened 6 months ago

123Bruceche commented 6 months ago

when I colcon build at galactic 20.04 ,I got this mistake. please help

cmake Error Cmakelists.txt 43 (rosidl_get_typesupport_target): Unknown Cmake command rosidl_get_typesupport_target

cyhunblr commented 5 months ago

Did you solve?

godic97 commented 5 months ago

Hi!

I solved this issue. (foxy)

First, there's no rosidl_get_typesupport_target function in foxy. So, visit here, and replace the function to the raw code in CMakeLists.txt . (You should delete PARENT_SCOPE parameter in the code)

Second, in my case, tf2_eigen and tf2_geometry_msgs are .h, not .hpp. So, rewrite lib name in src/include/lio_sam/utility.hpp.

Alexjgxt18 commented 5 months ago

Hi @godic97 , how do you

replace the function to the raw code in CMakeLists.txt .

I just pasted the code from the link, after this line rosidl_generate_interfaces(${PROJECT_NAME} "msg/CloudInfo.msg" "srv/SaveMap.srv" DEPENDENCIES std_msgs sensor_msgs) and got the files name error. Once I made colcon build I got

fatal error: lio_sam/msg/cloud_info.hpp: No such file or directory

    2 | #include "lio_sam/msg/cloud_info.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

So... I think I did something wrong

InguChoi commented 3 months ago

Hi, I solve the issue with reference to @Alexjgxt18. (https://github.com/ros2/rosidl/blob/rolling/rosidl_cmake/cmake/rosidl_get_typesupport_target.cmake)

image

image

tang-nhan commented 2 months ago

Hi @godic97 , how do you

replace the function to the raw code in CMakeLists.txt .

I just pasted the code from the link, after this line rosidl_generate_interfaces(${PROJECT_NAME} "msg/CloudInfo.msg" "srv/SaveMap.srv" DEPENDENCIES std_msgs sensor_msgs) and got the files name error. Once I made colcon build I got

fatal error: lio_sam/msg/cloud_info.hpp: No such file or directory

    2 | #include "lio_sam/msg/cloud_info.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

So... I think I did something wrong

Hi @Alexjgxt18, I also met this issue. Have you solved it?