mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
Sub: move automatic declination setting into AP_Compass itself
This commit is contained in:
parent
20626a1fe1
commit
03e6065380
@ -284,9 +284,6 @@ void Sub::one_hz_loop()
|
|||||||
// log terrain data
|
// log terrain data
|
||||||
terrain_logging();
|
terrain_logging();
|
||||||
|
|
||||||
// init compass location for declination
|
|
||||||
init_compass_location();
|
|
||||||
|
|
||||||
// need to set "likely flying" when armed to allow for compass
|
// need to set "likely flying" when armed to allow for compass
|
||||||
// learning to run
|
// learning to run
|
||||||
ahrs.set_likely_flying(hal.util->get_soft_armed());
|
ahrs.set_likely_flying(hal.util->get_soft_armed());
|
||||||
|
@ -454,7 +454,6 @@ private:
|
|||||||
static const AP_Param::Info var_info[];
|
static const AP_Param::Info var_info[];
|
||||||
static const struct LogStructure log_structure[];
|
static const struct LogStructure log_structure[];
|
||||||
|
|
||||||
void init_compass_location();
|
|
||||||
void fast_loop();
|
void fast_loop();
|
||||||
void fifty_hz_loop();
|
void fifty_hz_loop();
|
||||||
void update_batt_compass(void);
|
void update_batt_compass(void);
|
||||||
|
@ -80,21 +80,6 @@ void Sub::rpm_update(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#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
|
// initialise optical flow sensor
|
||||||
#if OPTFLOW == ENABLED
|
#if OPTFLOW == ENABLED
|
||||||
void Sub::init_optflow()
|
void Sub::init_optflow()
|
||||||
|
Loading…
Reference in New Issue
Block a user