tu-darmstadt-ros-pkg / hector_quadrotor

hector_quadrotor contains packages related to modeling, control and simulation of quadrotor UAV systems.
Other
378 stars 277 forks source link

hector_localization compiling error in kinetic #82

Closed medhijk closed 6 years ago

medhijk commented 6 years ago

While compiling hector quadrotor package from source under kinetic devel, I run the following error:

[ 76%] Building CXX object hector_localization/hector_pose_estimation_core/CMakeFiles/hector_pose_estimation.dir/src/parameters.cpp.o
In file included from /usr/include/eigen3/Eigen/Core:316:0,
                 from /home/medhijk/catkin_ws/src/hector_localization/hector_pose_estimation_core/include/hector_pose_estimation/matrix.h:36,
                 from /home/medhijk/catkin_ws/src/hector_localization/hector_pose_estimation_core/include/hector_pose_estimation/types.h:32,
                 from /home/medhijk/catkin_ws/src/hector_localization/hector_pose_estimation_core/include/hector_pose_estimation/global_reference.h:32,
                 from /home/medhijk/catkin_ws/src/hector_localization/hector_pose_estimation_core/src/global_reference.cpp:29:
/usr/include/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h:60:39: warning: ignoring attributes on template argument ‘__m128 {aka __vector(4) float}’ [-Wignored-attributes]
 template<> struct is_arithmetic<__m128>  { enum { value = true }; };

...
...
...

[ 77%] Building CXX object hector_localization/hector_pose_estimation_core/CMakeFiles/hector_pose_estimation.dir/src/types.cpp.o
In file included from /home/medhijk/catkin_ws/src/hector_localization/hector_pose_estimation_core/include/hector_pose_estimation/system_model.h:34:0,
                 from /home/medhijk/catkin_ws/src/hector_localization/hector_pose_estimation_core/include/hector_pose_estimation/system.h:32,
                 from /home/medhijk/catkin_ws/src/hector_localization/hector_pose_estimation_core/include/hector_pose_estimation/pose_estimation.h:34,
                 from /home/medhijk/catkin_ws/src/hector_localization/hector_pose_estimation_core/src/pose_estimation.cpp:29:
/home/medhijk/catkin_ws/src/hector_localization/hector_pose_estimation_core/include/hector_pose_estimation/input.h: In instantiation of ‘bool hector_pose_estimation::Input_<_Dimension>::hasVariance() const [with int _Dimension = 6]’:
/home/medhijk/catkin_ws/src/hector_localization/hector_pose_estimation_core/src/pose_estimation.cpp:775:1:   required from here
/home/medhijk/catkin_ws/src/hector_localization/hector_pose_estimation_core/include/hector_pose_estimation/input.h:82:45: **error**: cannot convert ‘const boost::shared_ptr<Eigen::Matrix<double, 6, 6, 0, 6, 6> >’ to ‘bool’ in return
   virtual bool hasVariance() const { return variance_; }
                                             ^~~~~~~~~
hector_localization/hector_pose_estimation_core/CMakeFiles/hector_pose_estimation.dir/build.make:86: recipe for target 'hector_localization/hector_pose_estimation_core/CMakeFiles/hector_pose_estimation.dir/src/pose_estimation.cpp.o' failed
make[2]: *** [hector_localization/hector_pose_estimation_core/CMakeFiles/hector_pose_estimation.dir/src/pose_estimation.cpp.o] Error 1

Can anyone tell me what might be causing this?

nolanholden commented 6 years ago

if you look closely at the error message you posted, you can see that someone is doing an implicit conversion from boost::shared_ptr<> to bool. This obviously compiled for the original developer's, but your compiler is being more strict. I'll submit a pull request to fix this issue, and hopefully it won't take too long for them to respond.

TL;DR:

boost::shared_ptr<> is not a bool, and your compiler is forbidding that conversion. A fix might look like:

virtual bool hasVariance() const { return (variance_ != nullptr); }
nolanholden commented 6 years ago

Recommend to be closed after @meyerj merged tu-darmstadt-ros-pkg/hector_localization#16