-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add method to maintain declination angle of earth field when not fusing earth relative observations (e.g. doing optical flow only nav) This method uses the supplied declination at that location as an observation.
- Loading branch information
Paul Riseborough
committed
Oct 18, 2015
1 parent
048ff71
commit aeac5ba
Showing
2 changed files
with
74 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
derivations/RotationVectorAttitudeParameterisation/calcMAGD.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
t2 = 1.0/magN; | ||
t4 = magE*t2; | ||
t3 = tan(t4); | ||
t5 = t3*t3; | ||
t6 = t5+1.0; | ||
t7 = 1.0/(magN*magN); | ||
t8 = OP_l_18_c_18_r_*t2*t6; | ||
t15 = OP_l_17_c_18_r_*magE*t6*t7; | ||
t9 = t8-t15; | ||
t10 = t2*t6*t9; | ||
t11 = OP_l_18_c_17_r_*t2*t6; | ||
t16 = OP_l_17_c_17_r_*magE*t6*t7; | ||
t12 = t11-t16; | ||
t17 = magE*t6*t7*t12; | ||
t13 = R_DECL+t10-t17; | ||
t14 = 1.0/t13; | ||
t18 = conjugate(magE); | ||
t19 = conjugate(magN); | ||
t21 = 1.0/t19; | ||
t22 = t18*t21; | ||
t20 = tan(t22); | ||
t23 = t20*t20; | ||
t24 = t23+1.0; | ||
Kfusion[0] = t14*(OP_l_1_c_18_r_*t2*t6-OP_l_1_c_17_r_*magE*t6*t7); | ||
Kfusion[1] = t14*(OP_l_2_c_18_r_*t2*t6-OP_l_2_c_17_r_*magE*t6*t7); | ||
Kfusion[2] = t14*(OP_l_3_c_18_r_*t2*t6-OP_l_3_c_17_r_*magE*t6*t7); | ||
Kfusion[3] = t14*(OP_l_4_c_18_r_*t2*t6-OP_l_4_c_17_r_*magE*t6*t7); | ||
Kfusion[4] = t14*(OP_l_5_c_18_r_*t2*t6-OP_l_5_c_17_r_*magE*t6*t7); | ||
Kfusion[5] = t14*(OP_l_6_c_18_r_*t2*t6-OP_l_6_c_17_r_*magE*t6*t7); | ||
Kfusion[6] = t14*(OP_l_7_c_18_r_*t2*t6-OP_l_7_c_17_r_*magE*t6*t7); | ||
Kfusion[7] = t14*(OP_l_8_c_18_r_*t2*t6-OP_l_8_c_17_r_*magE*t6*t7); | ||
Kfusion[8] = t14*(OP_l_9_c_18_r_*t2*t6-OP_l_9_c_17_r_*magE*t6*t7); | ||
Kfusion[9] = t14*(OP_l_10_c_18_r_*t2*t6-OP_l_10_c_17_r_*magE*t6*t7); | ||
Kfusion[10] = t14*(OP_l_11_c_18_r_*t2*t6-OP_l_11_c_17_r_*magE*t6*t7); | ||
Kfusion[11] = t14*(OP_l_12_c_18_r_*t2*t6-OP_l_12_c_17_r_*magE*t6*t7); | ||
Kfusion[12] = t14*(OP_l_13_c_18_r_*t2*t6-OP_l_13_c_17_r_*magE*t6*t7); | ||
Kfusion[13] = t14*(OP_l_14_c_18_r_*t2*t6-OP_l_14_c_17_r_*magE*t6*t7); | ||
Kfusion[14] = t14*(OP_l_15_c_18_r_*t2*t6-OP_l_15_c_17_r_*magE*t6*t7); | ||
Kfusion[15] = t14*(OP_l_16_c_18_r_*t2*t6-OP_l_16_c_17_r_*magE*t6*t7); | ||
Kfusion[16][0] = -t18*1.0/(t19*t19)*t24; | ||
Kfusion[16] = -t14*(t16-OP_l_17_c_18_r_*t2*t6); | ||
Kfusion[17][0] = t21*t24; | ||
Kfusion[17] = t14*(t8-OP_l_18_c_17_r_*magE*t6*t7); | ||
Kfusion[18] = t14*(OP_l_19_c_18_r_*t2*t6-OP_l_19_c_17_r_*magE*t6*t7); | ||
Kfusion[19] = t14*(OP_l_20_c_18_r_*t2*t6-OP_l_20_c_17_r_*magE*t6*t7); | ||
Kfusion[20] = t14*(OP_l_21_c_18_r_*t2*t6-OP_l_21_c_17_r_*magE*t6*t7); | ||
Kfusion[21] = t14*(OP_l_22_c_18_r_*t2*t6-OP_l_22_c_17_r_*magE*t6*t7); | ||
Kfusion[22] = t14*(OP_l_23_c_18_r_*t2*t6-OP_l_23_c_17_r_*magE*t6*t7); | ||
Kfusion[23] = t14*(OP_l_24_c_18_r_*t2*t6-OP_l_24_c_17_r_*magE*t6*t7); |