quaternion_from_euler, pan/tilt, which order?
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!
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 ..
.. 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.
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.