4am-robotics / cob_driver

The cob_driver stack includes packages that provide access to the Care-O-bot hardware over ROS messages and services. E.g. for mobile base, arm, camera_sensors, scanners, etc...
www.care-o-bot.org
Apache License 2.0
102 stars 164 forks source link

cob_light fails to compile #370

Closed pholthaus closed 4 years ago

pholthaus commented 6 years ago

When trying to build cob_light from source (in gentoo), it fails with the following trace: https://paste.pound-python.org/show/6nPWo7E1mZ9jQydFplXq/

There seem to be two independent problems when compiling the package.

‘constexpr’ needed for in-class initialization of static data member ‘const double DistApproxMode::UPDATE_FREQ’ of non-integral type [-fpermissive]
static const float DIST_MIN = 0.3f;
/usr/include/boost/bind/bind.hpp:319:35: error: no match for call to ‘(boost::_mfi::mf1<void, IColorO, std::vector<color::rgba>&>) (IColorO*&, std::vector<color::rgba>)’
         unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);

Installed boost version is 1.65.

@fmessmer FYI

fmessmer commented 6 years ago

@pholthau could you propose a PR that fixes it? @ipa-bnm can you comment?

pholthaus commented 6 years ago

@ipa-fxm Sorry, I don't have a clue how to interpret the boost error message. It somehow looks like some method signatures do not match.

jabbenseth commented 6 years ago

I encountered this error on melodic. Fix will be provided in a PR, but there are still some compilation errors for melodic (separate Issues incoming)

The boost error happens on melodic as well:

/cob_ws/src/cob_driver/cob_light/common/src/modeExecutor.cpp:70:86:   required from here
/usr/include/boost/bind/bind.hpp:319:35: error: no match for call to ‘(boost::_mfi::mf1<void, IColorO, std::vector<color::rgba>&>) (IColorO*&, std::vector<color::rgba>)’
         unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/boost/bind/mem_fn.hpp:215:0,
                 from /usr/include/boost/mem_fn.hpp:22,
                 from /usr/include/boost/function/detail/prologue.hpp:18,
                 from /usr/include/boost/function.hpp:24,
                 from /opt/ros/melodic/include/ros/forwards.h:40,
                 from /opt/ros/melodic/include/ros/common.h:37,
                 from /opt/ros/melodic/include/ros/ros.h:43,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/include/mode.h:21,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/include/modeExecutor.h:21,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/src/modeExecutor.cpp:18:
/usr/include/boost/bind/mem_fn_template.hpp:163:7: note: candidate: R boost::_mfi::mf1<R, T, A1>::operator()(T*, A1) const [with R = void; T = IColorO; A1 = std::vector<color::rgba>&] <near match>
     R operator()(T * p, A1 a1) const
       ^~~~~~~~
/usr/include/boost/bind/mem_fn_template.hpp:163:7: note:   conversion of argument 2 would be ill-formed:
In file included from /usr/include/boost/bind.hpp:22:0,
                 from /opt/ros/melodic/include/ros/publisher.h:35,
                 from /opt/ros/melodic/include/ros/node_handle.h:32,
                 from /opt/ros/melodic/include/ros/ros.h:45,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/include/mode.h:21,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/include/modeExecutor.h:21,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/src/modeExecutor.cpp:18:
/usr/include/boost/bind/bind.hpp:319:35: error: cannot bind non-const lvalue reference of type ‘std::vector<color::rgba>&’ to an rvalue of type ‘std::vector<color::rgba>’
         unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/boost/bind/mem_fn.hpp:215:0,
                 from /usr/include/boost/mem_fn.hpp:22,
                 from /usr/include/boost/function/detail/prologue.hpp:18,
                 from /usr/include/boost/function.hpp:24,
                 from /opt/ros/melodic/include/ros/forwards.h:40,
                 from /opt/ros/melodic/include/ros/common.h:37,
                 from /opt/ros/melodic/include/ros/ros.h:43,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/include/mode.h:21,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/include/modeExecutor.h:21,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/src/modeExecutor.cpp:18:
/usr/include/boost/bind/mem_fn_template.hpp:168:25: note: candidate: template<class U> R boost::_mfi::mf1<R, T, A1>::operator()(U&, A1) const [with U = U; R = void; T = IColorO; A1 = std::vector<color::rgba>&]
     template<class U> R operator()(U & u, A1 a1) const
                         ^~~~~~~~
