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

Static Publisher Z argument not working

asked 2019-06-13 06:48:18 -0600

Jägermeister gravatar image

updated 2019-06-13 07:39:45 -0600

I am trying to establish a link between my camera and the calibration pattern on the workstation. I've got the correct X,Y,Z by hand measurements, and I now want to do the same for the rotation. I figured out everything except the Z value, which is somehow not showing me correct behavior.

rosrun tf static_transform_publisher 0.019 0.393 0.65 4.71239 1.5708 0.0 world camera_link 1000

first_setup

gives the above setup, which requires a bit of rotation around the Z (blue) axis, so that the pattern's Z can correspond to the first circle (right-top) of the pattern, since this is the reference point I want to base it on.

However, even a slight bit of change in the Z value results in a rotation on the totally different axis, which is quite nonsensical. Check out the new command with a bit of shift in the Z value:

  rosrun tf static_transform_publisher 0.019 0.393 0.65 4.71239 1.5708 0.6 world camera_link 1000

second_setup

which rotated around the wrong axis, since this is definitely not around the blue (Z) axis, but rather the red (X).

What's going on?

EDIT: There was a typo in the second command.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2019-06-13 07:09:01 -0600

Your confusion is caused because the rotations are performed one after another, so they are not all performed in the same coordinate system. This question covers this problem better than I can describe it.

Given that you have a 90 degree and greater than 180 degree rotations in your other axes, I would expect the z axis to be rotating around something other than the z axis.

I also noticed that the two static_transform_publisher commands in your question are identical, did you copy and paste the wrong one?

Finally we would normally use a camera calibration process in OpenCV to determine the location of a target automatically, this would then give you the exact transform you need, and it could be far more accurate than anything you can manually measure.

Hope this helps.

edit flag offensive delete link more

Comments

I'm also confused about the need to do this manually.

If OP Is already using a marker (aruco?), then why not use the transform that the marker tracker is broadcasting?

gvdhoorn gravatar image gvdhoorn  ( 2019-06-13 07:24:49 -0600 )edit

@gvdhoorn I couldn't find a proper, well functioning ROS package for finding the camera extrinsics. Most of the packages are not maintained anymore, authors don't respond to errors, etc. If you happen to know any, let me now.

And yes there was a little typo in the second command which I fixed now.

Jägermeister gravatar image Jägermeister  ( 2019-06-13 07:41:13 -0600 )edit

I've used IFL-CAMP/easy_handeye just last week.

There are many more.

But if you're just after the transform between your camera's optical frame and a marker then a simple marker tracking package would suffice.

gvdhoorn gravatar image gvdhoorn  ( 2019-06-13 07:46:31 -0600 )edit

Edit: My ROS version isn't compatible with that package, throwing tons of errors. So I need to find something else. I only want to find out the camera's pose with respect to the marker yes.

Jägermeister gravatar image Jägermeister  ( 2019-06-13 07:47:49 -0600 )edit

You have read the Getting started section, correct?

Anecdotal, but: it all worked for me, so I can't help you I'm afraid.

gvdhoorn gravatar image gvdhoorn  ( 2019-06-13 07:58:54 -0600 )edit

Yes, anecdotally, it didn't work on my melodic.

Jägermeister gravatar image Jägermeister  ( 2019-06-13 09:50:32 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-06-13 06:48:18 -0600

Seen: 212 times

Last updated: Jun 13 '19