This reverts the change from #13895 and instead resolves the issue by
increasing the scale factor limit to 1.4
There is an open question as to why some RM3100 compasses show a
different scale factor (by about 1.25 times) to other versions of the
same sensor. As we haven't resolved this properly it seems the correct
thing to do is follow the datasheet but allow for a wider range of
scale factors to cope with the variation between sensors
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
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
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
In file included from /home/lucas/p/dronecode/ardupilot/libraries/AP_Compass/Compass.h:6:
/home/lucas/p/dronecode/ardupilot/libraries/AP_Compass/CompassCalibrator.h:86:5: warning: struct 'param_t' was previously declared as a class [-Wmismatched-tags]
struct param_t _params;
^
/home/lucas/p/dronecode/ardupilot/libraries/AP_Compass/CompassCalibrator.h:44:11: note: previous use is here
class param_t {
^
/home/lucas/p/dronecode/ardupilot/libraries/AP_Compass/CompassCalibrator.h:86:5: note: did you mean class here?
struct param_t _params;
^~~~~~
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.
increase iterations to get good results from LM
better check for convergence, comparison with initial fitness is a better way to determine if convergence occurs, if fitness has not improved compared to initial fitness it means optimiser has failed.