colcon / colcon-ros

Extension for colcon to support ROS packages
http://colcon.readthedocs.io
Apache License 2.0
13 stars 26 forks source link

Workspace builds with `catkin_make_isolated` fails with `colcon build` #71

Closed murphm8 closed 5 years ago

murphm8 commented 5 years ago

Hello,

This issue is originally from https://forums.aws.amazon.com/thread.jspa?threadID=308176&tstart=0

This workspace builds with catkin_make_isolated but fails with colcon build.

Create workspace by doing the following:

  1. Create a ros workspace and enter the src directory
  2. git clone https://github.com/ros-industrial/fanuc.git
  3. git clone https://github.com/ros-industrial/industrial_core.git
  4. git clone https://github.com/ros-industrial-consortium/trajopt_ros
  5. cd trajopt_ros
  6. git checkout kinetic-devel
  7. cd ../.. Should now be in root of ros directory
  8. wstool init src
  9. wstool merge -t src src/trajopt_ros/dependencies.rosinstall
  10. wstool update -t src
  11. cd src/tesseract
  12. git checkout kinetic-devel
  13. sudo apt-get install ros-kinetic-pr2-common
  14. sudo apt install ros-kinetic-ecl
  15. sudo apt-get install ros-kinetic-moveit
  16. sudo apt-get install ros-kinetic-navigation
  17. sudo apt-get install ros-kinetic-octomap-ros

The error is:

Starting >>> tesseract_collision
--- stderr: tesseract_collision
/home/ubuntu/environment/ros_ws/src/tesseract/tesseract_collision/src/fcl/fcl_utils.cpp:45:40: fatal error: fcl/geometry/bvh/BVH_model.h: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/tesseract_collision_fcl.dir/src/fcl/fcl_utils.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/ubuntu/environment/ros_ws/src/tesseract/tesseract_collision/include/tesseract_collision/fcl/fcl_discrete_managers.h:46:0,
                 from /home/ubuntu/environment/ros_ws/src/tesseract/tesseract_collision/src/fcl/fcl_discrete_managers.cpp:48:
/home/ubuntu/environment/ros_ws/src/tesseract/tesseract_collision/include/tesseract_collision/fcl/fcl_utils.h:48:39: fatal error: fcl/narrowphase/collision.h: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/tesseract_collision_fcl.dir/src/fcl/fcl_discrete_managers.cpp.o] Error 1
make[1]: *** [CMakeFiles/tesseract_collision_fcl.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< tesseract_collision        [ Exited with code 2 ]

Can you please take a look and let me know what I'm missing to get colcon build to properly link the fcl library? Or if paths have changed?

Thanks!

dirk-thomas commented 5 years ago

The error message:

fatal error: fcl/narrowphase/distance.h: No such file or directory

indicates that the include directories aren't setup correctly. Quickly checking the used include directories shows that LIBFCL_INCLUDE_DIRS is empty.

I assume the variable is supposed to be set by this call: pkg_check_modules(LIBFCL REQUIRED fcl).

Quickly checking where this pkg-config modules is found by looking at LIBFCL_PREFIX:

Checking the content of the environment variable PKG_CONFIG_PATH shows:

Why is that the case? colcon only sources each packages script - not the workspace level script usually generated by catkin (it actually suppresses the generation of those so that multiple package don't overwrite the same file). The PKG_CONFIG_PATH isn't being set in the package level script of fcl_ros - the package relies on the global behavior of the catkin generated setup files.

One approach to address this is to extend PKG_CONFIG_PATH for catkin packages in colcon-ros. That would make the behavior more similar to catkin_make_isolated. I can create a PR for this soon.

dirk-thomas commented 5 years ago

@murphm8 Please see #72 for a proposed fix.

murphm8 commented 5 years ago

I have tested and confirmed that #72 fixes this issue.