0
$\begingroup$

Rosanswers logo

I have been trying to install the ROS package called vision_opencv, in order to run some OpenCV 3.2 code with ROS Kinetic on a Parrot 1.0 AR Drone. I tried the install by executing git clone https://github.com/ros-perception/vision_opencv within my ~/catkin_ws/src directory. Then, I ran catkin_make in ~/catkin_ws but received the following error:

.....(some terminal ouput intentionally left blank)......

[ 96%] Built target ardronelib
[ 97%] Built target ardrone_driver
/home/robotics/catkin_ws/src/vision_opencv/image_geometry/src/pinhole_camera_model.cpp: In member function ‘bool image_geometry::PinholeCameraModel::fromCameraInfo(const CameraInfo&)’:
/home/robotics/catkin_ws/src/vision_opencv/image_geometry/src/pinhole_camera_model.cpp:87:12: error: no match for ‘operator=’ (operand types are ‘boost::shared_ptr<image_geometry::PinholeCameraModel::Cache>’ and ‘std::shared_ptr<image_geometry::PinholeCameraModel::Cache>’)
     cache_ = std::make_shared<Cache>();
            ^
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
                 from /usr/include/boost/format/alt_sstream.hpp:21,
                 from /usr/include/boost/format/internals.hpp:23,
                 from /usr/include/boost/format.hpp:38,
                 from /usr/include/boost/math/policies/error_handling.hpp:31,
                 from /usr/include/boost/math/special_functions/round.hpp:14,
                 from /opt/ros/kinetic/include/ros/time.h:58,
                 from /opt/ros/kinetic/include/ros/serialization.h:34,
                 from /opt/ros/kinetic/include/sensor_msgs/CameraInfo.h:14,
                 from /opt/ros/kinetic/include/image_geometry/pinhole_camera_model.h:4,
                 from /home/robotics/catkin_ws/src/vision_opencv/image_geometry/src/pinhole_camera_model.cpp:3:
/usr/include/boost/smart_ptr/shared_ptr.hpp:500:18: note: candidate: boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(const boost::shared_ptr<T>&) [with T = image_geometry::PinholeCameraModel::Cache]
     shared_ptr & operator=( shared_ptr const & r ) BOOST_NOEXCEPT
                  ^
/usr/include/boost/smart_ptr/shared_ptr.hpp:500:18: note:   no known conversion for argument 1 from ‘std::shared_ptr<image_geometry::PinholeCameraModel::Cache>’ to ‘const boost::shared_ptr<image_geometry::PinholeCameraModel::Cache>&’
/usr/include/boost/smart_ptr/shared_ptr.hpp:509:18: note: candidate: template<class Y> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(const boost::shared_ptr<Y>&) [with Y = Y; T = image_geometry::PinholeCameraModel::Cache]
     shared_ptr & operator=(shared_ptr<Y> const & r) BOOST_NOEXCEPT
                  ^
/usr/include/boost/smart_ptr/shared_ptr.hpp:509:18: note:   template argument deduction/substitution failed:
/home/robotics/catkin_ws/src/vision_opencv/image_geometry/src/pinhole_camera_model.cpp:87:12: note:   ‘std::shared_ptr<image_geometry::PinholeCameraModel::Cache>’ is not derived from ‘const boost::shared_ptr<X>’
     cache_ = std::make_shared<Cache>();
            ^
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
                 from /usr/include/boost/format/alt_sstream.hpp:21,
                 from /usr/include/boost/format/internals.hpp:23,
                 from /usr/include/boost/format.hpp:38,
                 from /usr/include/boost/math/policies/error_handling.hpp:31,
                 from /usr/include/boost/math/special_functions/round.hpp:14,
                 from /opt/ros/kinetic/include/ros/time.h:58,
                 from /opt/ros/kinetic/include/ros/serialization.h:34,
                 from /opt/ros/kinetic/include/sensor_msgs/CameraInfo.h:14,
                 from /opt/ros/kinetic/include/image_geometry/pinhole_camera_model.h:4,
                 from /home/robotics/catkin_ws/src/vision_opencv/image_geometry/src/pinhole_camera_model.cpp:3:
/usr/include/boost/smart_ptr/shared_ptr.hpp:520:18: note: candidate: template<class Y> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(std::auto_ptr<_Up>&) [with Y = Y; T = image_geometry::PinholeCameraModel::Cache]
     shared_ptr & operator=( std::auto_ptr<Y> & r )
                  ^
