0
$\begingroup$

Rosanswers logo

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.


Originally posted by Jägermeister on ROS Answers with karma: 81 on 2019-06-13

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by PeteBlackerThe3rd with karma: 9529 on 2019-06-13

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by gvdhoorn on 2019-06-13:
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?

Comment by Jägermeister on 2019-06-13:
@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.

Comment by gvdhoorn on 2019-06-13:
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.

Comment by Jägermeister on 2019-06-13:
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.

Comment by gvdhoorn on 2019-06-13:
You have read the Getting started section, correct?

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

Comment by Jägermeister on 2019-06-13:
Yes, anecdotally, it didn't work on my melodic.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.