Robotics StackExchange | Archived questions

quaternions tf2?

I would like to know why quaternions are used internally in tf2? What are drawbacks and benefits if someone uses Euler instead of quaternions specially in robotics. I know one of the main advantages is quaternions avoid Gimbal lock. Correct me if I am wrong.

Asked by AM97 on 2019-09-15 15:58:36 UTC

Comments

Similar comment posted here.

Asked by gvdhoorn on 2019-09-16 02:42:31 UTC

For me quaternions are a useful tool that guarantees you don't run into problems like Gimbal lock. Euler angles however, feel more familiar to me and are easier to comprehend. Therefore, I think the design of using quaternions in the background and having the option to convert to Euler makes the most sense. This design gives a safe feeling when dealing with many frames. Convert Euler to quaternion -> do quaternion mathematics with n-frames -> convert quaternion to Euler, with no need to worry about what happens in between. On top of that I think doing quaternion algebra on a computer is more efficient than doing calculations on Euler angles (especially for many frames this would have significant impact), meaning there would be performance gain as well.

Asked by MCornelis on 2019-09-23 04:26:40 UTC

Answers

Gimbal lock is one of the main reasons. You can learn more about quaternions below.

http://www.chrobotics.com/library/understanding-quaternions

Asked by stevemacenski on 2019-09-15 22:57:28 UTC

Comments