Commit Graph

54 Commits

Author SHA1 Message Date
Andrew Tridgell ba9b92c4af AP_Compass: rename to EXPECT_DELAY_MS() 2019-05-15 15:33:48 +10:00
Andrew Tridgell ecc6f15dc0 AP_Compass: use EXPECT_DELAY() macro 2019-05-15 15:33:48 +10:00
Andrew Tridgell 21aee52604 AP_Compass: flag compass cal as long expected delay 2019-04-22 16:53:35 +10:00
Andrew Tridgell 2f2be6afda AP_Compass: use rotation_equal() from AP_Compass 2018-10-01 14:26:56 +09:00
Andrew Tridgell 803f255c73 AP_Compass: fixed handling of duplication rotations
we have some rotations that are duplicated, such as ROLL_180_YAW_90
and PITCH_180_YAW_270. This copes with those in the auto-orientation
code
2018-10-01 14:26:56 +09:00
Randy Mackay cb3731e08e Compass: fix compile warning in calibrator output 2018-07-30 14:57:01 +10:00
Andrew Tridgell a73492b40a AP_Compass: fixed newline in statustext 2018-07-18 16:07:19 +10:00
Andrew Tridgell 196ba0e858 AP_Compass: make COMPASS_ROT_AUTO take 3 values
0 for disabled, 1 for check only, 2 for check and fix
2018-07-18 16:07:19 +10:00
Andrew Tridgell d15a4ad92a AP_Compass: improved error reporting, check all compasses
this uses extensions to the MAG_CAL_REPORT message to convey failures
of orientation checking.

It also checks all compasses, external or internal. It only tries to
fix the orientation if it is external
2018-07-18 16:07:19 +10:00
Andrew Tridgell a5749c1869 AP_Compass: allow diagonals and off-diagonals to be calculated on rot change
this re-runs the fit on change in orientation
2018-07-18 16:07:19 +10:00
Andrew Tridgell 3c2e8baee2 AP_Compass: improved orientation reporting
and fail magcal if we fail orientation detection for an external
compass
2018-07-18 16:07:19 +10:00
Andrew Tridgell 8b0f40b402 AP_Compass: implement automatic compass orientation
this automatically determines the compass orientation when doing a 3D
compass calibration, if COMPASS_ROT_AUTO is enabled.
2018-07-18 16:07:19 +10:00
Andrew Tridgell 20d75f52c2 AP_Compass: use calloc in preferance to malloc 2018-01-17 11:22:05 +11:00
Andrew Tridgell ee2afd3242 AP_Compass: added COMPASS_OFFS_MAX
this allows setup of airframes with hatch magnets
2017-04-04 00:49:34 +01:00
Andrew Tridgell a1bce2b54d AP_Compass: use get_random16() 2016-12-02 09:49:38 +11:00
Lucas De Marchi c6b0a71c47 AP_Compass: Calibrator: use inplace initializer on array 2016-11-18 20:03:30 -02:00
Siddharth Bharat Purohit b36ee10e7c AP_Compass: fix wrong memset in compass calibrator 2016-11-18 20:03:30 -02:00
murata c808ee2f49 Global: To nullptr from NULL.
RC_Channel: To nullptr from NULL.

AC_Fence: To nullptr from NULL.

AC_Avoidance: To nullptr from NULL.

AC_PrecLand: To nullptr from NULL.

DataFlash: To nullptr from NULL.

SITL: To nullptr from NULL.

GCS_MAVLink: To nullptr from NULL.

DataFlash: To nullptr from NULL.

AP_Compass: To nullptr from NULL.

Global: To nullptr from NULL.

Global: To nullptr from NULL.
2016-11-02 16:04:47 -02:00
Michael du Breuil deec4ec6af Compass: Rework compass calibrator
Summary of significant changes:
  -Autsave doesn't depend on STREAM_EXTRA3
  -Don't risk only saving one compass on copter if CAL_ALWAYS_REBOOT is set
  -Only calibrate compasses that are both health and marked for use (there was a inconsistency in handling the mask)
  -Fix incorrect failure reporting on DO_ACCEPT_MAG_CAL with a mask of 0 if a channel was specifically not started
  -Fix not starting the buzzer if the delay is set to 0 seconds
  -Always send MAG_CAL_REPORT until its acknowledged
  -Correct the field in MAG_CAL_REPORT for autosave to indicate if the compass had actually been saved, rather then being scheduled to be saved
  -Remmove unused public interfaces
