I have an algorithm in C++ that uses Kalman Filter. Somewhere in the code a predict a Quaternion q' and then I update the Quaternion with Kalman Filter q.
I want to plot two graphics in Matlab with the evolution of the predicted quaternion and the corrected(updated) quaternion so I am using "engine.h" library to send quaternion info to Matlab during processing (actually what I send is a 4x1 matrix).
So my question is: What is the best way to plot a quaternion in Matlab so I can visually extract information? Is it maybe better to plot the angles separately?
I think a good option is sending the quaternion as a vector to MATLAB, using C++ MATLAB engine
[qx qy qz qw]
Then, in MATLAB environment you can use a toolbox for translating to Euler Angles, which is a common visual option.
For adding a path of a toolbox in matlab engine:
addpath(genpath('C:\Program Files (x86)\MATLAB\R2010a\toolbox\SpinCalc'));
With spincalc toolbox, converting would be something like this:
Angles=SpinCalc('QtoEA321',Quaternion,0,0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With