Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Translate from Camera frame of view to Base frame in Cartesian coordinates

I'm using TF2_ROS for translations. I have a camera on the end of a mechanical arm on my end effector. I calculate a known distance from that camera and would like to move the end effector into that point that is in the cameras frame of view.

I guess my problem is I'm not perfectly understanding what the lookup_transform function of the tf2 buffer interface is doing. My arm is fixed so i'm finding its location relative to the world. My end effector is link_5.

tf_buffer.lookup_transform("world","link_5", rospy.Time, rospy.Duration(10))

This returns the same output as rosrun tf tfecho /world /link_5 so I know this part is correct.

I'm getting an output in x y z and a rotation output of x y z w.

The point I'm getting after calling lookup transform would be exactly the same if I would just query the point of the end effector from the world frame.

How do I actually go about adding the distances to my /link_5 coordinate system then using tf to translate them back into the world coordinate system?

Do I need to make a geometry messge, take the rotation angle from my camera and set them for xyzw, and then set the extra distances to the x y z translation then pass it to tf2? Is tf2 maybe not the correct type of package for this? If so, are there any recommended packages or should I write this myself?