0
$\begingroup$

Rosanswers logo

Hi all,

I am trying to get ros installed on the Raspberry Pi 2. Let me first say what a pleasure it is reading the helpful how to's.

I am following the http://wiki.ros.org/indigo/Installation/Debian

With this I am trying to use some of the open cv libraries along with the robot package. Raspberry Pi 2 Raspbian has the open cv 2 libraries (including dev) installed.

Linux raspberrypi 3.18.7-v7+ #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015 armv7l GNU/Linux

This is the packages I am trying to install rosinstall_generator robot image_common image_pipeline image_transport_plugins
vision_opencv --rosdistro indigo --deps --wet-only --exclude roslisp cd /home/-
-tar > indigo-robot_opencv_custom-wet.rosinstall

When running make this is the error I get the following error. This seems to say it cannot find the conversion for certain cv defined types, yet the header file that has these definitions is found and candidates are called. Should I build cv from stratch?

pi@raspberrypi ~/ros_catkin_ws/build_isolated/image_view $ make [100%] Built target disparity_view [100%] Built target extract_images [100%] Built target image_saver [100%] Built target image_view [100%] Built target image_view_exe [100%] Built target stereo_view [100%] Building CXX object CMakeFiles/video_recorder.dir/src/nodes/video_recorder.cpp.o /home/pi/ros_catkin_ws/src/image_pipeline/image_view/src/nodes/video_recorder.cpp: In function ‘void callback(const ImageConstPtr&, const CameraInfoConstPtr&)’: /home/pi/ros_catkin_ws/src/image_pipeline/image_view/src/nodes/video_recorder.cpp:64:9: error: no match for ‘operator<<’ in ‘std::operator<< [with _Traits = std::char_traits<char>]((* & std::operator<< [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]((* & std::operator<< [with _Traits = std::char_traits<char>]((* & __rosconsole_print_stream_at_location_with_filter__ss__.std::basic_stringstream<char>::<anonymous>.std::basic_iostream<char>::<anonymous>), ((const char*)"Starting to record "))), (*(const std::basic_string<char>*)(& codec)))), ((const char*)" video at ")) << size’ /home/pi/ros_catkin_ws/src/image_pipeline/image_view/src/nodes/video_recorder.cpp:64:9: note: candidates are: /usr/include/c++/4.6/ostream:110:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ostream_type& (*)(std::basic_ostream<_CharT, _Traits>::__ostream_type&)) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] /usr/include/c++/4.6/ostream:110:7: note: no known conversion for argument 1 from ‘cv::Size’ to ‘std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&) {aka std::basic_ostream<char>& (*)(std::basic_ostream<char>&)}’ /usr/include/c++/4.6/ostream:119:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ios_type& (*)(std::basic_ostream<_CharT, _Traits>::__ios_type&)) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>, std::basic_ostream<_CharT, _Traits>::__ios_type = std::basic_ios<char>] /usr/include/c++/4.6/ostream:119:7: note: no known conversion for argument 1 from ‘cv::Size’ to ‘std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&) {aka std::basic_ios<char>& (*)(std::basic_ios<char>&)}’ /usr/include/c++/4.6/ostream:129:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] /usr/include/c++/4.6/ostream:129:7: note: no known conversion for argument 1 from ‘cv::Size’ to ‘std::ios_base& (*)(std::ios_base&)’ /usr/include/c++/4.6/ostream:167:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] /usr/include/c++/4.6/ostream:167:7: note: no known conversion for argument 1 from ‘cv::Size’ to ‘long int’ /usr/include/c++/4.6/ostream:171:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] /usr/include/c++/4.6/ostream:171:7: note: no known conversion for argument 1 from ‘cv::Size’ to ‘long unsigned int’ /usr/include/c++/4.6/ostream:175:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] /usr/include/c++/4.6/ostream:175:7: note: no known conversion for argument 1 from ‘cv::Size’ to ‘bool’ /usr/include/c++/4.6/bits/ostream.tcc:93:5: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char, _Traits = std::char_traits<char>] /usr/include/c++/4.6/bits/ostream.tcc:93:5: note: no known conversion for argument 1 from ‘cv::Size’ to ‘short int’ /usr/include/c++/4.6/ostream:182:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] /usr/include/c++/4.6/ostream:182:7: note: no known conversion for argument 1 from ‘cv::Size’ to ‘short unsigned int’ /usr/include/c++/4.6/bits/ostream.tcc:107:5: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char, _Traits = std::char_traits<char>] /usr/include/c++/4.6/bits/ostream.tcc:107:5: note: no known conversion for argument 1 from ‘cv::Size’ to ‘int’ /usr/include/c++/4.6/ostream:193:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] /usr/include/c++/4.6/ostream:193:7: note: no known conversion for argument 1 from ‘cv::Size’ to ‘unsigned int’ /usr/include/c++/4.6/ostream:202:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] /usr/include/c++/4.6/ostream:202:7: note: no known conversion for argument 1 from ‘cv::Size’ to ‘long long int’ /usr/include/c++/4.6/ostream:206:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] /usr/include/c++/4.6/ostream:206:7: note: no known conversion for argument 1 from ‘cv::Size’ to ‘long long unsigned int’ /usr/include/c++/4.6/ostream:211:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] /usr/include/c++/4.6/ostream:211:7: note: no known conversion for argument 1 from ‘cv::Size’ to ‘double’ /usr/include/c++/4.6/ostream:215:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] /usr/include/c++/4.6/ostream:215:7: note: no known conversion for argument 1 from ‘cv::Size’ to ‘float’ /usr/include/c++/4.6/ostream:223:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] /usr/include/c++/4.6/ostream:223:7: note: no known conversion for argument 1 from ‘cv::Size’ to ‘long double’ /usr/include/c++/4.6/ostream:227:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>] /usr/include/c++/4.6/ostream:227:7: note: no known conversion for argument 1 from ‘cv::Size’ to ‘const void*’ /usr/include/c++/4.6/bits/ostream.tcc:121:5: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__streambuf_type*) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>] /usr/include/c++/4.6/bits/ostream.tcc:121:5: note: no known conversion for argument 1 from ‘cv::Size’ to ‘std::basic_ostream<char>::__streambuf_type* {aka std::basic_streambuf<char>*}’ /opt/ros/indigo/include/XmlRpcValue.h:192:15: note: std::ostream& operator<<(std::ostream&, XmlRpc::XmlRpcValue&) /opt/ros/indigo/include/XmlRpcValue.h:192:15: note: no known conversion for argument 2 from ‘cv::Size’ to ‘XmlRpc::XmlRpcValue&’ /usr/include/c++/4.6/iomanip:237:5: note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, std::_Setw) /usr/include/c++/4.6/iomanip:207:5: note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, std::_Setprecision) /usr/include/c++/4.6/iomanip:177:5: note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, std::_Setfill<_CharT>) /usr/include/c++/4.6/iomanip:142:5: note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, std::_Setbase) /usr/include/c++/4.6/iomanip:108:5: note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, std::_Setiosflags) /usr/include/c++/4.6/iomanip:78:5: note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, std::_Resetiosflags) /usr/include/c++/4.6/complex:521:5: note: template<class _Tp, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::complex<_Tp>&) /usr/include/c++/4.6/ostream:528:5: note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const unsigned char*) /usr/include/c++/4.6/ostream:523:5: note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const signed char*) /usr/include/c++/4.6/ostream:510:5: note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*) /usr/include/c++/4.6/bits/ostream.tcc:323:5: note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const char*) /usr/include/c++/4.6/ostream:493:5: note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const _CharT*) /usr/include/c++/4.6/ostream:473:5: note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, unsigned char) /usr/include/c++/4.6/ostream:468:5: note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, signed char) /usr/include/c++/4.6/ostream:462:5: note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char) /usr/include/c++/4.6/ostream:456:5: note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, char) /usr/include/c++/4.6/ostream:451:5: note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, _CharT) /usr/include/c++/4.6/bits/basic_string.h:2693:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) /usr/include/opencv2/core/mat.hpp:2072:1: note: template<class _Tp, class T2> cv::MatCommaInitializer_<_Tp> cv::operator<<(const cv::Mat_<_Tp>&, T2) /usr/include/opencv2/core/operations.hpp:3832:52: note: template<class _Tp> std::ostream& cv::operator<<(std::ostream&, const std::vector<cv::Point3_<_Tp> >&) /usr/include/opencv2/core/operations.hpp:3824:52: note: template<class _Tp> std::ostream& cv::operator<<(std::ostream&, const std::vector<cv::Point_<_Tp> >&) /usr/include/opencv2/core/operations.hpp:3817:29: note: std::ostream& cv::operator<<(std::ostream&, const cv::Formatted&) /usr/include/opencv2/core/operations.hpp:3817:29: note: no known conversion for argument 2 from ‘cv::Size’ to ‘const cv::Formatted&’ /usr/include/opencv2/core/operations.hpp:3804:29: note: std::ostream& cv::operator<<(std::ostream&, const cv::Mat&) /usr/include/opencv2/core/operations.hpp:3804:29: note: no known conversion for argument 2 from ‘cv::Size’ to ‘const cv::Mat&’ /usr/include/opencv2/core/operations.hpp:3773:45: note: template<class _Tp> std::ostream& cv::operator<<(std::ostream&, const cv::Point3_<_Tp>&) /usr/include/opencv2/core/operations.hpp:3765:45: note: template<class _Tp> std::ostream& cv::operator<<(std::ostream&, const cv::Point_<_Tp>&) /usr/include/opencv2/core/operations.hpp:2892:28: note: cv::FileStorage& cv::operator<<(cv::FileStorage&, const char*) /usr/include/opencv2/core/operations.hpp:2892:28: note: no known conversion for argument 1 from ‘std::basic_ostream<char>’ to ‘cv::FileStorage&’ /usr/include/opencv2/core/operations.hpp:2890:25: note: cv::FileStorage& cv::operator<<(cv::FileStorage&, const string&) /usr/include/opencv2/core/operations.hpp:2890:25: note: no known conversion for argument 1 from ‘std::basic_ostream<char>’ to ‘cv::FileStorage&’ /usr/include/opencv2/core/operations.hpp:2878:51: note: template<class _Tp> cv::FileStorage& cv::operator<<(cv::FileStorage&, const _Tp&) /usr/include/opencv2/core/operations.hpp:1470:30: note: template<class _Tp, class _T2, int cn> cv::VecCommaInitializer<_Tp, cn> cv::operator<<(const cv::Vec<_Tp, n>&, _T2) /usr/include/opencv2/core/operations.hpp:1102:33: note: template<class _Tp, class _T2, int m, int n> cv::MatxCommaInitializer<_Tp, m, n> cv::operator<<(const cv::Matx<_Tp, n, nm>&, _T2) CMakeFiles/video_recorder.dir/build.make:54: recipe for target 'CMakeFiles/video_recorder.dir/src/nodes/video_recorder.cpp.o' failed make[2]: *** [CMakeFiles/video_recorder.dir/src/nodes/video_recorder.cpp.o] Error 1 CMakeFiles/Makefile2:1076: recipe for target 'CMakeFiles/video_recorder.dir/all' failed make[1]: *** [CMakeFiles/video_recorder.dir/all] Error 2 Makefile:123: recipe for target 'all' failed make: *** [all] Error 2 pi@raspberrypi ~/ros_catkin_ws/build_isolated/image_view $ make


