AP_Compass: remove unused setup_earth_field

This commit is contained in:
Peter Barker 2021-06-10 09:34:20 +10:00 committed by Andrew Tridgell
parent da785c5ba2
commit 8fbd9b5e40
3 changed files with 0 additions and 28 deletions

View File

@ -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
*/

View File

@ -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,

View File

@ -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; i<MAX_CONNECTED_MAGS; i++) {
uint32_t dev_id = _sitl->mag_devid[i];
if (dev_id == 0) {