/usr/include/boost/smart_ptr/shared_ptr.hpp:520:18: note:   template argument deduction/substitution failed:
/home/robotics/catkin_ws/src/vision_opencv/image_geometry/src/pinhole_camera_model.cpp:87:12: note:   ‘std::shared_ptr<image_geometry::PinholeCameraModel::Cache>’ is not derived from ‘std::auto_ptr<Y>’
     cache_ = std::make_shared<Cache>();
            ^
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
                 from /usr/include/boost/format/alt_sstream.hpp:21,
                 from /usr/include/boost/format/internals.hpp:23,
                 from /usr/include/boost/format.hpp:38,
                 from /usr/include/boost/math/policies/error_handling.hpp:31,
                 from /usr/include/boost/math/special_functions/round.hpp:14,
                 from /opt/ros/kinetic/include/ros/time.h:58,
                 from /opt/ros/kinetic/include/ros/serialization.h:34,
                 from /opt/ros/kinetic/include/sensor_msgs/CameraInfo.h:14,
                 from /opt/ros/kinetic/include/image_geometry/pinhole_camera_model.h:4,
                 from /home/robotics/catkin_ws/src/vision_opencv/image_geometry/src/pinhole_camera_model.cpp:3:
/usr/include/boost/smart_ptr/shared_ptr.hpp:529:18: note: candidate: template<class Y> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(std::auto_ptr<_Up>&&) [with Y = Y; T = image_geometry::PinholeCameraModel::Cache]
     shared_ptr & operator=( std::auto_ptr<Y> && r )
                  ^
/usr/include/boost/smart_ptr/shared_ptr.hpp:529:18: note:   template argument deduction/substitution failed:
/home/robotics/catkin_ws/src/vision_opencv/image_geometry/src/pinhole_camera_model.cpp:87:12: note:   ‘std::shared_ptr<image_geometry::PinholeCameraModel::Cache>’ is not derived from ‘std::auto_ptr<Y>’
     cache_ = std::make_shared<Cache>();
            ^
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
                 from /usr/include/boost/format/alt_sstream.hpp:21,
                 from /usr/include/boost/format/internals.hpp:23,
                 from /usr/include/boost/format.hpp:38,
                 from /usr/include/boost/math/policies/error_handling.hpp:31,
                 from /usr/include/boost/math/special_functions/round.hpp:14,
                 from /opt/ros/kinetic/include/ros/time.h:58,
                 from /opt/ros/kinetic/include/ros/serialization.h:34,
                 from /opt/ros/kinetic/include/sensor_msgs/CameraInfo.h:14,
                 from /opt/ros/kinetic/include/image_geometry/pinhole_camera_model.h:4,
                 from /home/robotics/catkin_ws/src/vision_opencv/image_geometry/src/pinhole_camera_model.cpp:3:
/usr/include/boost/smart_ptr/shared_ptr.hpp:551:18: note: candidate: template<class Y, class D> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(std::unique_ptr<_Up, _Ep>&&) [with Y = Y; D = D; T = image_geometry::PinholeCameraModel::Cache]
     shared_ptr & operator=( std::unique_ptr<Y, D> && r )
                  ^
/usr/include/boost/smart_ptr/shared_ptr.hpp:551:18: note:   template argument deduction/substitution failed:
/home/robotics/catkin_ws/src/vision_opencv/image_geometry/src/pinhole_camera_model.cpp:87:12: note:   ‘std::shared_ptr<image_geometry::PinholeCameraModel::Cache>’ is not derived from ‘std::unique_ptr<_Tp, _Dp>’
     cache_ = std::make_shared<Cache>();
            ^
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
                 from /usr/include/boost/format/alt_sstream.hpp:21,
                 from /usr/include/boost/format/internals.hpp:23,
                 from /usr/include/boost/format.hpp:38,
                 from /usr/include/boost/math/policies/error_handling.hpp:31,
                 from /usr/include/boost/math/special_functions/round.hpp:14,
                 from /opt/ros/kinetic/include/ros/time.h:58,
                 from /opt/ros/kinetic/include/ros/serialization.h:34,
                 from /opt/ros/kinetic/include/sensor_msgs/CameraInfo.h:14,
                 from /opt/ros/kinetic/include/image_geometry/pinhole_camera_model.h:4,
                 from /home/robotics/catkin_ws/src/vision_opencv/image_geometry/src/pinhole_camera_model.cpp:3:
/usr/include/boost/smart_ptr/shared_ptr.hpp:587:18: note: candidate: boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(boost::shared_ptr<T>&&) [with T = image_geometry::PinholeCameraModel::Cache]
     shared_ptr & operator=( shared_ptr && r ) BOOST_NOEXCEPT
                  ^
