Commit Graph

69 Commits

Author SHA1 Message Date
Paul Riseborough 577670ccee AP_NavEKF2: Reduce memory required by 6KB when running at 400Hz
Down-sample the IMU and output observer state data to 100Hz for storage in the buffer.
This reduces storage requirements for Copter by 75% or 6KB
It does not affect memory required by plane which already uses short buffers due to its 50Hz execution rate.
This means that the EKF filter operations operate at a maximum rate of 100Hz.
The output observer continues to operate at 400Hz and coning and sculling corrections are applied during the down-sampling so there is no loss of accuracy.
2015-11-10 15:51:18 +11:00
Paul Riseborough 7294c8004b AP_NavEKF2: Enable use of backup magnetometers after a timeout
If the magnetometer fails innovation consistency checks for too long (currently 10 sec), then the next available sensor approved for yaw measurement will be used.
2015-11-09 22:07:09 +11:00
Paul Riseborough 9efc2152fc AP_NavEKF2: Fix comment 2015-11-08 16:26:04 +11:00
Paul Riseborough f99dbc70f9 AP_NavEKF2: Don't return ready to use GPS true if user has inhibited GPS 2015-11-08 16:26:04 +11:00
Paul Riseborough 65e4a4ab94 AP_NavEKF2: Use correct casting of integers when printing
Changes in response to review comments
2015-11-08 15:37:27 +11:00
Paul Riseborough 49f9ea317c AP_NavEKF: Update console message and param descriptions for multiple EKF's 2015-11-08 15:37:26 +11:00
Andrew Tridgell 2ab2afc86a AP_NavEKF2: added EK2_IMU_MASK for multiple IMUs
no voting between multiple IMUs yet
2015-11-06 10:42:58 +11:00
Paul Riseborough aa14de9d39 AP_NavEKF2: Fix failure to start mag cal due to gyro noise
Vibration in the 400Hz delta angles could cause the angular rate condition check for in-flight magnetic field alignment to fail.
The symptons were failure to start magnetic field learning as expected when EK2_MAG_CAL=3 was set.
2015-11-02 14:12:17 +11:00
Paul Riseborough f539b597a3 AP_NavEKF2: Improve initialisation of magnetic field learning
Use the more robust, but less accurate compass heading fusion up to 5m altitude
Wait for the magnetometer data fusion time offset to be correct before using data to reset states
Don't reset magnetic field states if the vehicle is rotating rapidly as timing offsets will produce large errors
When doing the yaw angle reset, apply the reset increment to all quaternions stored in the output buffer to avoid transients produced by yaw rotations and the 0.25 second fusion time horizon offset.
Only do the one yaw and mag reset at 5m, not two at 1.5 and 5.0m
Always re-do the yaw and mag reset when leaving the ground.
2015-10-30 15:34:20 +09:00
Paul Riseborough 5eb7cf1fbf AP_NavEKF: Reduce roll/pitch disturbance when magnetic field is reset
Because we have changed the yaw angle and have taken a point sample on the magnetic field, covariances associated with the magnetic field states will be invalid and subsequent innovations could cause an unwanted disturbance in roll and pitch.
The reset of the Euler angles to a new yaw orientation was being done using roll and pitch from the output observer states, not the EKF state vector which meant that when roll and pitch were changing, the reset to a new yaw angle would also cause a roll and pitch disturbance.
2015-10-23 19:04:30 +11:00
Paul Riseborough ab8c28a7cc AP_NavEKF: Fix bug allowing takeoff in GPS modes without aiding
The legacy EKF switches GPs aiding on on arming, whereas the new EKF switches it on based on GPS data quality.
This means the decision to arm and therefore the predicted solution flags must now reflect the actual status of the navigation solution as it will no longer change when motor arming occurs.
2015-10-20 20:16:00 +11:00
Andrew Tridgell d1dfd5fd01 AP_NavEKF2: use common header for optimisation level and irq disable 2015-10-20 15:21:40 +11:00
Paul Riseborough f6ad79688e AP_NavEKF2: Update start sequence console messages 2015-10-20 15:21:39 +11:00
Paul Riseborough baa8692960 AP_NavEKF2: Allow use of magnetometer learning during optical flow nav
Adds fusion of the declination when there are no earth relative measurements so that the declination angle and therefore the copters yaw angle have an absolute reference.
This enables the length (but not the declination) of the earth field North/East states to change along with the magnetometer offsets.
2015-10-20 15:21:38 +11:00
Paul Riseborough 6899767d28 AP_NavEKF2: Disable magnetic field learning if we have no absolute position reference 2015-10-20 15:21:38 +11:00
Paul Riseborough e7de2d3ea3 AP_NavEKF: Update magnetic field learning options
Provide an option to always do learning
Make field learning decision logic clearer
Change defaults so that plane learns when airborne
Change defaults so that Rover does not learn (large external magnetic interference)
2015-10-20 15:21:38 +11:00
Paul Riseborough 71c399674a AP_NavEKF2: Delay use of magnetic field states until off-ground
Magnetic interference whilst on the ground can adversely affect filter states. This patch ensures that the simpler and more robust magnetic heading observation method is used until the vehicle has cleared the ground.
2015-10-20 15:21:37 +11:00
Paul Riseborough 0dc570b5a5 AP_NavEKF2: Improve optical flow takeoff detection logic
Ensure takeoff detect status goes to false when on ground
2015-10-20 15:21:36 +11:00
Paul Riseborough b142cc7fd2 AP_NavEKF2: Rename files and re-distribute content 2015-10-10 14:48:50 +09:00