Ask Your Question
0

Can TransformListener get the transformation of an indirect child

asked 2019-02-27 08:20:14 -0600

antoineniotna gravatar image

I am using a tf::TransformListener listener to get the transformation between two frame in my c++ program. My tf Tree is as follow Parent -> Child1 ->Child2 . I am using the following line to get the transformation between Parent to Child1:

listener.lookupTransform(frame_parent, frame_child1, ros::Time(0), transform);

When I am displaying the /tf topic with rostopic echo /tf, I can see a transformation for Parent -> Child1 and a transformation from Child1 -> Child2.

My question is, can I get the transformation from Parent -> Child2 ? Can the TransformListener return a combination of transformations ? I wrote something like this:

listener.lookupTransform(frame_parent, frame_child2, ros::Time(0), transform);
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-02-27 08:37:15 -0600

gvdhoorn gravatar image

updated 2019-02-27 08:46:31 -0600

can I get the transformation from Parent -> Child2 ? Can the TransformListener return a combination of transformations ?

In short: yes, it can.

In fact: you can lookup transforms from any frame in your tree to any other frame in the tree, both forward and inverse. Doesn't matter how many intermediate frames there are.

This is one of the things that makes TF such a useful library (if it couldn't, it would essentially be just a very convoluted transformation matrix hashmap).

edit flag offensive delete link more

Comments

Simple and clear! Thank you

antoineniotna gravatar imageantoineniotna ( 2019-02-27 08:51:57 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-02-27 08:20:14 -0600

Seen: 17 times

Last updated: Feb 27