The key here is understanding that with /tf
the geometry of your system must be specified as a tree. Importantly, every frame can have unlimited children, but only a single parent. The edges between the nodes in the tree are the transform information from the parent to the child. There is no concept of "world" frame, unless you specifically add a "world" frame to your tree.
For your system, there are several ways you could specify the geometry of your robot:
- You could arbitrarily choose one of your laser frames to be the "root" of your tree. For example, let's choose
hokuyo1_frame
as the root. Then you would want to create two static transform publishers; one from hokuyo1_frame
-> hokuyo2_frame
and one from hokuyo1_frame
->Scanner_frame1
. Alternatively the second transform could go from hokuyo2_frame
->Scanner_frame1
. It doesn't matter as long as all 3 frames are in your tree, and none of the frames has more than one parent.
- If you would like your robot to have a
base_link
frame, then you could make that the root of your tree, and then specify static transforms from base_link
to all three laser frames.
- Probably the most-standard way of doing this is to create a URDF that represents the geometry of your robot and lasers, and then use the robot_state_publisher to send the
/tf
information.
Originally posted by jarvisschultz with karma: 9031 on 2015-11-24
This answer was ACCEPTED on the original site
Post score: 3
Original comments
Comment by schultza on 2015-11-25:
Hi, thanks jarvis for you nice summary! Really good, I really like option 2) and 3), could you provide some more information on how to create a baselink as center of my robot? I will try to create a URDF file of my robot and use it with robot_state_pub but still want to keep an eye on 2) :)
Comment by schultza on 2015-11-25:
I accomplished to build my own urdf and let a joint_state_publisher and robot_state_publisher run, but now i dont know what to do with the real coordinate frames on my real system as mentionend above the 3 laser scanners