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

The arduino libraries for rosserial are significantly more limited than roscpp running on Linux. boost isn't available, so you can't use things like boost::bind to pass additional arguments to your subscriber.

It looks like you want to have two subscribers with different types, and you want you callback called when one or both of these subscribers gets new data. (The question you linked to is a different case; asking about using the same argument in a callback to process data from different subscribers).

On a Linux system, you can do something like what you're asking about with message_filters synchronizers, but that package doesn't exist for rosserial on arduino.

To be honest, I'm not sure that there's a way to do what you're asking on an Arduino. It's probably better to do the message synchronization on the PC side, publish the synchronized data on a single topic, and have the arduino subscribe to that topic.