2016-10-27 14:04:33 +11:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Andrew Tridgell 36ea946cf5 AP_Compass: use board defined compass ofs max in calibrator 2016-09-23 10:53:00 +10:00
Jonathan Challinger 17fb7dc88f AP_Compass: initialize offset before beginning sphere fit 2016-09-23 10:52:51 +10:00
Jonathan Challinger 419f1bc00e AP_Compass: change fixed point format for more range 2016-09-23 10:52:46 +10:00
Jonathan Challinger 0652d71a72 AP_Compass: correct wrapping behavior in conversion to fixed point 2016-09-23 10:52:44 +10:00
Gustavo Jose de Sousa 0c31354539 AP_Compass: implement completion mask
Fill the completion mask and send that through MAVLink while calibrating the
compass.
2016-05-16 19:08:36 -03:00
dgrat 5148e41c1a AP_Math: Cleaned macro definitions
Moved Definitions into a separate header. Replaced PI with M_PI and
removed the M_PI_*_F macros.
2016-02-27 02:51:33 -03:00
Tom Pittenger 0aa0380db8 AP_Compass: compiler warnings - float to float compare and bool cast 2015-12-07 15:49:58 +09:00
Caio Marcelo de Oliveira Filho 86954cda0e AP_CompassCalibrator: use millis/micros/panic functions 2015-11-20 12:30:14 +09:00
Gustavo Jose de Sousa 63b42e0632 AP_Compass: Calibrator: make calculations for theta only once
Additionally, format comment on sample acceptance formulas nicely.
2015-10-22 08:19:35 +11:00
Gustavo Jose de Sousa f8433f82e6 AP_Compass: simplify calibration transition to COMPASS_CAL_RUNNING_STEP_ONE 2015-10-22 08:19:35 +11:00
Gustavo Jose de Sousa 46774136a6 AP_Compass: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-09-03 16:59:13 +10:00
Siddharth Bharat Purohit f085e274c7 AP_Compass: add explaination for sample acceptance based on angular distance 2015-09-03 16:59:13 +10:00
Jonathan Challinger f108383c11 AP_Compass: initialize CompassCalibrator _sample_buffer to NULL 2015-09-03 16:59:13 +10:00
Jonathan Challinger 358736a592 AP_Compass: correct calibrator sample acceptance math 2015-09-03 16:59:13 +10:00
Jonathan Challinger bff9b9065e AP_Compass: CompassCalibrator comment update 2015-09-03 16:59:13 +10:00
Siddharth Bharat Purohit 137bd25220 AP_Compass: add info about compass calibrator procedure 2015-09-03 16:59:12 +10:00
Siddharth Bharat Purohit f5fbc2fac1 AP_Compass: use AP_Math inverse library 2015-09-03 16:59:12 +10:00
Jonathan Challinger 0edf1df28e AP_Compass: loosen calibration acceptance tolerance 2015-09-03 16:59:12 +10:00
Jonathan Challinger 5a12991d29 CompassCalibrator: remove dependence on AP_Notify 2015-09-03 16:59:12 +10:00
Jonathan Challinger 05d3616e0d AP_Compass: fix sitl build 2015-09-03 16:59:11 +10:00
Jonathan Challinger 7cb9fa8898 AP_Compass: Correct parameter checks in compass cal 2015-09-03 16:59:11 +10:00
Jonathan Challinger 6d45660568 AP_Compass: refactor run_fit_chunk logic 2015-09-03 16:59:11 +10:00
Jonathan Challinger f2acf2cb88 AP_Compass: more parameter checks in compass calibrator 2015-09-03 16:59:11 +10:00
Jonathan Challinger 929ddb5685 AP_Compass: fix a math error in the compass calibrator 2015-09-03 16:59:10 +10:00
Jonathan Challinger 328cf82c3d CompassCalibrator: update AP_Notify on failure 2015-09-03 16:59:10 +10:00
Jonathan Challinger d31d385490 AP_Compass: changes and fixes to LMA-based compass calibrate 2015-09-03 16:59:10 +10:00
bugobliterator c66bfc95e1 Compass: Add Levenberg-Marquadt for ellipsoid fit 2015-09-03 16:59:10 +10:00
bugobliterator 7711dde2ad Compass: implement 9 parameter ellipsoid fit 2015-09-03 16:59:10 +10:00
bugobliterator 35555c7b21 Compass: Add math for 9 parameter fitting 2015-09-03 16:59:10 +10:00
bugobliterator 7295537e8a Compass: decrease sphere coverage to 1/3rd
for faster sample collection
2015-09-03 16:59:10 +10:00