Getting odom transform same as RVIZ (Python)
Hi, I'm trying to get the XYZ position of the odom frame. In particular I just want the xy position, not fussed about height change (z). As you can see in the picture, only one of the values is close, the others are quite off.
The code I'm using to get the XYZ seen in the console (only relevant lines):
tf_listener = tf.TransformListener()
try:
(trans, rot) = tf_listener.lookupTransform('/imu_link', '/odom', rospy.Time(0))
except (tf.LookupException, tf.ConnectivityException, tf.ExtrapolationException):
continue
rospy.loginfo(trans)
Also RVIZ Global Fixed Frame was set to Velodyne (Using a Husky with Velodyne sensor).
I'm sure it can't be too difficult but if anyone could show me ow to exactly get the odom-position information that RVIZ is showing, that'd be great
Using Ubuntu 16.04, Kinetic.
All right, could you, please, send us the rqt_graph screenshot of your application? This to see if what are the available transformations and "who" is providing the odom transform.
Here is the rqt_graph screenshot, and also output of
rosrun tf view_frames
here.Not 100% sure, but I guess
rviz
is showing the positions w.r.t. thefixed_frame
. Thus, if you want to have the same transforms, maybe try to change thefixed_frame
toimu_link
to check if the positions then match.