Local Object pose from Camera pose
Hi guys,
As part of testing I need to get the local pose of an object from a camera pose to check for consistency of a vision system.
How would I go about doing this assuming I have the camera pose of the object?
Thanks in advance
Edit: Trying to better explain what I am trying to do
So suppose I have the pose of an object in a 4 x 4 matrix (has translation and rotation information) but it's with respect to my camera frame. Suppose I also have the intrinsic calibration of the camera that was used to find the pose of the object
Now I want to get the object rotation but in it's local coordinate system not in the camera frame coordinate system. Basically I want to know wjhat the rotation is of the object but in it's local coordinate system not with respect to the camera?
What is the math to perform this transformation? Or could a tool like tf / rviz allow me to work this out?
There's very little detail in your question (especially about what nodes you are using, which parts of the ROS infrastructure), but:
If you're using TF, and have ground-truth data for the object pose, you should be able to transform the object pose to any other frame in your TF tree.
So if you have the pose of
obj
in the camera frame, and the camera frame is connected to "the rest" of your TF tree, you can ask a TF listener to transform the pose ofobj
to any other frame.Apologies for the vague question. I’m pretty new to ROS so I have been only using it to write my own nodes to date. I haven’t used tf2 yet but great to know it’s possible to do what I need.
I took a look at the tutorials on the main ros website but they didn’t really go into the detail on how I might set this up. Any better tutorials out there that explain what’s possible with tf2?
OK so I have looked into this a bit more but I am still struggling. I can see how tf works in general but I am not sure how to setup what I need to solve. So let me try and tell you what I understand and maybe someone can nudge me in the right direction
I have the pose of an object in a 4 x 4 matrix (has translation and rotation information) I have the intrinsic calibration off the camera that was used to find the pose of the object Now I want to get the object rotation but in it's local coordinate system not in the camera frame coordinate system
I've looked at rviz and was wondering if there is a way to enter my information into it so that it can perform the transformation I need?
I have a feeling this is pretty easy ...(more)
It is better for posterity to edit your question rather than adding comments. Are you saying you have the 3D pose of the object in the camera coordinate system and you want to transform it to the world? Or are you trying to find the object in your camera image? Please clarify when you update your post.