0
$\begingroup$

Rosanswers logo

Message filters are handy when you want to only fire callbacks if a transform is available for the data contained therein. The user sets the target frame_id, and presumably the source frame_id is derived from the message's header.

However, nav_msgs/Odometry messages contain both pose and twist data, with the former being in the message header's frame_id, and the latter being in the message's child_frame_id. Even if no transform exists for the pose data, there may be a transform for the twist data. I can't just set up another filter with the target child_frame_id, as the message filter will then look for a transform from the odometry message's frame_id (i.e., pose data frame) to the target child_frame_id, which will probably not make any sense.

Do I have any recourse here? Clearly, I can just fire all the callbacks and check for the transform availability myself, but I'm guessing I'm going to lose some efficiency that way.


Originally posted by Tom Moore on ROS Answers with karma: 13689 on 2014-10-01

Post score: 0


Original comments

Comment by Tom Moore on 2014-10-01:
I already break each odometry message into a pose message and a twist message and then manually call their callbacks; I suppose I can manually add those sub-messages to their respective message filters instead. Still, if there's a cleaner way, I'd like to hear it.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

In this case I'd suggest that you create two tf::MessageFIlters, one for each datatype and callback. Then when you recieve the aggregate message, create the individual messages and add them to the respective MessageFilter.


Originally posted by tfoote with karma: 58457 on 2014-10-01

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Tom Moore on 2014-10-01:
Doing exactly that. Thanks!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.