tuw-robotics / tuw_multi_robot

BSD 3-Clause "New" or "Revised" License
242 stars 113 forks source link

Cmake Error in tuw_multi_robot_local_behavior_controller #29

Closed HoodyJazz closed 3 years ago

HoodyJazz commented 3 years ago

When I followed the install guide for tuw_multi_robot and tried to catkin_make the project, I got the following error message:

[ 11%] Generating C++ code from tuw_multi_robot_msgs/OrderArray.msg
In file included from /root/catkin_ws/src/tuw_multi_robot/tuw_multi_robot_local_behavior_controller/src/RouteProgressMonitor.cpp:30:0:
/root/catkin_ws/src/tuw_multi_robot/tuw_multi_robot_local_behavior_controller/include/tuw_multi_robot_route_to_path/RouteProgressMonitor.h:33:10: fatal error: tuw_multi_robot_msgs/Route.h: No such file or directory
 #include <tuw_multi_robot_msgs/Route.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [tuw_multi_robot/tuw_multi_robot_local_behavior_controller/CMakeFiles/tuw_multi_robot_local_behavior_controller.dir/src/RouteProgressMonitor.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....

Scolling further up I found this preceding Warning:

CMake Warning (dev) at tuw_multi_robot/tuw_multi_robot_local_behavior_controller/CMakeLists.txt:145 (add_dependencies):
  Policy CMP0046 is not set: Error on non-existent dependency in
  add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  The dependency target
  "{tuw_multi_robot_local_behavior_controller_EXPORTED_TARGETS}" of target
  "tuw_multi_robot_local_behavior_controller_node" does not exist.
This warning is for project developers.  Use -Wno-dev to suppress it.

I looked at the CMakeFile.txt in the tuw_multi_robot_local_behavior_controller package and found a minor typo, that was responsible for this warning. In line 145 ther is a $ missing before {${PROJECT_NAME}_EXPORTED_TARGETS}. After I corrected that issue, the project built without any errors.

HoodyJazz commented 3 years ago

EDIT: I ran catkin_make on a clean workspace again and the first error persists. The warning is gone, however.

maxbader commented 3 years ago

Did you install tuw_msg?

HoodyJazz commented 3 years ago

Yes. Installing the messages first and the other packages afterwards did work. However, I was trying to get your planner running in a Docker container, where the same strategy did not work for some reason. But I found the issue today. In addition to the missing $ sign, I mentioned in my original post, I added the following line to the same CMakeLists.txt (uncommenting line 139):

add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

which adds the message dependency to the libraries declared earlier in that file. Now everything builds from a clean workspace without installing the messages first. Thanks for getting back to me. Let me also say, that this planner looks really nice and I am looking forward to working with it!