The check for fitness being smaller than the last value should use the
absolute value, to mean the fitness isn't changing since last iteration.
It's currently always quiting the function after the first iteration.
However for Gauss Newton we anyway want to run as many iterations as we
can, because there are ups and downs along the iteration so we might get
say best result where before and after iterations were bad. The lines
above takes care that sane and the best is selected.
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.
The current approach to access the same memory location by using a
reference is giving this warning:
../libraries/AP_AccelCal/AccelCalibrator.cpp: In constructor ‘AccelCalibrator::AccelCalibrator()’:
../libraries/AP_AccelCal/AccelCalibrator.cpp:34:64: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
_param_struct(*reinterpret_cast<struct param_t *>(&_param_array))
^
../libraries/AP_AccelCal/AccelCalibrator.cpp: In member function ‘void AccelCalibrator::run_fit(uint8_t, float&)’:
../libraries/AP_AccelCal/AccelCalibrator.cpp:336:79: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
struct param_t &fit_param(*reinterpret_cast<struct param_t *>(¶m_array));
^
Using a union allows us to get rid of the warning, make sure the sizes of the
different structs match and have a more elegant solution.