Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ROS 2] Use octomap target directly #150

Closed
wants to merge 1 commit into from

Conversation

sloretz
Copy link

@sloretz sloretz commented Jun 8, 2020

This fixes a compile error from missing include directories when building both geometry_shapes and octomap in the same workspace.

--- stderr: geometric_shapes                                                                                                                
/home/sloretz/ws/sdfurdf/src/geometric_shapes/src/shapes.cpp:39:10: fatal error: octomap/octomap.h: No such file or directory
   39 | #include <octomap/octomap.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/geometric_shapes.dir/build.make:154: CMakeFiles/geometric_shapes.dir/src/shapes.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:127: CMakeFiles/geometric_shapes.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed   <<< geometric_shapes	[ Exited with code 2 ]

The problem comes from octomap exporting variables beginning with all uppercase OCTOMAP_ when the CMake package is found using lowercase octomap. This prevents ament_target_dependencies from adding those variables to the given target. This PR solves the issue by using the imported target octomap instead.

Signed-off-by: Shane Loretz <[email protected]>
@sloretz
Copy link
Author

sloretz commented Jun 8, 2020

I should note, I'm testing this building ros2 from source from master branches. I haven't tried the same scenario in ROS Dashing, Eloquent, or Foxy.

@codecov
Copy link

codecov bot commented Jun 8, 2020

Codecov Report

Merging #150 into dashing-devel will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@              Coverage Diff               @@
##           dashing-devel     #150   +/-   ##
==============================================
  Coverage          55.78%   55.78%           
==============================================
  Files                 12       12           
  Lines               1719     1719           
==============================================
  Hits                 959      959           
  Misses               760      760           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae12298...e9d1dc8. Read the comment docs.

@henningkayser
Copy link
Member

Thanks @sloretz. Actually, I think we should use the all capital letters target OCTOMAP with ament_target_dependencies - this one should provide libraries and include directories.

@henningkayser
Copy link
Member

I added a related fix to #153 as part of preparing the Foxy release. On what ROS2 distribution have you been testing this (Crystal?). We didn't plan on actively supporting older versions than Foxy anymore as we are also moving to Foxy with MoveIt 2.

@henningkayser
Copy link
Member

Closing since fix has been added with #153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants