I have a quaternion representing the orientation of a sensor with respect to its coordinate system.
In my application, I perform a rigid registration of the sensor coordinate system in order to align it to a camera coordinate system, which is translated and rotated with respect to the first one. I need to obtain a quaternion that represents the orientation of the sensor with respect to the camera coordinate system. I know the rototranslation (transformation) matrix to go from one system to the other. I use libraries where I can easily convert quaternions to any other orientation convention (Euler angles, rotation matrixes, axis-angle etc.) but trying to avoid as much as possible conversions to avoid Gimbal Lock.
I am new to quaternions and still struggling with them.
My 2 questions are:
- Is the translation important when converting from one coordinate system to the other? Can I just multiply the sensor's quaternion to the rotation matrix obtained through registration (after converting it to a quaternion) or do I need to take into account also the translation vector?
- In general, what steps would you take to obtain a quaternion representing the sensor orientation with respect to the camera starting from the quaternion referred to the sensor coordinate system?
Thank you!
EDIT:
I have looked closely to the sensor output, and what it actually gives me, even though on the documentation it is called "quaternion", I believe it is the Axis Angle representation of the orientation. More specifically, I obtain four "q" values where:
-q0 is the millimetric distance along the x axis of the sensor tip
-q1 is the millimetric distance along the y axis of the sensor tip
-q2 is the millimetric distance along the z axis of the sensor tip
-q3 is an angle between -180 deg and 180 deg.
I can normalize the [q0 q1 q2] vector to obtain the classic normalized Axis Angle representation, but the problem remains. How do I convert this representation (which is referred to the sensor coordinate system) to the corresponding representation referred to the camera coordinate system?
question from:
https://stackoverflow.com/questions/65907413/quaternion-transformations-between-rototranslated-coordinate-systems 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…