mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-20 06:43:56 -04:00
Plane: added auto fence enable on VTOL takeoff
fixes issue#724
This commit is contained in:
parent
c81d8364ac
commit
33f17588b2
@ -1012,6 +1012,7 @@ private:
|
||||
void takeoff_calc_pitch(void);
|
||||
int8_t takeoff_tail_hold(void);
|
||||
int16_t get_takeoff_pitch_min_cd(void);
|
||||
void complete_auto_takeoff(void);
|
||||
void print_hit_enter();
|
||||
void ahrs_update();
|
||||
void update_speed_height(void);
|
||||
|
@ -548,15 +548,7 @@ bool Plane::verify_takeoff()
|
||||
auto_state.takeoff_complete = true;
|
||||
next_WP_loc = prev_WP_loc = current_loc;
|
||||
|
||||
#if GEOFENCE_ENABLED == ENABLED
|
||||
if (g.fence_autoenable > 0) {
|
||||
if (! geofence_set_enabled(true, AUTO_TOGGLED)) {
|
||||
gcs_send_text(MAV_SEVERITY_NOTICE, "Enable fence failed (cannot autoenable");
|
||||
} else {
|
||||
gcs_send_text(MAV_SEVERITY_INFO, "Fence enabled (autoenabled)");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
plane.complete_auto_takeoff();
|
||||
|
||||
// don't cross-track on completion of takeoff, as otherwise we
|
||||
// can end up doing too sharp a turn
|
||||
|
@ -1684,6 +1684,9 @@ bool QuadPlane::verify_vtol_takeoff(const AP_Mission::Mission_Command &cmd)
|
||||
}
|
||||
transition_state = TRANSITION_AIRSPEED_WAIT;
|
||||
plane.TECS_controller.set_pitch_max_limit(transition_pitch_max);
|
||||
|
||||
plane.complete_auto_takeoff();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -225,3 +225,19 @@ return_zero:
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
called when an auto-takeoff is complete
|
||||
*/
|
||||
void Plane::complete_auto_takeoff(void)
|
||||
{
|
||||
#if GEOFENCE_ENABLED == ENABLED
|
||||
if (g.fence_autoenable > 0) {
|
||||
if (! geofence_set_enabled(true, AUTO_TOGGLED)) {
|
||||
gcs_send_text(MAV_SEVERITY_NOTICE, "Enable fence failed (cannot autoenable");
|
||||
} else {
|
||||
gcs_send_text(MAV_SEVERITY_INFO, "Fence enabled (autoenabled)");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user