Create a subscriber to an Image topic
Hi, Im trying to wrtie a node that subscribes to a image topic, however, after almost copying the ros tutorial, I keep getting an error. The relevant parts of my code are:
ros::NodeHandle nh;
image_transport::ImageTransport it(nh);
image_transport::Subscriber sub;
sub=it.subscribe("/sensors/camera/top/image_raw",1, Imtest::callbackSubscriber);
And my callback is:
void Imtest::callbackSubscriber(const sensor_msgs::ImageConstPtr& msg)
The error I get is:
/home/kal3-5/workspaces/my_first_ws/src/imtest_ros_tool/src/imtest/imtest.cpp:41:83: error: invalid use of non-static member function
sub=it.subscribe("/sensors/camera/top/image_raw",1, Imtest::callbackSubscriber);
My version of ROS is Kinetic, Ubuntu 16.04