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

Why does world frame get TF prefix?

asked 2019-10-05 11:38:55 -0500

mkb_10062949 gravatar image

Hello I am working with two UR5, I made them launch using <group ns="robot1"> and <group ns="robot2">. I also gave a unique tf_prefix to each robot within the group namespace tag i.e. <param name="tf_prefix" value="robot1_tf" /> and <param name="tf_prefix" value="robot2_tf" />. After running the launch file what I notice in the rqt_tf_tree is that the "world frame" also gets a namespace i.e. robot1_tf/world followed by robot1_tf/baselink and all the other joints of robot1 ............... And then robot2_tf/world and then robot2_tf/base_link 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???

edit retag flag offensive close merge delete

Comments

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

Angel-J gravatar image Angel-J  ( 2019-11-07 03:46:38 -0500 )edit

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()
mkb_10062949 gravatar image mkb_10062949  ( 2019-11-07 08:23:56 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2021-09-01 08:10:43 -0500

rbtcs1101 gravatar image

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.

edit flag offensive delete link more
0

answered 2019-10-07 02:27:57 -0500

gvdhoorn gravatar image

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'.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2019-10-05 11:38:55 -0500

Seen: 1,232 times

Last updated: Oct 07 '19