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

Local Object pose from Camera pose

asked 2020-08-31 11:03:55 -0500

Jt3d gravatar image

updated 2020-09-02 05:37:45 -0500

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?

edit retag flag offensive close merge delete

Comments

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 of obj to any other frame.

gvdhoorn gravatar image gvdhoorn  ( 2020-09-01 02:39:50 -0500 )edit

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?

Jt3d gravatar image Jt3d  ( 2020-09-01 05:02:10 -0500 )edit

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)

Jt3d gravatar image Jt3d  ( 2020-09-02 04:56:57 -0500 )edit

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.

fvd gravatar image fvd  ( 2020-09-02 05:06:23 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2020-09-09 22:23:59 -0500

fvd gravatar image

If you know the position and rotation of your object relative to the camera frame, transforming it to your world frame is easiest with TF. Define your object's pose as a PoseStamped object, set the frame_id of the object's pose to be your camera's frame (the optical or depth frame).Then use the transformPose function of your TransformListener to transform it to your workspace.

You need to have an extrinsic calibration of your camera, i.e. defined its pose in your scene/URDF for TF to be able to calculate the transformation.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-08-31 11:03:55 -0500

Seen: 676 times

Last updated: Sep 09 '20