ROS Answers: Open Source Q&A Forum - RSS feedhttps://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Thu, 13 Jun 2019 09:50:32 -0500Static Publisher Z argument not workinghttps://answers.ros.org/question/325650/static-publisher-z-argument-not-working/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](/upfiles/156042639611915.png)
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](/upfiles/15604264434464587.png)
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.Thu, 13 Jun 2019 06:48:18 -0500https://answers.ros.org/question/325650/static-publisher-z-argument-not-working/Answer by PeteBlackerThe3rd for <p>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.</p>
<pre><code>rosrun tf static_transform_publisher 0.019 0.393 0.65 4.71239 1.5708 0.0 world camera_link 1000
</code></pre>
<p><img src="/upfiles/156042639611915.png" alt="first_setup"></p>
<p>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.</p>
<p>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:</p>
<pre><code> rosrun tf static_transform_publisher 0.019 0.393 0.65 4.71239 1.5708 0.6 world camera_link 1000
</code></pre>
<p><img src="/upfiles/15604264434464587.png" alt="second_setup"></p>
<p>which rotated around the wrong axis, since this is definitely not around the blue (Z) axis, but rather the red (X).</p>
<p>What's going on?</p>
<p>EDIT: There was a typo in the second command.</p>
https://answers.ros.org/question/325650/static-publisher-z-argument-not-working/?answer=325653#post-id-325653Your confusion is caused because the rotations are performed one after another, so they are not all performed in the same coordinate system. [This question](https://math.stackexchange.com/questions/2943074/confusion-about-order-of-rotations-for-euler-angles) 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.Thu, 13 Jun 2019 07:09:01 -0500https://answers.ros.org/question/325650/static-publisher-z-argument-not-working/?answer=325653#post-id-325653Comment by Jägermeister for <p>Your confusion is caused because the rotations are performed one after another, so they are not all performed in the same coordinate system. <a href="https://math.stackexchange.com/questions/2943074/confusion-about-order-of-rotations-for-euler-angles">This question</a> covers this problem better than I can describe it.</p>
<p>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.</p>
<p>I also noticed that the two static_transform_publisher commands in your question are identical, did you copy and paste the wrong one?</p>
<p>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.</p>
<p>Hope this helps.</p>
https://answers.ros.org/question/325650/static-publisher-z-argument-not-working/?comment=325690#post-id-325690Yes, anecdotally, it didn't work on my melodic.Thu, 13 Jun 2019 09:50:32 -0500https://answers.ros.org/question/325650/static-publisher-z-argument-not-working/?comment=325690#post-id-325690Comment by gvdhoorn for <p>Your confusion is caused because the rotations are performed one after another, so they are not all performed in the same coordinate system. <a href="https://math.stackexchange.com/questions/2943074/confusion-about-order-of-rotations-for-euler-angles">This question</a> covers this problem better than I can describe it.</p>
<p>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.</p>
<p>I also noticed that the two static_transform_publisher commands in your question are identical, did you copy and paste the wrong one?</p>
<p>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.</p>
<p>Hope this helps.</p>
https://answers.ros.org/question/325650/static-publisher-z-argument-not-working/?comment=325664#post-id-325664You have read the [Getting started](https://github.com/IFL-CAMP/easy_handeye#getting-started) section, correct?
Anecdotal, but: it all worked for me, so I can't help you I'm afraid.Thu, 13 Jun 2019 07:58:54 -0500https://answers.ros.org/question/325650/static-publisher-z-argument-not-working/?comment=325664#post-id-325664Comment by Jägermeister for <p>Your confusion is caused because the rotations are performed one after another, so they are not all performed in the same coordinate system. <a href="https://math.stackexchange.com/questions/2943074/confusion-about-order-of-rotations-for-euler-angles">This question</a> covers this problem better than I can describe it.</p>
<p>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.</p>
<p>I also noticed that the two static_transform_publisher commands in your question are identical, did you copy and paste the wrong one?</p>
<p>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.</p>
<p>Hope this helps.</p>
https://answers.ros.org/question/325650/static-publisher-z-argument-not-working/?comment=325661#post-id-325661Edit: 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.Thu, 13 Jun 2019 07:47:49 -0500https://answers.ros.org/question/325650/static-publisher-z-argument-not-working/?comment=325661#post-id-325661Comment by gvdhoorn for <p>Your confusion is caused because the rotations are performed one after another, so they are not all performed in the same coordinate system. <a href="https://math.stackexchange.com/questions/2943074/confusion-about-order-of-rotations-for-euler-angles">This question</a> covers this problem better than I can describe it.</p>
<p>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.</p>
<p>I also noticed that the two static_transform_publisher commands in your question are identical, did you copy and paste the wrong one?</p>
<p>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.</p>
<p>Hope this helps.</p>
https://answers.ros.org/question/325650/static-publisher-z-argument-not-working/?comment=325660#post-id-325660I've used [IFL-CAMP/easy_handeye](https://github.com/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.Thu, 13 Jun 2019 07:46:31 -0500https://answers.ros.org/question/325650/static-publisher-z-argument-not-working/?comment=325660#post-id-325660Comment by Jägermeister for <p>Your confusion is caused because the rotations are performed one after another, so they are not all performed in the same coordinate system. <a href="https://math.stackexchange.com/questions/2943074/confusion-about-order-of-rotations-for-euler-angles">This question</a> covers this problem better than I can describe it.</p>
<p>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.</p>
<p>I also noticed that the two static_transform_publisher commands in your question are identical, did you copy and paste the wrong one?</p>
<p>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.</p>
<p>Hope this helps.</p>
https://answers.ros.org/question/325650/static-publisher-z-argument-not-working/?comment=325658#post-id-325658@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.Thu, 13 Jun 2019 07:41:13 -0500https://answers.ros.org/question/325650/static-publisher-z-argument-not-working/?comment=325658#post-id-325658Comment by gvdhoorn for <p>Your confusion is caused because the rotations are performed one after another, so they are not all performed in the same coordinate system. <a href="https://math.stackexchange.com/questions/2943074/confusion-about-order-of-rotations-for-euler-angles">This question</a> covers this problem better than I can describe it.</p>
<p>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.</p>
<p>I also noticed that the two static_transform_publisher commands in your question are identical, did you copy and paste the wrong one?</p>
<p>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.</p>
<p>Hope this helps.</p>
https://answers.ros.org/question/325650/static-publisher-z-argument-not-working/?comment=325656#post-id-325656I'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?Thu, 13 Jun 2019 07:24:49 -0500https://answers.ros.org/question/325650/static-publisher-z-argument-not-working/?comment=325656#post-id-325656