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

Revision history [back]

Assuming your encoder messages have headers with time stamps, it doesn't really matter if the messages are actually published at the same time as long as the time stamp field is set to the same value for each. The exact TimeSynchronizer will consider them to have happened at the same time provided they aren't received too far apart in time.

Alternatively publish the two encoders in a single message with two fields and skip the synchronizer subscriber.

If the encoders aren't in fact being captured at the same time at the hardware level then it is questionable to force the synchronization, you'd rather timestamp them as accurately as possible. If your encoders later get turned into for example angles that are reflected in the tf tree you could use the tf interpolation to get reasonable intermediate angles that are decently accurate for a certain instant in time.