How to use MATLAB's inertial navigation extended Kalman filter (insEKF) for pose estimation with accel and gyro data as inputs?

조회 수: 21 (최근 30일)
Hello,
I want to estimate pose (position and orientation) from accel and gyro data. For this, I have used the insfilterMARG and called, in a loop, for each new accel and gyro sample pair the predict function: predict(insFilter,accelReadings,gyroReadings). This works reasonably well, but the insfilterMARG state vector contains a number of states I don't need (essentially all magnetometer related states). More importantly, as far as I can see, the insfilterMARG provides only a correct function that allows state correction with direct state measurements: correct(FUSE,idx,measurement,measurementCovariance). The insEKF by contrast, provides a fuse() function that would allow me to fuse signals that are not direct state measurements. However, I have a hard time understanding how to use insEKF. So far, I initialized the insEKF as shown in the code snippet below and in a loop I call the predict and fuse methods
accelSensor = insAccelerometer;
gyroSensor = insGyroscope;
motionModel = insMotionPose;
insFilter = insEKF(accelSensor, gyroSensor, motionModel);
for i=1:N
predict(insFilter,Ts); % Ts sample time
fuse(insFilter, accelSensor, accelReadings, someMeasurementNoiseAccel);
fuse(insFilter, gyroSensor, gyroReadings, someMeasurementNoiseGyro);
end
Finally, with stateparts I read out the state components I am interested in. However, the estimated position trajectory (and orientation) do not match at all the insfilterMARG (nor the ground truth shape).
What is the function call sequence to obtain comparable results with the insEKF as with the insfilterMARG?
Thanks!
  댓글 수: 1
Marek Coufal
Marek Coufal 2024년 3월 19일
Hello,
did you manage to get any acceptable outcome using the insEKF function? I am having pretty simillar problem using insEKF for fusing gyro, accel and magnetometer data from ADIS16505 (midrange 6DoF IMU) and LSM303 magnetometer. The trajectory estimates do not match the ground truth at all, and are two orders of magnitude bigger (altough I checked, that I am using correctly scaled data, i.e acceleration of not moving object in z direction is 9.81ms-2.
Thanks.

댓글을 달려면 로그인하십시오.

답변 (1개)

Brian Fanous
Brian Fanous 2022년 9월 14일
편집: Brian Fanous 2022년 9월 14일
Generally speaking, if you have only typical MEMs gyroscope and accelerometer you will not be able to get a high quality position estimate. The bias in these sensors, even after calibration, will adversely affect your position estimate. For a high quality position estimate you'll need to add another sensor - like a GPS.
If you only want orientation and have a gyroscope and accelerometer, the imufilter is a lot easier to start off with. Alternatively, you can estimate just orientation and angular velocity accurately with an insEKF by using the insMotionOrientation motion model instead of the insMotionPose motion model.
  댓글 수: 3
Effesian
Effesian 2022년 9월 17일
By the way, in the MathWorks documentation for the insMotionPose, the alogirthm section states: "The insMotionPose object models the orientation-only motion of platforms." --> That does not seem correct, since pose is both position and orientation.
Brian Fanous
Brian Fanous 2022년 9월 19일
I will try to get the documentation for insMotionPose updated but in short....
insMotionPose is for orientation and position
insMotionOrientation is for orientation only.
Yes, the insEKF is intended to be a configurable inertial navigation filter. It is a continuous-discrete EKF. The insfilterMARG is a discrete-discrete EKF so they underlying filter is slightly different.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Inertial Sensor Fusion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by