623 Commits

Author SHA1 Message Date
Paul Riseborough
9ee35e38df EKF: Don't fallback when optical flow is lost if external vision data is being used 2017-07-13 20:21:41 +09:00
Paul Riseborough
1bb576c197 EKF: Allow fallback to non-aiding mode if external vision is lost. 2017-07-13 20:21:41 +09:00
Isaac
f96685267e Fixed vision position fusion bug 2017-07-10 13:44:51 +10:00
Paul Riseborough
ec2b54fde7 EKF: Ensure normal yaw alignment using mag is performed if GPS method is not 2017-07-08 11:13:40 +02:00
Paul Riseborough
d446f66105 EKF: Add a fixed wing mode with setter function 2017-07-08 11:13:40 +02:00
Paul Riseborough
f064915889 EKF: Enable planes to recover from bad mag data at start of flight
Adjusts yaw by the amount of the error between GPS and EKF course if innovations are large.
2017-07-08 11:13:40 +02:00
Paul Riseborough
929f205a00 EKF: Changes arising from code review 2017-07-04 08:12:15 +10:00
Paul Riseborough
7b5f55303a EKF: Prevent covariance instability in delta velocity bias state estimation 2017-07-03 21:04:07 +10:00
Paul Riseborough
eb1e73ec81 Merge pull request #283 from PX4/ekf_matrix_cleanup
EKF matrix typedef cleanup
2017-07-03 21:02:24 +10:00
Paul Riseborough
ae118940b1 Merge pull request #292 from PX4/pr-use_baro_align
use baro for the ekf alignment if range finder is primary height source
2017-07-03 20:31:16 +10:00
Paul Riseborough
dfbc9de48e Merge pull request #291 from PX4/pr-ekfWindEstBugFix
EKF: Fix bug affecting wind estimation for planes
2017-07-01 11:06:58 +10:00
ChristophTobler
ed8fa16678 use baro for the ekf alignment if range finder is primary height source 2017-06-30 10:28:57 +02:00
Paul Riseborough
59edccca4a EKF: Fix bug in wind estimation for fixed wing 2017-06-30 10:32:54 +10:00
Paul Riseborough
ba4a311771 EKF: Update comments for wind estimation logic 2017-06-30 10:32:23 +10:00
Paul Riseborough
8e0cd1bc39 EKF: Add parameter to set initial and max allowed wind uncertainty
This enables the initial uncertainty to be set based on application and also ensures that the max allowed growth in wind state variance is consistent with the initial uncertainty specified.
2017-06-30 10:31:16 +10:00
ChristophTobler
e1274ad28a move faultiness check above pop_first_older_than() and check independent of range aid to switch back to original sensor if available 2017-06-29 17:07:58 +02:00
ChristophTobler
0d9e535acb Use baro if reset to baro from gps and vice versa 2017-06-29 17:07:42 +02:00
ChristophTobler
4a4b0fa604 remove setting rng faulty in ev mode because not checked 2017-06-29 10:01:16 +02:00
ChristophTobler
066c641d61 range aid: switch to baro/gps even if rng aid conditions met and rng faulty 2017-06-29 09:47:02 +02:00
ChristophTobler
2f382c8e0e if hgt mode is range, switch to baro if range is faulty 2017-06-29 09:47:02 +02:00
ChristophTobler
e4f36215cb if in range aid mode, check faultiness that otherwise would never change back 2017-06-29 09:47:02 +02:00
ChristophTobler
e800de88b6 remove duplicate 2017-06-29 09:47:02 +02:00
Daniel Agar
c44488fdb8
EKF matrix typedef cleanup 2017-06-19 11:10:01 -04:00
ChristophTobler
6f5cffafec fix type of range_aid parameter: int -> int32_t 2017-06-15 10:14:59 +02:00
ChristophTobler
1fed209804 fix formatting 2017-06-15 09:10:43 +02:00
Roman
5036967343 barometer does not special height sensor offset because a barometer
offset from the local origin is calculated if the primary source for
height is not baro

Signed-off-by: Roman <bapstroman@gmail.com>
2017-06-15 09:10:43 +02:00
Roman
c5d464b821 make range sensor height offset computation more robust
- when switching to range finder use the current terrain estimate as
height sensor offset, otherwise spikes in the range measurements could lead
to a wrong offset

Signed-off-by: Roman <bapstroman@gmail.com>
2017-06-15 09:10:43 +02:00
Roman
182ea43445 fixed baro offset calculation
- do not subtract the height sensor offset variable when computing the
baro offset from the local origin. The baro height offset is calculated
when baro is not fused and so the height sensor offset used in that case
is associated to another sensor and has nothing to do with the baro.

Signed-off-by: Roman <bapstroman@gmail.com>
2017-06-15 09:10:43 +02:00
Roman
39983a7d55 range aid: added hysteresis for switching in and out of range aid
- prevents rapid switching
- added innovation consistency check for using range aid

