Calling a callback function in a class method with multiple arguments
Hi, I have a callback function as a class method in a nodelet. While the callback function had a single argument
void nodelet_class::ReceiveA1(const sensor_msgs::ImageConstPtr& image)
this is how I called it:
A1_subscriber = it_->subscribe(image_color", 1, boost::bind(&nodelet_class::ReceiveA1, this, _1));
For multiple argument like this:
void nodelet_class::ReceiveA1(const sensor_msgs::ImageConstPtr& image, image_transport::Publisher image_pub_);
how do I use boost::bind? I tried doing something like this:
A1_subscriber = it_->subscribe("image_color", 1, boost::bind(&nodelet_class::ReceiveA1, this, _1, image_pub_A1));
but this resulted in an error. Here, image_pub_A
is a publisher object:
image_pub_A1 = it_p_->advertise("image_publish", 1);
What is the error? Put it into the question using the preformatted text option (the 010101 button).