/usr/include/boost/smart_ptr/shared_ptr.hpp:587:18: note:   no known conversion for argument 1 from ‘std::shared_ptr<image_geometry::PinholeCameraModel::Cache>’ to ‘boost::shared_ptr<image_geometry::PinholeCameraModel::Cache>&&’
/usr/include/boost/smart_ptr/shared_ptr.hpp:594:18: note: candidate: template<class Y> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(boost::shared_ptr<Y>&&) [with Y = Y; T = image_geometry::PinholeCameraModel::Cache]
     shared_ptr & operator=( shared_ptr<Y> && r ) BOOST_NOEXCEPT
                  ^
/usr/include/boost/smart_ptr/shared_ptr.hpp:594:18: note:   template argument deduction/substitution failed:
/home/robotics/catkin_ws/src/vision_opencv/image_geometry/src/pinhole_camera_model.cpp:87:12: note:   ‘std::shared_ptr<image_geometry::PinholeCameraModel::Cache>’ is not derived from ‘boost::shared_ptr<X>’
     cache_ = std::make_shared<Cache>();
            ^
In file included from /usr/include/boost/shared_ptr.hpp:17:0,
                 from /usr/include/boost/format/alt_sstream.hpp:21,
                 from /usr/include/boost/format/internals.hpp:23,
                 from /usr/include/boost/format.hpp:38,
                 from /usr/include/boost/math/policies/error_handling.hpp:31,
                 from /usr/include/boost/math/special_functions/round.hpp:14,
                 from /opt/ros/kinetic/include/ros/time.h:58,
                 from /opt/ros/kinetic/include/ros/serialization.h:34,
                 from /opt/ros/kinetic/include/sensor_msgs/CameraInfo.h:14,
                 from /opt/ros/kinetic/include/image_geometry/pinhole_camera_model.h:4,
                 from /home/robotics/catkin_ws/src/vision_opencv/image_geometry/src/pinhole_camera_model.cpp:3:
/usr/include/boost/smart_ptr/shared_ptr.hpp:604:18: note: candidate: boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(boost::detail::sp_nullptr_t) [with T = image_geometry::PinholeCameraModel::Cache; boost::detail::sp_nullptr_t = std::nullptr_t]
     shared_ptr & operator=( boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT // never throws
                  ^
/usr/include/boost/smart_ptr/shared_ptr.hpp:604:18: note:   no known conversion for argument 1 from ‘std::shared_ptr<image_geometry::PinholeCameraModel::Cache>’ to ‘boost::detail::sp_nullptr_t {aka std::nullptr_t}’
vision_opencv/image_geometry/CMakeFiles/image_geometry.dir/build.make:62: recipe for target 'vision_opencv/image_geometry/CMakeFiles/image_geometry.dir/src/pinhole_camera_model.cpp.o' failed
make[2]: *** [vision_opencv/image_geometry/CMakeFiles/image_geometry.dir/src/pinhole_camera_model.cpp.o] Error 1
CMakeFiles/Makefile2:2116: recipe for target 'vision_opencv/image_geometry/CMakeFiles/image_geometry.dir/all' failed
make[1]: *** [vision_opencv/image_geometry/CMakeFiles/image_geometry.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 98%] Linking CXX shared library /home/robotics/catkin_ws/devel/lib/python2.7/dist-packages/cv_bridge/boost/cv_bridge_boost.so
[ 98%] Built target cv_bridge_boost
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j8 -l8" failed
robotics@robotics-2:~/catkin_ws$ 

Based on the ouptut it seems there is an issue with the /home/robotics/catkin_ws/src/vision_opencv/image_geometry/src/pinhole_camera_model.cpp file, but I am unable to figure out how to fix it. I do not know if the way I cloned the package resulted in the error or if it's something with my computer. Any help is greatly appreciated.


Originally posted by Allen Ayala on ROS Answers with karma: 22 on 2017-07-05

Post score: 0


Original comments

Comment by jeanpolochon on 2017-07-06:
Which version of ROS are you using ?

Comment by Allen Ayala on 2017-07-06:
As mentioned in the question, I am using ROS Kinetic and OpenCV 3.2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Someone else reported this problem in an issue on GitHub. I described the root cause in my comment there. You can fix the problem either by uninstalling the packaged version of image_geometry or by editing the CMakeLists.txt file so that include_directories(include) comes before include_directories(${catkin_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} )


Originally posted by Ed Venator with karma: 1185 on 2017-07-07

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Allen Ayala on 2017-07-08:
Thanks for the suggestion, but a friend of mine was able to solve the issue. Details of how he solved it are outlined in my answer.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.