Skip to content

Commit

Permalink
mode_guided: Advance FS, use rtl_alt instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidsastresas committed May 2, 2023
1 parent 184fa8f commit 30ee2aa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ArduCopter/mode_guided.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1290,8 +1290,8 @@ void ModeGuided::update_adv_failsafe()

// start takeoff to arfs_travel_alt
case AC_Adv_Failsafe::StartTakeOff: {
// first set our target altitude
int16_t ascent_altitude = copter.adv_failsafe.get_travel_altitude();
// first set our target altitude, rtl altitude parameter
int16_t ascent_altitude = copter.g.rtl_altitude;
// if not flying, same procedure as takeoff gcs command
if (!AP_Notify::flags.flying) {
do_user_takeoff(ascent_altitude, true); // tranlsate to cm
Expand All @@ -1311,8 +1311,8 @@ void ModeGuided::update_adv_failsafe()
case AC_Adv_Failsafe::AscentToFSCoordAlt:
// when we arrive to arfs_travel_alt, change to next stage, go to failsafe coordinate
if (wp_nav->reached_wp_destination()) {
// get altude to ascent, maximum of failsafe altitude and failsafe travel altitude
int16_t ascent_altitude = copter.adv_failsafe.get_travel_altitude();
// get altude to ascent, rtl altitude parameter
int16_t ascent_altitude = copter.g.rtl_altitude;
// set_destination to o ur failsafe coordinate, but arfs_travel_alt
Location dest(copter.adv_failsafe.get_latitude(), copter.adv_failsafe.get_longitude(), ascent_altitude, Location::AltFrame::ABOVE_HOME);
set_destination(dest);
Expand Down

0 comments on commit 30ee2aa

Please sign in to comment.