Copter: remove compass accumulate

This commit is contained in:
Randy Mackay 2018-08-02 12:19:50 +09:00 committed by Andrew Tridgell
parent 936dca7531
commit 346e9e36db
4 changed files with 6 additions and 13 deletions

View File

@ -117,7 +117,6 @@ const AP_Scheduler::Task Copter::scheduler_tasks[] = {
#endif
SCHED_TASK(three_hz_loop, 3, 75),
SCHED_TASK_CLASS(AP_ServoRelayEvents, &copter.ServoRelayEvents, update_events, 50, 75),
SCHED_TASK(compass_accumulate, 100, 100),
SCHED_TASK_CLASS(AP_Baro, &copter.barometer, accumulate, 50, 90),
#if PRECISION_LANDING == ENABLED
SCHED_TASK(update_precland, 400, 50),
@ -456,6 +455,9 @@ void Copter::one_hz_loop()
// indicates that the sensor or subsystem is present but not
// functioning correctly
update_sensor_status_flags();
// init compass location for declination
init_compass_location();
}
// called at 50hz

View File

@ -862,7 +862,7 @@ private:
bool rangefinder_alt_ok();
void rpm_update();
void init_compass();
void compass_accumulate(void);
void init_compass_location();
void init_optflow();
void update_optical_flow(void);
void compass_cal_update(void);

View File

@ -137,8 +137,6 @@ MAV_RESULT Copter::mavlink_compassmot(mavlink_channel_t chan)
while (command_ack_start == command_ack_counter && compass.healthy() && motors->armed()) {
// 50hz loop
if (millis() - last_run_time < 20) {
// grab some compass values
compass.accumulate();
hal.scheduler->delay(5);
continue;
}

View File

@ -102,17 +102,10 @@ void Copter::init_compass()
}
/*
if the compass is enabled then try to accumulate a reading
also update initial location used for declination
initialise compass's location used for declination
*/
void Copter::compass_accumulate(void)
void Copter::init_compass_location()
{
if (!g.compass_enabled) {
return;
}
compass.accumulate();
// update initial location used for declination
if (!ap.compass_init_location) {
Location loc;