/usr/include/boost/bind/mem_fn_template.hpp:168:25: note:   template argument deduction/substitution failed:
In file included from /usr/include/boost/bind.hpp:22:0,
                 from /opt/ros/melodic/include/ros/publisher.h:35,
                 from /opt/ros/melodic/include/ros/node_handle.h:32,
                 from /opt/ros/melodic/include/ros/ros.h:45,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/include/mode.h:21,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/include/modeExecutor.h:21,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/src/modeExecutor.cpp:18:
/usr/include/boost/bind/bind.hpp:319:35: note:   cannot convert ‘(& a)->boost::_bi::rrlist1<std::vector<color::rgba> >::operator[](boost::_bi::storage2<boost::_bi::value<IColorO*>, boost::arg<1> >::a2_)’ (type ‘std::vector<color::rgba>’) to type ‘std::vector<color::rgba>&’
         unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/boost/bind/mem_fn.hpp:215:0,
                 from /usr/include/boost/mem_fn.hpp:22,
                 from /usr/include/boost/function/detail/prologue.hpp:18,
                 from /usr/include/boost/function.hpp:24,
                 from /opt/ros/melodic/include/ros/forwards.h:40,
                 from /opt/ros/melodic/include/ros/common.h:37,
                 from /opt/ros/melodic/include/ros/ros.h:43,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/include/mode.h:21,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/include/modeExecutor.h:21,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/src/modeExecutor.cpp:18:
/usr/include/boost/bind/mem_fn_template.hpp:176:25: note: candidate: template<class U> R boost::_mfi::mf1<R, T, A1>::operator()(const U&, A1) const [with U = U; R = void; T = IColorO; A1 = std::vector<color::rgba>&]
     template<class U> R operator()(U const & u, A1 a1) const
                         ^~~~~~~~
/usr/include/boost/bind/mem_fn_template.hpp:176:25: note:   template argument deduction/substitution failed:
In file included from /usr/include/boost/bind.hpp:22:0,
                 from /opt/ros/melodic/include/ros/publisher.h:35,
                 from /opt/ros/melodic/include/ros/node_handle.h:32,
                 from /opt/ros/melodic/include/ros/ros.h:45,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/include/mode.h:21,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/include/modeExecutor.h:21,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/src/modeExecutor.cpp:18:
/usr/include/boost/bind/bind.hpp:319:35: note:   cannot convert ‘(& a)->boost::_bi::rrlist1<std::vector<color::rgba> >::operator[](boost::_bi::storage2<boost::_bi::value<IColorO*>, boost::arg<1> >::a2_)’ (type ‘std::vector<color::rgba>’) to type ‘std::vector<color::rgba>&’
         unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/boost/bind/mem_fn.hpp:215:0,
                 from /usr/include/boost/mem_fn.hpp:22,
                 from /usr/include/boost/function/detail/prologue.hpp:18,
                 from /usr/include/boost/function.hpp:24,
                 from /opt/ros/melodic/include/ros/forwards.h:40,
                 from /opt/ros/melodic/include/ros/common.h:37,
                 from /opt/ros/melodic/include/ros/ros.h:43,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/include/mode.h:21,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/include/modeExecutor.h:21,
                 from /home/jba/git/cob_ws/src/cob_driver/cob_light/common/src/modeExecutor.cpp:18:
/usr/include/boost/bind/mem_fn_template.hpp:184:7: note: candidate: R boost::_mfi::mf1<R, T, A1>::operator()(T&, A1) const [with R = void; T = IColorO; A1 = std::vector<color::rgba>&]
     R operator()(T & t, A1 a1) const
       ^~~~~~~~
/usr/include/boost/bind/mem_fn_template.hpp:184:7: note:   no known conversion for argument 1 from ‘IColorO*’ to ‘IColorO&’
make[2]: *** [CMakeFiles/cob_light.dir/common/src/modeExecutor.cpp.o] Error 1
make[1]: *** [CMakeFiles/cob_light.dir/all] Error 2
make: *** [all] Error 2
fmessmer commented 4 years ago

fixed in #379