-
Notifications
You must be signed in to change notification settings - Fork 277
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
CMake error with catkin_make #3
Comments
hector_pose_estimation uses the hector_uav_msgs package only if it is available at build time (by find_package), without declaring a build dependency in its package.xml file. hector_uav_msgs is optional and hector_pose_estimation should be usable without the hector_quadrotor stack. It is not possible to declare an optional dependency in package.xml. The CMake error you observed is caused by the fact that catkin wants to build hector_uav_msgs after hector_pose_estimation and both packages generate the I guess there is no simple workaround here (@dirk-thomas?). You could add hector_uav_msgs as a build_depend in Note that you only need the hector_pose_estimation package if you want to use more realistic estimated pose information for control and tf instead of ground truth. Otherwise you could place a CATKIN_IGNORE marker file in the hector_pose_estimation package folder and omit that package. If you install ros-hydro-message-to-tf binary package from the Ubuntu repos you also could omit the whole hector_localization repo. |
I don't understand why multiple locations would generate the |
The cmake configuration file of package hector_uav_msgs in If both packages are within the same workspace with proper dependencies, the targets are defined in the message package itself, whose cmake script is parsed first. If the message package belongs to another workspace, the empty custom targets are defined to not break cmake scripts that have a I don't have time to look into this more closely right now. Just use two separate workspaces or use hector_quadrotor without hector_pose_estimation as a workaround, if this is okay for you. |
This conditional finding of hector_uav_msgs results in a non-deterministic behavior of the configure step. I can only highly recommend to not do it in this way. Just the fact that the public API of hector_pose_estimation changes is a strong indicator that this should be addressed differently. I think the right way to do that would be to make the UAV/MAV specific stuff an extension / plugin to the generic pose estimation. |
I removed all dependencies to hector_uav_msgs from hector_pose_estimation and created a new package hector_quadrotor_pose_estimation instead (only in the new catkin branch of hector_quadrotor). The catkin_make error should have vanished. Please comment if you still have problems like this. Obviously you should run the pose_estimation node from the new package for the case you are using it (which is not the default configuration currently). |
catkin_make hector_quadrotor yields these errors :
CMake Error at /home/mtourne/catkin_ws/build/hector_quadrotor/hector_uav_msgs/cmake/hector_uav_msgs-genmsg.cmake:155 (add_custom_target):
add_custom_target cannot create target
"hector_uav_msgs_generate_messages_cpp" because another target with the
same name already exists. The existing target is a custom target created
in source directory
"/home/mtourne/catkin_ws/src/hector_localization/hector_pose_estimation".
See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
/opt/ros/hydro/share/genmsg/cmake/genmsg-extras.cmake:287 (include)
hector_quadrotor/hector_uav_msgs/CMakeLists.txt:56 (generate_messages)
hector_uav_msgs_generate_messages_lisp, and hector_uav_msgs_generate_messages_py also generates errors.
The text was updated successfully, but these errors were encountered: