Commit Graph

68 Commits

Author SHA1 Message Date
Siddharth Purohit c0eb27cc35 AP_Compass: pull compass calibrator out into a separate thread 2020-06-05 09:38:40 +10:00
Andrew Tridgell 660f65e6b8 AP_Compass: use GCS_SEND_TEXT() 2020-04-29 07:36:55 +10:00
Andrew Tridgell 270844745f AP_Compass: limit rotations we try to ROTATION_MAX_AUTO_ROTATION 2020-01-01 16:59:27 +11:00
Peter Barker 880af0de4a AP_Compass: tidy constructor 2019-12-05 17:38:57 +11:00
Peter Barker 823f2bb217 AP_Compass: make compass_cal_status_t enum class Status within CompassCalibrator 2019-12-05 17:38:57 +11:00
Andrew Tridgell 6fd0ca36aa AP_Compass: added estimation of compass scale factor
this adds new COMPASS_SCALE, COMPASS_SCALE2 and COMPASS_SCALE3
parameters, which give the sensor scaling factor. It is used to
compensate for an incorrect scaling in a compass.

The 3D compass calibration process will set the correct value
automatically, otherwise users can set the value to a known value for
an existing compass
2019-12-03 20:48:23 +11:00
Randy Mackay ecb60955ff AP_Compass: minor comment fix
Co-Authored-By: Peter Barker <pb-gh@barker.dropbear.id.au>
2019-11-26 11:10:06 +11:00
lukezhqin 32f11ba863 AP_Compass: fix thin_samples to avoid comparing sample to itself 2019-11-26 11:10:06 +11:00
Randy Mackay f97cfd1065 AP_Compass: fix calibrator update when step one fails 2019-11-26 11:10:06 +11:00
Randy Mackay 89fa324a2b AP_Compass: rename CompassCalibrator::clear to stop 2019-11-26 11:10:06 +11:00
Randy Mackay 90cfbe01e4 AP_Compass: remove unused calc_mean_squared_residuals 2019-11-26 11:10:06 +11:00
Randy Mackay feb0f141fa AP_Compass: add comments to calibrator 2019-11-26 11:10:06 +11:00
Randy Mackay 09046aec66 AP_Compass: formatting fixes
this should be a non-functional change
2019-11-26 11:10:06 +11:00
Randy Mackay f58b09ebef AP_Compass: constify get_completion_mask and remove use of auto 2019-11-26 11:10:06 +11:00
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