0
$\begingroup$

Rosanswers logo

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">
  <parent link="ref_58_link_hub"/>
  <child link="ref_60_link"/>
  <origin xyz="-0.0135999953902 6.27180865763e-08 0.00020025516928" rpy="3.14159265343 1.5396542947e-05 -1.04458704296e-05" />
  <axis xyz="0 0 0" />
</joint>

Now let's see what rosrun tf tf_echo /ref_58_link_hub /ref_60_link returns:

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.


Originally posted by Capelare on ROS Answers with karma: 202 on 2012-03-27

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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 roslib; roslib.load_manifest('package_name')
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:
        (trans,rot) = listener.lookupTransform('/ref_58_link_hub', '/ref_60_link', rospy.Time(0))
        print trans, rot
    except (tf.LookupException, tf.ConnectivityException):
        continue

    rate.sleep()

Originally posted by David Lu with karma: 10932 on 2012-03-28

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Capelare on 2012-03-28:
That's a great idea, thx! :)

Comment by Reza Ch on 2013-03-21:
What about printing this data in C++. How to write this code in C++ ?

$\endgroup$
0
$\begingroup$

Rosanswers logo

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 .


Originally posted by David Lu with karma: 10932 on 2012-03-27

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by Capelare on 2012-03-28:
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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.