Signed-off-by: Roman <bapstroman@gmail.com>
2017-06-15 09:10:43 +02:00
Roman
1b92c9b5b3 ekf_helper: fixed resetting height using range finder
- take range sensor offset wrt to IMU into account
- use projection to earth Z axis

Signed-off-by: Roman <bapstroman@gmail.com>
2017-06-15 09:10:43 +02:00
Roman
3778f0921a ekf: enable range finder to be used for estimating height even if it's not
the primary height source

- moved height control into single function in order to decide which sensor
should be used for estimating height
- under certain conditions allow to use the range finder to estimate height
even if it's not the primary height source
- fixed a bug where the delta time for the baro offset calculation was always
zero
- use methods to set height control flags to reduce code duplication and
to prevent bugs

Signed-off-by: Roman <bapstroman@gmail.com>
2017-06-15 09:10:43 +02:00
Roman
36bffd2571 ekf: calculate the delta time between consecutive baro measurments
(used for calculating filtered baro offset when primary height source
is not baro)

Signed-off-by: Roman <bapstroman@gmail.com>
2017-06-15 09:10:43 +02:00
Roman
a0ab5cf0d7 ekf vel_pos_fusion: added height sensor offset to range innovation calculation
Signed-off-by: Roman <bapstroman@gmail.com>
2017-06-15 09:10:43 +02:00
Roman
a1e67396f4 ekf: added methods for setting control height flags
Signed-off-by: Roman <bapstroman@gmail.com>
2017-06-15 09:10:43 +02:00
Paul Riseborough
d6decb3c84 Merge pull request #277 from PX4/pr-ekfBufferParam
EKF: Add a parameter to enable setting of a minimum buffer length
2017-06-15 07:34:21 +10:00
Paul Riseborough
c48b879843 Merge pull request #276 from CarlOlsson/feature/only_update_mag_states
EKF: Add feature to use the mag to only update the mag states
2017-06-14 11:04:14 +10:00
CarlOlsson
b255d4a53a fixed typos 2017-06-12 18:13:22 +02:00
Paul Riseborough
fed4a9bc5a EKF: add vertical position derivative output
Add calculation of a vertical position derivative to the output predictor. This will have degraded tracking relative to the EKF states, but the velocity will be closer to the first derivative of the position and reduce the effect inertial prediction errors on control loops that are operating in a pure velocity feedback mode.
Move calculation of IMU offset angular rate correction out of velocity accessor and into output predictor.
Provide separate accessor for vertical position derivative.
2017-06-12 10:45:46 +10:00
Paul Riseborough
16c7041f4a EKF: Add a parameter to enable setting of a minimum buffer length to handle large sensor timing jitter 2017-06-12 09:33:34 +10:00
Julien Lecoeur
d0b4f1e225 Use binary operator~ instead of logical operator! 2017-06-05 01:07:52 +08:00
Julien Lecoeur
c323b64742 Fix -Werror=int-in-bool-context on GCC 7 2017-06-05 01:07:52 +08:00
Daniel Agar
3e197fdded EKF tests remove extra semicolon 2017-06-05 01:06:41 +08:00
Daniel Agar
6ed8512ff4 EKF parameters use int32_t (#279) 2017-06-03 17:16:29 -04:00
CarlOlsson
871ebb251b EKF: Changed get_control_mode to coyp 32 bits 2017-06-01 11:02:56 +02:00
CarlOlsson
a1308482fd EKF: Reset the mag states to the field state variance when switching from the inhibit mag mode to standard mode 2017-05-31 10:18:40 +02:00
CarlOlsson
be16406b35 EKF: Add feature to use the mag to only update the mag states 2017-05-26 11:29:21 +02:00
Paul Riseborough
05c3c46f83 ekf2: changes arising from code review 2017-05-17 08:59:01 +02:00
Paul Riseborough
394dd95cba EKF: Don't do magnetic field estimation without earth frame measurements
Use horizontal acceleration to check if yaw is observable independent of the magnetometer.
Use rotation about the vertical to check if mag raises are observable.
If neither yaw of mag biases are observable, save the magnetic field variances and switch to magnetic yaw fusion.
Use the last learned declination when using magnetic yaw fusion so that the yaw reference remains consistent.
When yaw or biases become observable, reinstate the saved variances and switch back to 3D mag fusion.
2017-05-17 08:59:01 +02:00
Paul Riseborough
20db74eca8 Revert "EKF: Add parameter control of individual IMU axis delta velocity bias estimation"
This reverts commit 9c31632e2bd8c53843dfc9dc419256607578350e.
2017-05-15 16:38:17 +10:00
ChristophTobler
47973a4820 run terrain estimator after control fusion modes. Otherwise _range_data_ready will never be true and fuseHagl() will never run 2017-05-15 07:42:51 +02:00