diff --git a/libraries/AP_Compass/AP_Compass.cpp b/libraries/AP_Compass/AP_Compass.cpp index cf32e46cd9..53930359ff 100644 --- a/libraries/AP_Compass/AP_Compass.cpp +++ b/libraries/AP_Compass/AP_Compass.cpp @@ -1856,21 +1856,6 @@ bool Compass::configured(char *failure_msg, uint8_t failure_msg_len) return all_configured; } -#if CONFIG_HAL_BOARD == HAL_BOARD_SITL -// setup _Bearth -void Compass::_setup_earth_field(void) -{ - // assume a earth field strength of 400 - _sitl.Bearth = {400, 0, 0}; - - // rotate _Bearth for inclination and declination. -66 degrees - // is the inclination in Canberra, Australia - Matrix3f R; - R.from_euler(0, ToRad(66), get_declination()); - _sitl.Bearth = R * _sitl.Bearth; -} -#endif - /* set the type of motor compensation to use */ diff --git a/libraries/AP_Compass/AP_Compass.h b/libraries/AP_Compass/AP_Compass.h index 1b73e193e3..3236c88aae 100644 --- a/libraries/AP_Compass/AP_Compass.h +++ b/libraries/AP_Compass/AP_Compass.h @@ -289,10 +289,6 @@ public: bool configured(uint8_t i); bool configured(char *failure_msg, uint8_t failure_msg_len); -#if CONFIG_HAL_BOARD == HAL_BOARD_SITL - void _setup_earth_field(); -#endif - // return last update time in microseconds uint32_t last_update_usec(void) const { return last_update_usec(_first_usable); } uint32_t last_update_usec(uint8_t i) const { return _get_state(Priority(i)).last_update_usec; } @@ -302,14 +298,6 @@ public: static const struct AP_Param::GroupInfo var_info[]; - // HIL variables - struct { - Vector3f Bearth; - // float last_declination; - // bool healthy[COMPASS_MAX_INSTANCES]; - // Vector3f field[COMPASS_MAX_INSTANCES]; - } _sitl; - enum LearnType { LEARN_NONE=0, LEARN_INTERNAL=1, diff --git a/libraries/AP_Compass/AP_Compass_SITL.cpp b/libraries/AP_Compass/AP_Compass_SITL.cpp index 58685add85..a4134f4690 100644 --- a/libraries/AP_Compass/AP_Compass_SITL.cpp +++ b/libraries/AP_Compass/AP_Compass_SITL.cpp @@ -9,7 +9,6 @@ AP_Compass_SITL::AP_Compass_SITL() : _sitl(AP::sitl()) { if (_sitl != nullptr) { - _compass._setup_earth_field(); for (uint8_t i=0; imag_devid[i]; if (dev_id == 0) {