Migration from tf_prefix

60 views
Skip to first unread message

Jack O'Quin

unread,
Jul 19, 2013, 1:21:19 PM7/19/13
to ros-s...@googlegroups.com
The tf2 migration guide for Hydro states that tf_prefix is no longer supported.

 http://www.ros.org/wiki/hydro/Migration#tf2.2BAC8-Migration.Removal_of_support_for_tf_prefix

I agree that tf_prefix is hard to use correctly and often botched. But, there were cases where it was necessary and solved problems.

What happens to code using tf_prefix in Hydro? Will it still work via the tf version one interfaces? 
--
 joq

Tully Foote

unread,
Jul 19, 2013, 3:51:03 PM7/19/13
to ros-s...@googlegroups.com
So it should keep working in the cases where tf_prefix was previously used.  

The basic premise of the migration is that people used to refer to "my_frame" which was resolved to "/my_frame" or "/my_prefix/my_frame" if the prefix was present

In tf2 whatever string you pass in is your frame_id. So "my_frame" is simply "my_frame" and "/my_frame" would be a different frame_id.  To avoid silent failures tf2 does not accept frame_ids starting with "/" with an tf2::InvalidArgument exception.  

Anyone using the tf::Transformer interface will have the "/" stripped from the frame_id before it is passed to tf2 under the hood.  

To maintain backwards compatability with usages of tf_prefix, tf::resolve has been modified to always return frame_ids without a leading slash, but still does the prefixing.  So tf::resolve "/map" resolves to "map" or "my_prefix/map" if a tf_prefix is set.  This has the consequence that if you call tf::resolve multiple times it will get multiply prefixed.  However calling tf::resolve multiple times is not known to be used in code and is not expected practice.  

All communication on the wire is done by tf2 and the messages will be without the slash.  

The longer term solution to replace tf_prefix is to provide methods for selectively republishing tf transforms, likely with a prefix from one robot to another, probably between masters as well.  And at the same time rewriting any frame_ids transferred between the robots to have the prefixed frame_id.  The development time for these tools unfortunately has not been found yet.  

Tully



--
You received this message because you are subscribed to the Google Groups "ROS tf Special Interest Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-tf+...@googlegroups.com.
To post to this group, send email to ros-s...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ros-sig-tf/CAB6SgyWX5cozMHaES6_22q%3D7bUoDusceYcJTGoq_AwppY-r1hQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jack O'Quin

unread,
Jul 19, 2013, 4:41:10 PM7/19/13
to ros-s...@googlegroups.com
Thanks for the explanation.

So, it sounds like most valid, existing tf_prefix uses should still work correctly using tf::resolve. At least some of that should probably be added to the migration guide...

--
 joq
Reply all
Reply to author
Forward
0 new messages