0
$\begingroup$

Rosanswers logo

Hey everybody,

before I turn my brain into a slimy mess it's probably easier to admit I'm failing and ask...

I have a camera pan/tilt system whose pose I'd like to broadcast through tf. The order of the axes is: first pan (left/right/yaw), then, in the pan-frame, tilt (up/down/pitch). How do I translate this into a quaternion? Is using quaternion_from_euler the best way to do this? And if it is, what order do I have to put pan and tilt angles in to get the corresponding correct quaternion returned? There are too many permutations to try and I'm really struggling to figure it out through pure thinking.

Thanks for your help!

//edit: oh, just to mention this: the axes of the tf frame should correspond to the image processing requirements. That is: the frame x- and y-axes should match the image x- and y-axes and the z-axis should point away from the camera, into the image. Or in other words, if I looked through the camera, the x-axis should go to the right, the y-axis down and the z-axis pointing away from me.

//edit2: z-axis direction wrong (right-hand convention), sorry... corrected!

//edot3: dammit, it was correct in the first place... corrected again... I'm so confused!


Originally posted by Hendrik Wiese on ROS Answers with karma: 1145 on 2016-11-24

Post score: 0


Original comments

Comment by gvdhoorn on 2016-11-24:\

the axes of the tf frame should correspond to the image processing requirements.

This does not make sense to me, or at least: I don't understand why this should be a requirement for the orientation of the TF frames that represent the pan-tilt-unit. I'd first solve the problem of representing ..

Comment by gvdhoorn on 2016-11-24:
.. pan-tilt pose (relative to some origin of the pan-tilt model), then insert (an) additional frame(s) to end up with the orientation requirements your vision algorithm has. Separating responsibilities like that would seem to make sense, and might make things easier to reason about.

Comment by Hendrik Wiese on 2016-11-24:
This is due to the fact that I'm reconstructing a point cloud from the image(s). The point cloud has to get the correct tf frame orientation to be correctly represented in the world frame.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I've solved this puzzler. Step by step. First I've rotated the camera coordinate system so that it matches the camera in 0/0 orientation (pan/tilt) according to the mentioned requirements. I've created a fixed quaternion for that rotation. Then I've empirically figured out what axis I had to rotate by which angle. One after the other I've multiplied them with the current quaternion.

Now I have to correct orientation of the tf transform of the camera. Tough one.


Originally posted by Hendrik Wiese with karma: 1145 on 2016-11-24

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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