Problem tracking down an cmake error in a ROS/gazebo project
I am trying to upgrade a number of ROS/gazebo nodes made by some other developers:
https://github.com/ethz-asl/rotors_simulator
My goal is to get them running with Ubuntu 18.04, ROS melodic and Gazebo 9.
I have been able to solve most of the compile errors, but I seem to have encountered a problem I do not know how to find. My problem is one remaining error, which I have been unable to determine the cause of. It is a bit hard to solve a problem if you do not know what causes it in the first place:
Errors << rotors_gazebo_plugins:cmake /home/martin/ros_sim_drone/logs/rotors_gazebo_plugins/build.cmake.000.log
CMake Warning (dev) at /usr/share/cmake-3.10/Modules/FindBoost.cmake:911 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Quoted variables like "chrono" will no longer be dereferenced when the
policy is set to NEW. Since the policy is not set the OLD behavior will be
used.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindBoost.cmake:1558 (_Boost_MISSING_DEPENDENCIES)
/usr/share/OGRE/cmake/modules/FindOGRE.cmake:318 (find_package)
/usr/lib/x86_64-linux-gnu/cmake/gazebo/gazebo-config.cmake:175 (find_package)
CMakeLists.txt:19 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:25 (add_library):
Policy CMP0028 is not set: Double colon in target name means ALIAS or
IMPORTED target. Run "cmake --help-policy CMP0028" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
Target "rotors_gazebo_bag_plugin" links to target "UUID::UUID" but the
target was not found. Perhaps a find_package() call is missing for an
IMPORTED target, or an ALIAS target is missing?
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:25 (add_library):
Policy CMP0028 is not set: Double colon in target name means ALIAS or
IMPORTED target. Run "cmake --help-policy CMP0028" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
Target "rotors_gazebo_bag_plugin" links to target "UUID::UUID" but the
target was not found. Perhaps a find_package() call is missing for an
IMPORTED target, or an ALIAS target is missing?
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at /home/martin/ros_sim_drone/src/rotors_simulator/rotors_gazebo_plugins/CMakeLists.txt:26 (target_link_libraries):
Error evaluating generator expression:
$<TARGET_PROPERTY:UUID::UUID,INTERFACE_INCLUDE_DIRECTORIES>
Target "UUID::UUID" not found.
CMake Error:
Error evaluating generator expression:
$<TARGET_PROPERTY:UUID::UUID,INTERFACE_INCLUDE_DIRECTORIES>
Target "UUID::UUID" not found.
CMake Error at /home/martin/ros_sim_drone/src/rotors_simulator/rotors_gazebo_plugins/CMakeLists.txt:26 (target_link_libraries):
Error evaluating generator expression:
$<TARGET_PROPERTY:UUID::UUID,INTERFACE_INCLUDE_DIRECTORIES>
Target "UUID::UUID" not found.
Running catkin_make or catkin build a second time the problem still presists;
Errors << rotors_gazebo_plugins:make /home/martin/ros_sim_drone/logs/rotors_gazebo_plugins/build.make.000.log
/usr/bin/x86_64-linux-gnu-ld: cannot find -lUUID::UUID
collect2: error: ld returned 1 exit status
make[2]: *** [librotors_gazebo_bag_plugin.so] Error 1
make[1]: *** [CMakeFiles/rotors_gazebo_bag_plugin.dir/all] Error 2
make: *** [all] Error 2
The CMakeLists.txt look like this currently:
cmake_minimum_required(VERSION 2.8.3)
project(rotors_gazebo_plugins)
find_package(catkin REQUIRED COMPONENTS
cmake_modules
geometry_msgs
mav_msgs
rosbag
roscpp
gazebo_ros
rotors_comm
rotors_control
std_srvs
tf
)
find_package(Eigen3 REQUIRED)
find_package(gazebo REQUIRED)
find_package(Protobuf REQUIRED)
link_directories(${GAZEBO_LIBRARY_DIRS})
include_directories(include ${Boost_INCLUDE_DIR} ${catkin_INCLUDE_DIRS} ${Eigen3_INCLUDE_DIRS} ${GAZEBO_INCLUDE_DIRS})
add_library(rotors_gazebo_bag_plugin SHARED src/gazebo_bag_plugin.cpp)
target_link_libraries(rotors_gazebo_bag_plugin ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES})
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME} rotors_gazebo_motor_model rotors_gazebo_controller_interface
CATKIN_DEPENDS geometry_msgs mav_msgs rosbag roscpp rotors_comm rotors_control std_srvs tf
DEPENDS EIGEN3 GAZEBO
)
I think the problem is somewhere between cmake, gazebo and ROS, but I am not 100% sure. My main problem is, I do not know how to move forward with this problem, so any input would be helpfull.
Asked by mpc_agro on 2018-06-13 16:19:49 UTC
Answers
I found out the error was related to the ignition libraries used by Gazebo 9. I posted the problem as a potential a bug on the ignition cmake issue list: https://bitbucket.org/ignitionrobotics/ign-cmake/issues/40/cmake-cannot-parse-ignition-math4-ignition
Asked by mpc_agro on 2018-06-15 05:08:38 UTC
Comments
I'm facing the same issue. Did you solve it?
Asked by Bill5785 on 2018-10-23 00:13:40 UTC
Comments
Is this you: ethz-asl/rotors_simulator#497?
If it isn't, you may want to consider collaborating with the author of that PR.
Asked by gvdhoorn on 2018-06-15 05:48:38 UTC
I did not notice this branch. I think he started it around the same time I started working on the project. I will contact him and see if he needs help!
Asked by mpc_agro on 2018-06-15 07:22:27 UTC