Robotics StackExchange | Archived questions

Why does world frame get TF prefix?

Hello I am working with two UR5, I made them launch using <group ns="robot1"> and <group ns="robot2">. I also gave a unique tfprefix to each robot within the group namespace tag i.e. `<param name="tfprefix" value="robot1tf" />and<param name="tfprefix" value="robot2tf" />. After running the launch file what I notice in therqttftreeis that the "world frame" also gets a namespace i.e.robot1tf/worldfollowed byrobot1tf/baselinkand all the other joints of robot1 ............... And thenrobot2tf/worldand thenrobot2tf/baselink` and all the other joints of robot2.

But what I want is world frame (without having any namespaces) connecting to robot1_tf/baselink followed by all the joints of robot1............... and also to robot2_tf/baselink followed by all the joints of robot2.............

How do I avoid the world frame to have any namespaces???

Asked by mkb_10062949 on 2019-10-05 11:38:55 UTC

Comments

Have you solved the problem? I am in the same predicament. Can you help me? Please tell me the solution

Asked by Angel-J on 2019-11-07 04:46:38 UTC

yes i did, basically what I did that I created two tf_broadcaster for each of the tf frame i.e for. robot1_tf/world and robot2_tf/world and then I mapped both of them to world frame. Have a look below

#!/usr/bin/env python  
import roslib
roslib.load_manifest('ur5_notebook')

    import rospy
    import tf

    if __name__ == '__main__':
        rospy.init_node('broadcaster_fixed')
        br = tf.TransformBroadcaster()
        rate = rospy.Rate(10.0)
        while not rospy.is_shutdown():
            br.sendTransform((0.0, 2.0, 0.0),
                             (0.0, 0.0, 0.0, 1.0),
                             rospy.Time.now(),
                             "robot1_tf/world",
                             "world")
            rate.sleep()

Asked by mkb_10062949 on 2019-11-07 09:23:56 UTC

Answers

Why does world frame get TF prefix?

Because there is a world frame in the ur5_robot.urdf.xacro file, which most likely gets loaded in both of your groups.

See here. This is also a known issue with these .xacros: ros-industrial/universal_robot#284.

The world frame is not an automatically added frame, it's something that either you, or one of the .xacros that you're loading needs to add.

In fact, it's not even a special frame: it's just a regular TF frame that happens to have a name you/we recognise as being something 'special'.

Asked by gvdhoorn on 2019-10-07 02:27:57 UTC

Comments

You can use static_transform_publisher to add a common world frame as the parent frame of the both tf_prefix/world frames. In each robot group of your launch file, add:

<node name="world2robot" pkg="tf" type="static_transform_publisher" 
      args="0 0 0 0 0 0 /world /<your tf_prefix>/world 100" />

You can change the node name and the transformation between /world and your robot's world frame as you like.

Asked by rbtcs1101 on 2021-09-01 08:10:43 UTC

Comments