|
|
|
@ -12,7 +12,9 @@ AP_Compass_SITL::AP_Compass_SITL()
@@ -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)); |
|
|
|
|