tf2: The future of tf
Tully Foote

ROSCon May 11th 2013

Outline

12

What is tf2
Implementation
Early Adopter of tf2
Looking Forward
Outstanding Work

Tully Foote (OSRF)

tf2: The future of tf

ROSCon May 11th 20132 / 16

What is tf2
A refinement of tf• Cleaner dependencies••

Templated API
Seperation of ROS and non ROS components• First class support for python at the ROS level• Remote querying mechanism not requiring full tf

stream• Support for static transforms

Tully Foote (OSRF)

tf2: The future of tf

ROSCon May 11th 20133 / 16Implementation• Templated TransformData method• Templated conversion methods• Internalized transform math• Cleanly separated ROS and non-ROS components• Action based remote query API• Seperate /tf static topic• Removed support for tf namespacing (tf prefix)

Tully Foote (OSRF)

tf2: The future of tf

ROSCon May 11th 2013

4 / 16

Data Conversions
If all messages define toMsg and fromMsg staticmethods.

#include ‘‘tf2_bullet/tf2_bullet.h’’#include ‘‘tf2_geometry_msgs/tf2_geometry_msgs.h#include ‘‘tf2_kdl/tf2_kdl.h’’
tf2::Stamped<btVector3> b(btVector3(1,2,3),
ros::Time(), ‘‘my_frame’’);geometry_msgs::Vector3Stamped m;
tf2::convert(b, m);
tf2::Stamped<KDL::Vector> k;
tf2::convert(b, k);
Tully Foote (OSRF)

tf2: The future of tf

ROSCon May 11th 2013

5 / 16

Transform Any Datatype
If a template specialization for doTransform<T> exists.
You can simply use the following:
T& transform(T& in,string& target_frame, Time& target_time,string& fixed_frame, Duration timeout=0.0)
Combine templated API and conversion:
B& transform(const A& in, B& out,string& target_frame, Duration timeout=0.0)

Tully Foote (OSRF)

tf2: The future of tf

ROSCon May 11th 20136 / 16

Static Transforms• Latched topic /tf static• Published once
• Assumed to be not changing therefore no time

history stored.

Tully Foote (OSRF)

tf2: The future of tf

ROSCon May 11th 20137 / 16

Remote Query
Provide an action based remote query capability, giving
client/server model. This has benefits including:• Allow one process with a longer history• Background monitoring scripts do not require a /tf

subscription• Enable querying of tf data from offboard the robot
over low bandwidth links (aka wireless)

Tully Foote (OSRF)

tf2: The future of tf

ROSCon May 11th 20138 / 16

pr2 plugs

A test deployment to verifythings• Verified correctness• Verified robustness

Tully Foote (OSRF)

tf2: The future of tf

ROSCon May 11th 20139 / 16

Robot Web Tools
Using transforms on the web

Major considerations• Bandwidth• Low level API access

Tully Foote (OSRF)

tf2: The future of tfROSCon May 11th 201310 / 16

Outline

12

What is tf2
Implementation
Early Adopter of tf2
Looking Forward
Outstanding Work

Tully Foote (OSRF)

tf2: The future of tf

ROSCon May 11th 201311 / 16

Dealing with partitioned networks

Major considerations• Bandwidth between
robots• Disambiguating similar
robots

Tully Foote (OSRF)

tf2: The future of tf

ROSCon May 11th 201312 / 16

Proxying tf data
What parameters are important?
• What are the frames of interest?
• How are frames on one robot connected to theother robots?
• What update rate is required?
• How to balance bandwidth vs update rate?
• What latency is tolerable?

Tully Foote (OSRF)

tf2: The future of tf

ROSCon May 11th 201313 / 16

Multi Robot

Tully Foote (OSRF)

tf2: The future of tf

ROSCon May 11th 201314 / 16

Multi Robot
Robot 1
Topics: /tf & /scan
Cordinate Frame: base link

Robot 2
Topics: /tf & /scan
Cordinate Frame: base link

How do you merge them?
• Forward /tf from one robot to another, rewrite

frame ids (base link becomes robot1 base link)• Forward any data and rewrite specified fields whichcontains frame ids (requires semantic interpretation)

Tully Foote (OSRF)

tf2: The future of tf

ROSCon May 11th 201315 / 16

Questions

Questions?
For full documentation see:
http://www.ros.org/wiki/tf2

Tully Foote (OSRF)

tf2: The future of tf

ROSCon May 11th 201316 / 16