rtabmap_ros icon indicating copy to clipboard operation
rtabmap_ros copied to clipboard

build error with save_objects_example on ros2

Open takahiko-hasegawa-hdjp opened this issue 2 years ago • 3 comments

Im trying to use svae_objects_example and then I have an error when i try to do a build.

ament_target_dependencies() the passed package name 'rtabmap_common' was not found before Call Stack (most recent call first): CMakeLists.txt:481 (ament_target_dependencies)

what is the problem?

also, I want to use april_tags. tried installing the following and tried colcon build (ros2 humble)

  • https://github.com/christianrauch/apriltag_ros
  • https://github.com/christianrauch/apriltag_msgs
  • https://github.com/AprilRobotics/apriltag

but got the following build error

image

any ideas?

takahiko-hasegawa-hdjp avatar Dec 15 '23 02:12 takahiko-hasegawa-hdjp

Which version are you using? apriltag_ros should be apriltag_msgs: https://github.com/introlab/rtabmap_ros/blob/e2b70a6707f0fc5002622cc0d581b7c9204b2a3a/rtabmap_slam/src/CoreWrapper.cpp#L828

It has been updated in this commit: https://github.com/introlab/rtabmap_ros/commit/96e8f0e2232028a4e70e4c8deab0fcb2c4566d97

matlabbe avatar Dec 16 '23 21:12 matlabbe

Thanks for that! now the apriltags msg error is solved but another problem.

the version of save_object_tags.py that I have seems to use ROS1 interface as it says ROSPY.

As im using ROS2 interface, is there a ros2 version?

and for some reason the following does not work.

seems like ros2 run rtabmap_ros save_objects_example does not work. save_objects_example executable is found.

but I do have the following in the cmakelists.txt; IF(find_object_2d_FOUND) MESSAGE(STATUS "WITH find_object_2d") include_directories(${find_object_2d_INCLUDE_DIRS}) add_executable(rtabmap_save_objects_example src/SaveObjectsExample.cpp) ament_target_dependencies(rtabmap_save_objects_example ) set_target_properties(rtabmap_save_objects_example PROPERTIES OUTPUT_NAME "save_objects_example") ENDIF(find_object_2d_FOUND)

takahiko-hasegawa-hdjp avatar Dec 19 '23 00:12 takahiko-hasegawa-hdjp

Where is that python script? Converting from rospy to rclpy is not too hard, look at this page https://docs.ros.org/en/rolling/How-To-Guides/Migrating-from-ROS1/Migrating-Python-Packages.html

For the c++, that node had not been ported to ros2: https://github.com/introlab/rtabmap_ros/blob/master/rtabmap_demos/src/SaveObjectsExample.cpp, here is the cpp migration guide: https://docs.ros.org/en/foxy/The-ROS2-Project/Contributing/Migration-Guide.html

matlabbe avatar Dec 23 '23 20:12 matlabbe