# Update

Hey I have the following subscriber on Nvidia TX1 board running on an agricultural robot. we have the following issue with subscribing to Sensor_msgs::Compressed:

ImageConverter(ros::NodeHandle &n) :  n_(n), it_(n_)
{

cv::namedWindow(OPENCV_WINDOW);
image_transport::TransportHints TH("compressed");
image_sub_compressed.subscribe(n,"/Logitech_webcam/image_raw/compressed",5,&ImageConverter::imageCallback,ros::VoidPtr(),TH);
}


And the callback function

void imageCallback(const sensor_msgs::CompressedImageConstPtr& msg)


When I compile this I get an error:

from /home/johann/catkin_ws/src/uncompressimage/src/publisher_uncompressed_images.cpp:1:
/usr/include/boost/function/function_template.hpp: In instantiation of ‘static void boost::detail::function::function_void_mem_invoker1<MemberPtr, R, T0>::invoke(boost::detail::function::function_buffer&, T0) [with MemberPtr = void (ImageConverter::*)(const boost::shared_ptr<const sensor_msgs::CompressedImage_<std::allocator<void> > >&); R = void; T0 = const boost::shared_ptr<const sensor_msgs::Image_<std::allocator<void> > >&]’:
/usr/include/boost/function/function_template.hpp:934:38:   required from ‘void boost::function1<R, T1>::assign_to(Functor) [with Functor = void (ImageConverter::*)(const boost::shared_ptr<const sensor_msgs::CompressedImage_<std::allocator<void> > >&); R = void; T0 = const boost::shared_ptr<const sensor_msgs::Image_<std::allocator<void> > >&]’
/usr/include/boost/function/function_template.hpp:722:7:   required from ‘boost::function1<R, T1>::function1(Functor, typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type) [with Functor = void (ImageConverter::*)(const boost::shared_ptr<const sensor_msgs::CompressedImage_<std::allocator<void> > >&); R = void; T0 = const boost::shared_ptr<const sensor_msgs::Image_<std::allocator<void> > >&; typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type = int]’
/usr/include/boost/function/function_template.hpp:1069:16:   required from ‘boost::function<R(T0)>::function(Functor, typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type) [with Functor = void (ImageConverter::*)(const boost::shared_ptr<const sensor_msgs::CompressedImage_<std::allocator<void> > >&); R = void; T0 = const boost::shared_ptr<const sensor_msgs::Image_<std::allocator<void> > >&; typename boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value, int>::type = int]’
/home/johann/catkin_ws/src/uncompressimage/src/publisher_uncompressed_images.cpp:27:126:   required from here


The red error statement was:

/usr/include/boost/function/function_template.hpp:225:11: error: no match for call to ‘(boost::_mfi::mf1<void, ImageConverter, const boost::shared_ptr<const sensor_msgs::CompressedImage_<std::allocator<void> > >&>) (const boost::shared_ptr<const sensor_msgs::Image_<std::allocator<void> > >&)’
BOOST_FUNCTION_RETURN(boost::mem_fn(*f)(BOOST_FUNCTION_ARGS));


I am not using BOOST, and searching around hasn't helped me solve it

• this wont be a terribly constructive comment but have you considered using python for your vision processing? – holmeski Jul 19 '16 at 19:29
• @holmeski no sitting on the edge and hoping for some help :) if you can help with a node that subscribes to the compressed message, then it could be a possibility, but my skills are limited with python, but if you could help with a python script of the above I would be truly grateful. – JTIM Jul 19 '16 at 19:45
• So you are trying to subscribe to a ros topic that carries compressed images. Once the callback is triggered you would like to convert that image to a more friendly type of image then publish that back across ROS? – holmeski Jul 20 '16 at 1:10
• @holmeski all other stuff should be possible for me to do on my own :) I wanted to publish as a normal sensor_msgs::image – JTIM Jul 20 '16 at 6:03
• @JTIM - I was in favor of moving the question because you're having trouble with the software. It is called "Robotic" operating system, but it is still a piece of software. For reference, we have 97 questions tagged with 'ros', where StackOverflow has 630. I would argue that, if you're having some trouble with the system interaction, e.g., you're getting unexpected motion or outputs with ROS, then that's a Robotics question. It sounds like you're having compiler errors, which is why I would suggest SO. That said, if you're getting help here then by all means stay :) – Chuck Jul 21 '16 at 19:58