Sub: move automatic declination setting into AP_Compass itself

This commit is contained in:
Peter Barker 2019-03-27 18:02:24 +11:00 committed by Andrew Tridgell
parent 20626a1fe1
commit 03e6065380
3 changed files with 0 additions and 19 deletions

View File

@ -284,9 +284,6 @@ void Sub::one_hz_loop()
// log terrain data
terrain_logging();
// init compass location for declination
init_compass_location();
// need to set "likely flying" when armed to allow for compass
// learning to run
ahrs.set_likely_flying(hal.util->get_soft_armed());

View File

@ -454,7 +454,6 @@ private:
static const AP_Param::Info var_info[];
static const struct LogStructure log_structure[];
void init_compass_location();
void fast_loop();
void fifty_hz_loop();
void update_batt_compass(void);

View File

@ -80,21 +80,6 @@ void Sub::rpm_update(void)
}
#endif
/*
initialise compass's location used for declination
*/
void Sub::init_compass_location()
{
// update initial location used for declination
if (!ap.compass_init_location) {
Location loc;
if (ahrs.get_position(loc)) {
compass.set_initial_location(loc.lat, loc.lng);
ap.compass_init_location = true;
}
}
}
// initialise optical flow sensor
#if OPTFLOW == ENABLED
void Sub::init_optflow()