ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

From what I've found on my machines - this actually needs more definition than what it appears to. ROS_PACKAGE_PATH is not the only factor in play.

When a package is installed and ends up in /opt/ros/{distro}/include it becomes available for includeing via the CMake directive include_directories( ${catkin_INCLUDE_DIRS})

Say you've installed ros-{distro}-excellent-package but also have excellent_package in your workspace. You will need:

  • ROS_PACKAGE_PATH defined with your workspace appearing first (ie: /home/altinners/workspace_ws/src:/opt/ros/{distro}/share)
  • Your include_directories directives set up so that your _local_ packages appear first ie: include_directories( include ${excellent_package_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS} ) - this prioritises the local include files over the system installed ones

From what I've found on my machines - this actually needs more definition than what it appears to. ROS_PACKAGE_PATH is not the only factor in play.

When a package is installed and ends up in /opt/ros/{distro}/include it becomes available for includeing via the CMake directive include_directories( ${catkin_INCLUDE_DIRS})

Say you've installed ros-{distro}-excellent-package but also have excellent_package in your workspace. You will need:

  • ROS_PACKAGE_PATH defined with your workspace appearing first (ie: /home/altinners/workspace_ws/src:/opt/ros/{distro}/share)
  • Your include_directories directives set up so that your _local_ packages appear first ie: include_directories( include ${excellent_package_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS} ) - this prioritises the local include files over the system installed ones

This is not really necessary if you don't ever need to reference header files - but in most cases where I think anyone would need to have local packages outside of the main /opt folder you'd want to reference the headers.