Skip to content

Commit 24d9488

Browse files
authored
Merge pull request #124 from rodralez/develop
Merging from develop to master
2 parents c1afcb6 + 259f2d6 commit 24d9488

File tree

6 files changed

+30
-34
lines changed

6 files changed

+30
-34
lines changed

examples/real-data/mpu6000_imu.mat

-4 Bytes
Binary file not shown.

examples/real-data/navego_example_real_mpu6000.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
load ekinox_gnss
108108

109109
% ekinox_gnss contains the lever arm with respect to Ekinox IMU.
110-
% ekinox_gnss.larm has to be changed for MPU-6000 IMU
110+
% ekinox_gnss.larm has to be changed for MPU-6000 IMU.
111111
ekinox_gnss.larm = [-0.369, 0.0, -0.219]';
112112

113113
ekinox_gnss.eps = mean(diff(mpu6000_imu.t)) / 2; % A rule of thumb for choosing eps.
@@ -126,7 +126,7 @@
126126

127127
% Execute INS/GNSS integration
128128
% ---------------------------------------------------------------------
129-
nav_mpu6000 = ins_gnss(mpu6000_imu, ekinox_gnss, 'quaternion');
129+
nav_mpu6000 = ins_gnss(mpu6000_imu, ekinox_gnss, 'dcm');
130130
% ---------------------------------------------------------------------
131131

132132
save nav_mpu6000.mat nav_mpu6000

examples/synthetic-data/navego_example_synth.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% navego_example_synth: example of how to use NaveGo to generate
2-
% both IMU and GNSS synthetic (simulated) data. Then, synthetic data is
3-
% fused.
2+
% both IMU and GNSS synthetic (simulated) data. Then, sensors synthetic
3+
% data is fused.
44
%
55
% The main goal is to compare two INS/GNSS systems performances, one using
66
% a synthetic ADIS16405 IMU and synthetic GNSS, and another using a

ins-gnss/F_update.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,15 @@
174174

175175
% Eq. 14.63 from Groves
176176
F = [F11 F12 F13 DCMbn Z ;
177-
F21 F22 F23 Z -DCMbn ;
177+
F21 F22 F23 Z DCMbn ;
178178
F31 F32 F33 Z Z ;
179179
Z Z Z Fgg Z ;
180180
Z Z Z Z Faa ;
181181
];
182182

183-
% Eq. Eq. 11.108 from Farrell
183+
% Eq. 11.108 from Farrell
184184
G = [DCMbn Z Z Z ;
185-
Z -DCMbn Z Z ;
185+
Z DCMbn Z Z ;
186186
Z Z Z Z ;
187187
Z Z Fbg Z ;
188188
Z Z Z Fba ;

ins-gnss/ins_gnss.m

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,16 @@
9797
% Groves, P.D. (2013), Principles of GNSS, Inertial, and
9898
% Multisensor Integrated Navigation Systems (2nd Ed.). Artech House.
9999
%
100+
% Crassidis, J.L. and Junkins, J.L. (2011). Optimal Esti-
101+
% mation of Dynamic Systems, 2nd Ed. Chapman and Hall/CRC, USA.
102+
%
100103
% ZUPT algothim based on Groves, Chapter 15, "INS Alignment, Zero Updates,
101104
% and Motion Constraints".
102105
%
103106
% ins_gps.m, ins_gnss function is based on that previous NaveGo function.
104107
%
105-
% Version: 010
106-
% Date: 2022/03/06
108+
% Version: 011
109+
% Date: 2022/04/0
107110
% Author: Rodrigo Gonzalez <[email protected]>
108111
% URL: https://github.com/rodralez/navego
109112

@@ -367,11 +370,15 @@
367370

368371
%% INS/GNSS CORRECTIONS
369372

370-
% Quaternion corrections
371-
% Crassidis. Eq. 7.34 and A.174a.
372-
antm = [0.0 qua(3) -qua(2); -qua(3) 0.0 qua(1); qua(2) -qua(1) 0.0];
373-
qua = qua + 0.5 .* [qua(4)*eye(3) + antm; -1.*[qua(1) qua(2) qua(3)]] * kf.xp(1:3);
374-
qua = qua / norm(qua); % Brute-force normalization
373+
% Quaternion correction
374+
qua_skew = -skewm(qua(1:3)); % According to Crassidis, qua_skew should be
375+
% positive, but if positive NaveGo diverges.
376+
% Crassidis A.174a
377+
Xi = [qua(4)*eye(3) + qua_skew; -qua(1:3)'];
378+
379+
% Crassidis. Eq. 7.34
380+
qua = qua + 0.5 .* Xi * kf.xp(1:3);
381+
qua = qua / norm(qua); % Brute-force normalization
375382

376383
% DCM correction
377384
DCMbn = qua2dcm(qua);

ins/qua_update.m

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,12 @@
2929

3030
% References:
3131
%
32-
% R. Gonzalez, J. Giribet, and H. Patiño. An approach to
33-
% benchmarking of loosely coupled low-cost navigation systems,
34-
% Mathematical and Computer Modelling of Dynamical Systems, vol. 21,
35-
% issue 3, pp. 272-287, 2015. Eq. 13.
36-
%
3732
% Crassidis, J.L. and Junkins, J.L. (2011). Optimal Esti-
3833
% mation of Dynamic Systems, 2nd Ed. Chapman and Hall/CRC, USA.
39-
% Eq. 7.39 and 7.40, p. 458.
34+
% Eq. 7.39 to 7.41, p. 458.
4035
%
41-
% Version: 004
42-
% Date: 2021/03/18
36+
% Version: 005
37+
% Date: 2022/04/07
4338
% Author: Rodrigo Gonzalez <[email protected]>
4439
% URL: https://github.com/rodralez/navego
4540

@@ -53,20 +48,14 @@
5348
co = cos(0.5*wnorm*dt);
5449
si = sin(0.5*wnorm*dt);
5550

56-
n1 = wb(1) / wnorm;
57-
n2 = wb(2) / wnorm;
58-
n3 = wb(3) / wnorm;
59-
60-
qw1 = n1*si;
61-
qw2 = n2*si;
62-
qw3 = n3*si;
63-
qw4 = co;
51+
% Eq. 7.41
52+
psi = (si / wnorm) * wb;
6453

65-
Om=[ qw4 qw3 -qw2 qw1;
66-
-qw3 qw4 qw1 qw2;
67-
qw2 -qw1 qw4 qw3;
68-
-qw1 -qw2 -qw3 qw4];
54+
% Eq. 7.40
55+
Om = [ (co*eye(3)-skewm(psi)) psi; % 3x4
56+
-psi' co]; % 1x4
6957

58+
% Eq. 7.39
7059
qua = Om * qua;
7160
end
7261

0 commit comments

Comments
 (0)