Ambiguity in DCM to Quaternion conversion using the default Simulink library block
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am simulating a system where I need Direction Cosine Matrix to quaternion conversion. I use the default DCM to Quaternion conversion block available in simulink. However at some points of the simulation, the output quaternion components reverse sign.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/151467/image.png)
Above is the simulated plot. The first plot is of the output quaternion. Second plot is of the Direction Cosine Matrix. As you see that even though the dcm components change smoothly, the quaternion changes sign abruptly.
Though this is mathematically correct I desire a smooth change. Any idea on how to avoid this and have a smooth curve for the quaternion?
0 comentarios
Respuestas (1)
James Tursa
el 9 de Mayo de 2020
Quaternions used for rotations have an inherent sign ambiguity, as you seem to already know. That is, -q produces the same rotation as q. If you want a sequence of quaternions to have smooth transitions you will have to enforce that manually. I might suggest making sure that the largest magnitude element always maintains the same sign for successive quaternions with some post processing code.
0 comentarios
Ver también
Categorías
Más información sobre Math Operations en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!