# Exact relative position between two links

Hi! I'll be blunt...

I used LDD and lxf2urdf to build a robot and I want to change the parent of some of the links because I need certain parts to be independent of the rest of the robot (e.g. the back wheel) if I intend to make some of the joints continuous.

I tried using rviz to select the links and see their relative position, but I found that those numbers aren't precise enough. So how do I know the relative position between two links with the maximum possible precision?

I didn't find any questions regarding this, excuse me if I just couldn't find them! :(

Update:

For example, let's take a random joint from my .urdf file:

<joint name="ref_70_joint" type="fixed">
<origin xyz="-0.0135999953902 6.27180865763e-08 0.00020025516928" rpy="3.14159265343 1.5396542947e-05 -1.04458704296e-05" />
<axis xyz="0 0 0" />
</joint>


At time 1332949971.511
- Translation: [0.014, 0.000, -0.000]
- Rotation: in Quaternion [0.000, -0.000, 1.000, -0.000]
in RPY [-3.142, -0.000, -0.000]


As you can see I only get three decimal digits, just like rviz.

edit retag close merge delete

Sort by ยป oldest newest most voted

I've got a better idea. Just write a simple node that uses a TransformListener and print out that information directly. Ideally, someone would write a patch for tf_echo so that precision can be specified...

#!/usr/bin/python

import rospy
import tf

if __name__ == '__main__':
rospy.init_node('tf_a')
listener = tf.TransformListener()

rate = rospy.Rate(10.0)
while not rospy.is_shutdown():
try:
print trans, rot
except (tf.LookupException, tf.ConnectivityException):
continue

rate.sleep()

more

That's a great idea, thx! :)

( 2012-03-28 08:52:10 -0500 )edit

What about printing this data in C++. How to write this code in C++ ?

( 2013-03-21 02:52:46 -0500 )edit

I'm not sure how precisely you're seeing the relative position of the links in rviz. However, what I would do is use rosrun tf tf_echo one_frame two_frame which should give you the numbers with all the available precision, I think .

more

Thanks for your reply, but I think that doesn't show all the precision either. I'm going to update the question with an example.

( 2012-03-28 05:54:02 -0500 )edit