Plane: pass height to landing gear update

This commit is contained in:
Andrew Tridgell 2018-11-09 15:40:20 +11:00
parent 486ecd6148
commit 432d786f82
3 changed files with 13 additions and 1 deletions

View File

@ -102,7 +102,7 @@ const AP_Scheduler::Task Plane::scheduler_tasks[] = {
SCHED_TASK(publish_osd_info, 1, 10),
#endif
#if LANDING_GEAR_ENABLED == ENABLED
SCHED_TASK_CLASS(AP_LandingGear, &plane.g2.landing_gear, update, 10, 50),
SCHED_TASK(landing_gear_update, 5, 50),
#endif
};

View File

@ -961,6 +961,7 @@ private:
void takeoff_calc_pitch(void);
int8_t takeoff_tail_hold(void);
int16_t get_takeoff_pitch_min_cd(void);
void landing_gear_update(void);
void complete_auto_takeoff(void);
void ahrs_update();
void update_speed_height(void);

View File

@ -272,3 +272,14 @@ void Plane::complete_auto_takeoff(void)
}
#endif
}
#if LANDING_GEAR_ENABLED == ENABLED
/*
update landing gear
*/
void Plane::landing_gear_update(void)
{
g2.landing_gear.update(relative_ground_altitude(g.rangefinder_landing));
}
#endif