Hello, I am having IMU orientation troubles I am using the AHRS Filter to output Angular Velocity and Quaternions relative to the NED reference frame.
To do this i use the code:
[quaternions, angularVelocity] = ahrsfilter(acc,gyr,mag);
Where acc, gyr, and mag are accelerometer, gyroscope, and magnetometer readings, respectively. Each acc, gyr, and mag are 3xN.
I want to then rotate the sensor signals so they are aligend the the NED refernce frame. I am trying to do this with the following code
for i = length(1:end(acc))
acc(i,:) = rotateframe(quaternions(i),acc(i,:))
gyr(i,:) = rotateframe(quaternions(i),gyr(i,:))
after i rotate the accelerometer and gyroscope readings, the rotated signals are not correct. However, the angularVelocity output from the ahrsfilter is correct. Does anyone have any ideas why this may be?