Commit Graph

1148 Commits

Author SHA1 Message Date
CarlOlsson 8a2e512c2d terrain_estimator: add vehicle_variance_scaler 2018-11-15 08:38:48 +11:00
Paul Riseborough acde4ebcc3 EKF: fix comment 2018-11-15 07:16:31 +11:00
Paul Riseborough df571202c5 EKF: Fix bug preventing saved declination being used for first alignment 2018-11-15 07:16:31 +11:00
Paul Riseborough 4657a9cd21 EKF: Ensure yaw gets reset when declination is set 2018-11-15 07:16:31 +11:00
Roman 68a3cbc368 addressed review comment
Signed-off-by: Roman <bapstroman@gmail.com>
2018-11-13 08:42:28 +11:00
Roman a74b7ef60b 3D only mag fusion: make sure _flt_mag_align_complete is set
- _flt_mag_align_complete was not set when choosing pure 3D mag fusion.
one effect of this was that the declination used in the filter was not
the one calculated from the magnetic field states.

Signed-off-by: Roman <bapstroman@gmail.com>
2018-11-13 08:42:28 +11:00
jie.zhang 10a0fef7b7 EKF/control: remove unnecessary yaw_align update 2018-10-17 15:50:00 -04:00
Daniel Agar 8bbaf898a5
EKF add new simple setIMUData() interface (#512) 2018-10-17 15:30:25 -04:00
Paul Riseborough e6cd6eff87 EKF: Fix bug preventing use of flow sensors without gyros
The handling of invalid flow data when on ground is performed in controlOpticalFlowFusion() where it is able to handle flow sensors that don't publish gyro data.
2018-10-11 07:12:54 +11:00
Daniel Agar 2c3a064942
README.md update Jenkins build status icon and url 2018-09-18 20:16:29 -04:00
Paul Riseborough f240eaa5b0 EKF: Fix test script 2018-09-19 06:32:43 +10:00
Paul Riseborough 5cb228e1b3 EKF: Remove duplicate line 2018-09-19 06:32:43 +10:00
Paul Riseborough 0220f469b0 EKF: Use more generic variable name for bad yaw fusion flag
This flag now reports on  fusion of data that is not from a magnetometer.
2018-09-19 06:32:43 +10:00
Paul Riseborough eb52f7c410 EKF: Remove implicit conversion and use single precision trig operator
Double precision accuracy is not required for this operation.
2018-09-19 06:32:43 +10:00
Paul Riseborough 6847acb72e EKF: Add protection for undefined GPS antenna array heading offset 2018-09-19 06:32:43 +10:00
Paul Riseborough d1f3f4c916 EKF: Use #define function for isfinite check 2018-09-19 06:32:43 +10:00
Paul Riseborough 91f886cb5e EKF: Add support for use of GPS heading data.
Heading data is assumed to be from a  dual antenna array at a specified yaw angle offset in body frame, but with the heading data already corrected for antenna offset. The offset is required to apply the correct compensation for combined rotations and to determine when the yaw observation has become badly conditioned.
2018-09-19 06:32:43 +10:00
Paul Riseborough af60e6bbc8 EKF: Add derivation for for dual antenna yaw observations 2018-09-19 06:32:43 +10:00
Paul Riseborough 342c3ab202 EKF: Fix timeout parameter documentation and name
The parameter used to control the maximum dead reckoning time had 'gps' in the parameter name which was confusing because it was used for all measurement types capable of constraining horizontal velocity error growth. The parameter variable has been renamed and the documentation for it improved.
The parameter used to control the maximum time since fusing a measurement before the measurement is considered to be not contributing to aiding had misleading documentation which has been updated.
2018-09-19 06:32:43 +10:00
Dion Gonano 2354c30d81 Add vision height covariance passthrough (#507)
* Add vision height covariance passthrough

* Fix hgtErr layout
2018-09-11 06:36:13 +10:00
Kabir Mohammed a7245229cb EKF : Fix divergence when optical flow is not fused for a long time (#503)
* terrain_estimator : guard against case where latest range sample is newer than IMU sample

* EKF : control : correct detection of no optical flow fusion over a time period
2018-09-03 14:26:43 +10:00
Paul Riseborough b861594d0b EKF: enable optical flow use to bootstrap 2018-09-01 14:49:45 +02:00
Daniel Agar 3c74dc2ce1 ECL_Controller base needs virtual destructor 2018-08-30 12:07:25 -04:00
Daniel Agar 0d39072a6d EKF add missing header guards 2018-08-30 12:07:25 -04:00
Kabir Mohammed a6a1edbe3f EKF : Fix type of flow data navigation variable (#499) 2018-08-30 18:26:17 +10:00
Paul Riseborough a53ad9c261 EKF: Add missing optical flow ground motion protection
Motion compensated optical flow rates are supposed to be zeroed if reported flow quality is below the minimum threshold value when on ground.
The comments and logic have been amended to be consistent and make the design intent clearer.
2018-08-28 21:31:50 +02:00
dakejahl 56b8bb08a1 added a checking for range_aid to determine if we are relying on the range finder as our primary source of height observation (#491) 2018-08-24 06:42:58 +10:00
Roman aa134d5a61 l1 position controller: make sure that a NAN roll setpoint
does not keep the roll setpoint state at NAN forever

Signed-off-by: Roman <bapstroman@gmail.com>
2018-08-21 16:16:33 +02:00
Daniel Agar 34cd1366b7 Jenkins update PX4BuildBot credential usage 2018-08-12 13:38:35 -04:00
Paul Riseborough 35f628e68f
EKF: Add interface to enable logging of GPS drift metrics (#490)
* EKF: Add interface to enable logging of GPS drift metrics

* EKF: Fix bug affecting rate of GPS drift publication

Also fix variable name.
2018-08-03 13:24:31 +10:00
Daniel Agar 48a17b5234
cmake ignore doxygen option when not a standalone build (#488) 2018-07-30 12:23:24 -04:00
Roman 4a8a3a4079 l1 controller: simpler way of doing slew rate limiting
Signed-off-by: Roman <bapstroman@gmail.com>
2018-07-26 07:54:38 +02:00
Roman fe4e6779f3 l1 position control: added roll angle setpoint slew rate limiting
Signed-off-by: Roman <bapstroman@gmail.com>
2018-07-26 07:54:38 +02:00
Paul Riseborough 748446b92f EKF: Use parameter for stuck range test threshold
The default has been reduced to make it suitable for low altitude optical flow navigation.
2018-07-26 07:53:39 +02:00
Paul Riseborough 628079719f EKF: Fix inconsistency in timeout for terrain validity
Terrain validity is determined solely by successful range finder fusion and terrain state initialisation.
A range finder that has been declared faulty requires continuous range finder data fusion requires  data to be continuous before the fault status _rng_hgt_faulty  can be cleared. This will enforce the requirement for continuous data before fusion can commence.
2018-07-26 07:53:39 +02:00
Paul Riseborough d1d49857f9 EKF: Prevent stuck range checks running without new data 2018-07-26 07:53:39 +02:00
dakejahl 80146273ba removed if statement that would prevent the update of the _rng_hgt_faulty flag (#480) 2018-07-26 07:53:39 +02:00
Paul Riseborough 17d40478bb EKF: Rework range height validity checking
Eliminate race condition caused by checking for data freshness using time stamps from buffer push instead than buffer pop events.
Consistent use of range data ready and range data fault flags. This achieved by ensuring that _rng_hgt_faulty is set to true for all range data faults, not just data freshness.
Include range data validity requirement in rangeAidConditionsMet() check.
2018-07-26 07:53:39 +02:00
Paul Riseborough e0bcfeb533 EKF: Add validity boolean to mag declination accessor 2018-07-26 07:51:58 +02:00
Paul Riseborough 1e610894b9 EKF: Correct documentation and function name for declination accessor
The function name and documentation are misleading given the function is only a getter.
This change makes the usage clearer.
2018-07-26 07:51:58 +02:00
Paul Riseborough 4d01883f75 EKF: Disable GPS drift checks when the vehicle is moving. 2018-07-24 07:31:45 +02:00
Roman Bapst ee85a29202 Pr opt flow (#482)
* optical flow: fixed calculation of velocity of the flow sensor relative to
the IMU

- gyroXYZ holds a delta angle and first needs to converted to a gyro rate

Signed-off-by: Roman <bapstroman@gmail.com>

* optical flow: calculate height above the ground with respect to the flow
camera
- the flow camera can be offset from the IMU which needs to be considered

Signed-off-by: Roman <bapstroman@gmail.com>

* estimator interface: fixed comment regarding optical flow sample timestamp

- the timestamp on an optical flow sample corresponds to the trailing
edge of the flow integration period

Signed-off-by: Roman <bapstroman@gmail.com>
2018-07-16 11:41:35 +10:00
Paul Riseborough 4d59c834eb EKF: Consolidate range finder checking
This brings all the range finder data checks (excluding innovation consistency checks) into one place and eliminates the need to perform range checking external to the library.
The hard coded optical flow tilt limit is changed to use the same value as the range finder.
Variable names are changed to make a clear distinction between the max/min values calculated by the stuck range check and the max/min valid values for the sensor.
2018-07-12 18:20:50 +02:00
Kabir Mohammed e1661a92c3 EKF : allow init without external vision measurements (#464) 2018-07-12 11:36:47 +10:00
Paul Riseborough a0ed08967e EKF: Add missing range validity check 2018-07-11 14:53:37 +02:00
Daniel Agar 41953ab582 EKF angle constants in degrees for readability (#465)
* EKF angle constants in degrees for readability

* EKF make FILTER_UPDATE_PERIOD_MS static constexpr and add FILTER_UPDATE_PERIOD_S

* EKF controlOpticalFlowFusion() use constants and update comments

* EKF controlMagFusion() use angle in degrees

* EKF move earth spin rate to geo and update usage

* EKF: Fix numerical constant error and clean up comments

Comments do not need to contain numerical values when the code makes these clear.
2018-07-05 08:55:22 +10:00
Daniel Agar cebdc3d829 ekf run output predictor immediately with new IMU data (#471)
* EKF collect_imu take const imu sample and populate buffer

* EKF calculateOutputStates cleanup

* EKF add calculate_quaternion output predictor method

* EKF: update documentation

* EKF: remove unnecessary getter function

* EKF calculateOutputStates only apply dt correction to bias

* EKF pytest assert attitude validity, not update() return

* EKF: correct documentation

* EKF: Do not make attitude validity dependent on yaw alignment status

Yaw alignment could fail in flight due to temporary loss of data and yet the quaternions would still usable for stabilisation even though the absolute earth yaw angle wrt true north was uncertain.
2018-07-05 07:59:35 +10:00
Daniel Agar 114ae4116a geo get_bearing_to_next_waypoint() small optimization 2018-06-30 21:30:35 +00:00
Daniel Agar b26c2d62b8 geo get_distance_to_arc remove double promotion 2018-06-30 10:09:10 -04:00
Philipp Oettershagen b3959fab2f TECS: Do not even calculate integrator state if integrator gain is zero 2018-06-29 15:55:46 +00:00