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

How to get the position of tf frame

asked 2023-05-03 07:20:48 -0600

TapleFlib gravatar image

How to get the position of the tf frame (child frame in rviz) , when I use tf.TransformListener().lookupTransform(parent_link, child_link, rospy.Time()) I get the relative position and relative orientation and not position and orientation, how to get the position and orientation using python script?

image description

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-05-03 11:42:37 -0600

tfoote gravatar image

All positions are measured relative to some reference frame. I believe that the rviz display is showing the position compared to your configured 'world' frame setting. And the position relative to the parent.

If you call lookupTransform(parent_link, child_link, Time(0)) You're explicitly asking for the transform between parent and child.

You wan to use lookupTransform(world_frame, child_link, TIme(0)) to get the latest transform from the world frame to the child link which I think is what you're considering non-relative position. You have to pick your reference to be able to do that.

edit flag offensive delete link more

Comments

Got it thanks so much !

TapleFlib gravatar image TapleFlib  ( 2023-05-09 09:49:30 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2023-05-03 07:20:48 -0600

Seen: 1,060 times

Last updated: May 03 '23