Determine Orientation Using Accelerometer-Gyroscope Fusion
28 views (last 30 days)
Show older comments
Hi,
If an accelemoter is immobile we can estimate its orientation using gravitational component.
Also, using sensor fusion we can obtain its orientation.
I applied this idea on measurement data that is already available in Matlab. (https://www.mathworks.com/help/fusion/gs/determine-orientation-through-sensor-fusion.html) Measurement device oscillating in pitch (around y-axis), then yaw (around z-axis), and then roll (around x-axis).
When I used imufilter function, I obtain orientation value.
But orientation obtained by imufilter is very different from one that is obtained from only accelerometer data.
For example; the orientation values (Euler angles) at sample 1131 are -11.1, 5.9, 27.5 degrees by imufilter. The tilt is low. The figure below shos the tilt.
But accelerometer values are -0.98, -9.48, 3.09. Y axis value is about -g and z axis value is low. Then the tilt should be high. This gives about 73 degree for z axis.
What's wrong? Thanks
ld = load('rpy_9axis.mat');
acc = ld.sensorData.Acceleration;
gyro = ld.sensorData.AngularVelocity;
mag = ld.sensorData.MagneticField;
viewer = HelperOrientationViewer;
ifilt = imufilter('SampleRate', ld.Fs);
for ii=1:1131
qimu = ifilt(acc(ii,:), gyro(ii,:));
angle = eulerd(qimu,'ZYX','frame');
viewer(qimu);
pause(0.01);
str = sprintf("Euler angles :%.1f %.1f %.1f",angle);
title(str)
end
plot(acc)

0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!