ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I would suggest you create two callbacks. Each callback calls your original callback, but with an argument, which stream to process.

Another possible solution could be looking at the connection header of the image_raw message.

I would suggest you create two callbacks. Each callback calls your original callback, but with an argument, which stream to process.

For example:

void callback1(image_raw foo)
{
    originalCallback(foo, 1);
}

void callback2(image_raw foo)
{
    originalCallback(foo, 2);
}

void originalCallback(image_raw bar, int callerId)
{
    if(callerId == 1)
    {}
    else
    {}
}

Another possible solution could be looking at the connection header of the image_raw message.