MATLAB Answers

IMU reference frame with respect to heading

33 views (last 30 days)
I am using the matlab R2018b sensor fusion toolbox to create acceleration and angular velocity measurements from a trajectory I created (expressed in NED coordinates). After creating the trajectory with the toolbox I obtain the measurements with:
[accelMeas,gyroMeas] = imu(acc,angVel,ori);
where acc, angVel and ori were obtained from the trajectory generation. The data seemed to make sense but then I tested it by rotating the measurements values from the sensor frame to the NED frame by doing this, as I inferred from reading the documentation:
accNED = rotatepoint(ori, accelMeas);
this gives me a vector that is identical to "acc" (the actual acceleration in the NED frame from which i started), but all the components have the opposite sign!!
I am trying to figure out why this would happen! Moreover, can someone explain to me how the sensor reference frame is oriented with respect to the heading of the sensor itself?
%% UPDATE
So, I found this documentation I had missed: https://it.mathworks.com/help/fusion/gs/spatial-representation-coordinate-systems-and-conventions.html which explains the orientation of the IMU coordinates system with respect to the heading.
And it turns out I am doing everything right and quaternion rotation works perfectly.
So the problem is the following: I rotate the NED frame acceleration to the IMU body frame according to the orientation of the NED with respecto to the IMU body, expecting to get exactly the measured acceleration (accelMeas, see above). BUT it gives me the opposite of accelMeas!
So I think the measurements I get from the toolbox are wrong: if i invert the sign of x and y, leaving z as is, and repeat the whole procedure I get a perfect match! Is it possible that imu(acc,angVel,ori) is giving me a result with wrong sign?

Accepted Answer

Ryan Salvo
Ryan Salvo on 26 Mar 2019
Hello Silvia,
The input acceleration readings "acc" are actually negated in the accelerometer model before being rotated to the sensor frame by "ori" and then returned as the output "accelMeas".
As you have correctly pointed out, in order to convert "accelMeas" back to "acc", you will need to use the "rotatepoint" command and then negate the output.
This is due to linear acceleration being negative in the NED reference frame. Consider the two examples below:
Accelerometer at rest:
acc = [0 0 0] -> accelMeas = [0 0 9.81]
Accelerometer in free fall:
acc = [0 0 9.81] -> accelMeas = [0 0 0]
Thanks,
Ryan

More Answers (1)

Munish Raj
Munish Raj on 18 Mar 2019
Hello Silvia
Have you tried changing the orientation of the IMU?
try changing the IMU's oriantaion along the x,y axes while leaving the z axis the same.
It should do the same thing as inverting the sign of the variable.
This should resolve the issue.

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by