AP_Compass: don't reset SITL compass offsets if set by user

makes for easier EKF compass bias learning testing
This commit is contained in:
Andrew Tridgell 2019-09-05 20:18:54 +10:00
parent 10675ab5c4
commit 71ad90819e

View File

@ -12,7 +12,9 @@ AP_Compass_SITL::AP_Compass_SITL()
_compass._setup_earth_field();
for (uint8_t i=0; i<SITL_NUM_COMPASSES; i++) {
// default offsets to correct value
_compass.set_offsets(i, _sitl->mag_ofs);
if (_compass.get_offsets(i).is_zero()) {
_compass.set_offsets(i, _sitl->mag_ofs);
}
_compass_instance[i] = register_compass();
set_dev_id(_compass_instance[i], AP_HAL::Device::make_bus_id(AP_HAL::Device::BUS_TYPE_SITL, i, 0, DEVTYPE_SITL));