Originally posted by kenrobinson on ROS Answers with karma: 38 on 2015-02-28

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

So I found the cause of the problem. The Size template has no operator <<. I changed the code to access the members width and height.

ROS_INFO_STREAM("Starting to record " << codec << " video at width " << size.width << " height " <<
size.height << "@" << fps << "fps. Press Ctrl+C to stop recording." );

I am still confused how the Size type gets to use these methods in Size_. Is there some typedef elsewhere? This is in /usr/include/opencv2/core/core.hpp

//////////////////////////////// Size_ ////////////////////////////////

/*!
The 2D size class

The class represents the size of a 2D rectangle, image size, matrix size etc.
Normally, cv::Size ~ cv::Size_ is used.
*/ template class CV_EXPORTS Size_ { public: typedef _Tp value_type;

//! various constructors                                                                                                  
Size_();
Size_(_Tp _width, _Tp _height);
Size_(const Size_& sz);
Size_(const CvSize& sz);
Size_(const CvSize2D32f& sz);
Size_(const Point_<_Tp>& pt);

Size_& operator = (const Size_& sz);
//! the area (width*height)                                                                                               
_Tp area() const;

//! conversion of another data type.                                                                                      
template<typename _Tp2> operator Size_<_Tp2>() const;

//! conversion to the old-style OpenCV types                                                                              
operator CvSize() const;
operator CvSize2D32f() const;

_Tp width, height; // the width and the height                                                                            

};

I guess I do a patch now and submit to the maintainer?


Originally posted by kenrobinson with karma: 38 on 2015-02-28

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Wedigo on 2015-08-10:
Hi,

first: thanks for finding this solution, I had the same problem, but for compiling I had to use

" height " << size.height

instead off

" height " <<\ size.height

$\endgroup$

Your Answer

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