Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 98

Comment by Mehdi. for hey guys, i have problems with using opencv in ros. i followed the cv_bridge tutorial but when catkin_make. it gives me strange error. How did you setup Cmakelist file and package.xml? How to add dependency for opencv2 . The tutorial is not clear on this > "CMakeFiles/color.dir/src/color.cpp.o: > In function > `ImageConverter::ImageConverter()': > color.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0x8f): > undefined reference to > `image_transport::ImageTransport::ImageTransport(ros::NodeHandle > const&)' > color.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0x375): > undefined reference to > `image_transport::ImageTransport::advertise(std::string > const&, unsigned int, bool)' > color.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0x584): > undefined reference to > `image_transport::ImageTransport::~ImageTransport()' > CMakeFiles/color.dir/src/color.cpp.o: > In function > `ImageConverter::~ImageConverter()': > color.cpp:(.text._ZN14ImageConverterD2Ev[_ZN14ImageConverterD5Ev]+0x49): > undefined reference to > `image_transport::ImageTransport::~ImageTransport()' > color.cpp:(.text._ZN14ImageConverterD2Ev[_ZN14ImageConverterD5Ev]+0x9a): > undefined reference to > `image_transport::ImageTransport::~ImageTransport()' > CMakeFiles/color.dir/src/color.cpp.o: > In function > `ImageConverter::imageCb(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > > const> const&)': > color.cpp:(.text._ZN14ImageConverter7imageCbERKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEE[_ZN14ImageConverter7imageCbERKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEE]+0x3f): > undefined reference to > `cv_bridge::toCvCopy(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > > const> const&, std::string const&)' > color.cpp:(.text._ZN14ImageConverter7imageCbERKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEE[_ZN14ImageConverter7imageCbERKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEE]+0x187): > undefined reference to > `cv_bridge::CvImage::toImageMsg() > const' > color.cpp:(.text._ZN14ImageConverter7imageCbERKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEE[_ZN14ImageConverter7imageCbERKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEE]+0x1ba): > undefined reference to > `image_transport::Publisher::publish(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > > const> const&) const' > CMakeFiles/color.dir/src/color.cpp.o: > In function > `image_transport::Subscriber > image_transport::ImageTransport::subscribe<ImageConverter>(std::string > const&, unsigned int, void > (ImageConverter::*)(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > > const> const&), ImageConverter*, image_transport::TransportHints > const&)': > color.cpp:(.text._ZN15image_transport14ImageTransport9subscribeI14ImageConverterEENS_10SubscriberERKSsjMT_FvRKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEEEPS6_RKNS_14TransportHintsE[_ZN15image_transport14ImageTransport9subscribeI14ImageConverterEENS_10SubscriberERKSsjMT_FvRKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEEEPS6_RKNS_14TransportHintsE]+0xa4): > undefined reference to > `image_transport::ImageTransport::subscribe(std::string > const&, unsigned int, > boost::function<void > (boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > > const> const&)> const&, boost::shared_ptr<void> const&, > image_transport::TransportHints > const&)' > collect2: error: ld returned 1 exit status > make[2]: *** [/home/dmngu9/fyp_ws/devel/lib/color_tracking/color] > Error 1 > make[1]: *** [color_tracking/CMakeFiles/color.dir/all] > Error 2 > make: *** [all] Error 2 > Invoking "make -j4 -l4" failed > "

Next: Comment by dmngu9 for hey guys, i have problems with using opencv in ros. i followed the cv_bridge tutorial but when catkin_make. it gives me strange error. How did you setup Cmakelist file and package.xml? How to add dependency for opencv2 . The tutorial is not clear on this > "CMakeFiles/color.dir/src/color.cpp.o: > In function > `ImageConverter::ImageConverter()': > color.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0x8f): > undefined reference to > `image_transport::ImageTransport::ImageTransport(ros::NodeHandle > const&)' > color.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0x375): > undefined reference to > `image_transport::ImageTransport::advertise(std::string > const&, unsigned int, bool)' > color.cpp:(.text._ZN14ImageConverterC2Ev[_ZN14ImageConverterC5Ev]+0x584): > undefined reference to > `image_transport::ImageTransport::~ImageTransport()' > CMakeFiles/color.dir/src/color.cpp.o: > In function > `ImageConverter::~ImageConverter()': > color.cpp:(.text._ZN14ImageConverterD2Ev[_ZN14ImageConverterD5Ev]+0x49): > undefined reference to > `image_transport::ImageTransport::~ImageTransport()' > color.cpp:(.text._ZN14ImageConverterD2Ev[_ZN14ImageConverterD5Ev]+0x9a): > undefined reference to > `image_transport::ImageTransport::~ImageTransport()' > CMakeFiles/color.dir/src/color.cpp.o: > In function > `ImageConverter::imageCb(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > > const> const&)': > color.cpp:(.text._ZN14ImageConverter7imageCbERKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEE[_ZN14ImageConverter7imageCbERKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEE]+0x3f): > undefined reference to > `cv_bridge::toCvCopy(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > > const> const&, std::string const&)' > color.cpp:(.text._ZN14ImageConverter7imageCbERKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEE[_ZN14ImageConverter7imageCbERKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEE]+0x187): > undefined reference to > `cv_bridge::CvImage::toImageMsg() > const' > color.cpp:(.text._ZN14ImageConverter7imageCbERKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEE[_ZN14ImageConverter7imageCbERKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEE]+0x1ba): > undefined reference to > `image_transport::Publisher::publish(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > > const> const&) const' > CMakeFiles/color.dir/src/color.cpp.o: > In function > `image_transport::Subscriber > image_transport::ImageTransport::subscribe<ImageConverter>(std::string > const&, unsigned int, void > (ImageConverter::*)(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > > const> const&), ImageConverter*, image_transport::TransportHints > const&)': > color.cpp:(.text._ZN15image_transport14ImageTransport9subscribeI14ImageConverterEENS_10SubscriberERKSsjMT_FvRKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEEEPS6_RKNS_14TransportHintsE[_ZN15image_transport14ImageTransport9subscribeI14ImageConverterEENS_10SubscriberERKSsjMT_FvRKN5boost10shared_ptrIKN11sensor_msgs6Image_ISaIvEEEEEEPS6_RKNS_14TransportHintsE]+0xa4): > undefined reference to > `image_transport::ImageTransport::subscribe(std::string > const&, unsigned int, > boost::function<void > (boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > > const> const&)> const&, boost::shared_ptr<void> const&, > image_transport::TransportHints > const&)' > collect2: error: ld returned 1 exit status > make[2]: *** [/home/dmngu9/fyp_ws/devel/lib/color_tracking/color] > Error 1 > make[1]: *** [color_tracking/CMakeFiles/color.dir/all] > Error 2 > make: *** [all] Error 2 > Invoking "make -j4 -l4" failed > "
$
0
0
@dmngu9 and that is why you should always answer your own question if you solve your problems !!

Viewing all articles
Browse latest Browse all 98