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

This is not really a problem with CMI, but with rpilidar_ros.

There are a few things not entirely correct with that package's build script:

  1. the build script does not make the dependency on std_srvs of its targets explicit
  2. the build script does not resolve the dependency on std_srvs

re: target dependencies: as you can see in catkin documentation/.../C++ message or service dependencies, all CMake targets which depend on messages must add appropriate add_dependencies(<target> ..) lines to their build scripts. The CMakeLists.txt (this one) of rplidar_ros doesn't do this -- not for rplidarNode nor for rplidarNodeClient.

The result could be that Catkin/CMake may decide to start building targets before their dependencies have been built. This obviously leads to problems, such as headers which cannot be found.

re: missing dependency: while the package manifest does state the dependency on std_srvs (here), the build script does not. Notice here how it find_package(..)s roscpp, rosconsole and sensor_msgs, but it doesn't mention std_srvs at all.

This causes the catkin_INCLUDE_DIRS to not contain the include path for std_srvs, potentially causing header lookup problems during compilation.

re: CMI vs catkin_make: the big difference between CMI and catkin_make is that the former builds all packages in isolation, while the latter essentially merges all CMakeLists.txt into a single context. The consequence is that build scripts which work with catkin_make may break with CMI, as dependencies between build targets exist in the single context of catkin_make, but no longer exist when building with CMI.

This is not a problem of CMI, but is caused by the build scripts of those packages being broken.

In the case of rpilidar_ros, you should:

  1. add std_srvs to the find_package(catkin ..) call
  2. add add_dependencies(<target> ${catkin_EXPORTED_TARGETS}) for all targets

And finally: if you want to be nice, and this fixes your issue, you may want to consider submitting a PR to Slamtec/rplidar_ros which fixes these two issues (but seeing as there are 127 forks, I'm pretty sure someone has already fixed this, but they haven't bothered to submit a PR).

This is not really a problem with CMI, but with rpilidar_ros.

There are a few things not entirely correct with that package's build script:

  1. the build script does not make the dependency on std_srvs of its targets explicit
  2. the build script does not resolve the dependency on std_srvs

re: target dependencies: as you can see in catkin documentation/.../C++ message or service dependencies, all CMake targets which depend on messages must add appropriate add_dependencies(<target> ..) lines to their build scripts. The CMakeLists.txt (this one) of rplidar_ros doesn't do this -- not for rplidarNode nor for rplidarNodeClient.

The result could be that Catkin/CMake may decide to start building targets before their dependencies have been built. This obviously leads to problems, such as headers which cannot be found.

re: missing dependency: while the package manifest does state the dependency on std_srvs (here), the build script does not. Notice here how it find_package(..)s roscpp, rosconsole and sensor_msgs, but it doesn't mention std_srvs at all.

This causes the catkin_INCLUDE_DIRS to not contain the include path for std_srvs, potentially causing header lookup problems during compilation.

re: CMI vs catkin_make: the big difference between CMI and catkin_make is that the former builds all packages in isolation, while the latter essentially merges all CMakeLists.txt into a single context. The consequence is that build scripts which work with catkin_make may break with CMI, as dependencies between build targets exist in the single context of catkin_make, but no longer exist when building with CMI.

This is not a problem of CMI, but is caused by the build scripts of those packages being broken.

In the case of rpilidar_ros, you should:

  1. add std_srvs to the find_package(catkin ..) call
  2. add add_dependencies(<target> ${catkin_EXPORTED_TARGETS}) for all targets

And finally: if you want to be nice, and this fixes your issue, you may want to consider submitting a PR to Slamtec/rplidar_ros which fixes these two issues (but seeing as there are 127 forks, I'm pretty sure someone has already fixed this, but they haven't bothered to submit a PR).


Edit:

edit : giving a try with catkin tools...and I get the same issue :-(

which makes sense, as the package is broken. CMI and catkin_tools both build packages in complete isolation, which causes them to expose the same problems with build scripts.