Ask Your Question

Revision history [back]

Passing multiple arguments to a callback. (C++)

Hello,

I am currently in the process of writing a ROS node in C++ that subscribes to an image node, then does some processing from some arguments at the launch of the node that points to a few proprietary libraries.

If I were to write a callback in this format:

void processImagecallback(const sensor_msgs::ImageConstPtr& msg, int argc, char* argv[])

would that work? Or can callbacks only process the topic it is being subscribed to?

I would be calling it from an int main(int argc, char* argv[]) function`.

That should pass it through, right?

I'm rather new to ROS and callbacks.

Thank in advance!