From 4de5f67a91fe981f920f73770ce73989a452a8b2 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Sat, 23 Mar 2013 22:06:24 +0900 Subject: [PATCH] Copter: replace wp_nav.get_target_alt with get_destination_alt --- ArduCopter/ArduCopter.pde | 2 +- ArduCopter/Log.pde | 2 +- ArduCopter/navigation.pde | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde index 518780e367..8f2c9c0a6b 100644 --- a/ArduCopter/ArduCopter.pde +++ b/ArduCopter/ArduCopter.pde @@ -1969,7 +1969,7 @@ void update_throttle_mode(void) case THROTTLE_AUTO: // auto pilot altitude controller with target altitude held in next_WP.alt if(motors.auto_armed() == true) { - get_throttle_althold_with_slew(wp_nav.get_target_alt(), g.auto_velocity_z_min, g.auto_velocity_z_max); + get_throttle_althold_with_slew(wp_nav.get_destination_alt(), g.auto_velocity_z_min, g.auto_velocity_z_max); } break; diff --git a/ArduCopter/Log.pde b/ArduCopter/Log.pde index 1bca767626..a74bd8f1f5 100644 --- a/ArduCopter/Log.pde +++ b/ArduCopter/Log.pde @@ -550,7 +550,7 @@ static void Log_Write_Control_Tuning() throttle_in : g.rc_3.control_in, sonar_alt : sonar_alt, baro_alt : baro_alt, - next_wp_alt : wp_nav.get_target_alt(), + next_wp_alt : wp_nav.get_destination_alt(), nav_throttle : nav_throttle, angle_boost : angle_boost, climb_rate : climb_rate, diff --git a/ArduCopter/navigation.pde b/ArduCopter/navigation.pde index 9304cf7df3..8712233181 100644 --- a/ArduCopter/navigation.pde +++ b/ArduCopter/navigation.pde @@ -190,19 +190,19 @@ static bool check_missed_wp() static void force_new_altitude(float new_alt) { // update new target altitude - wp_nav.set_target_alt(new_alt); + wp_nav.set_destination_alt(new_alt); set_alt_change(REACHED_ALT); } static void set_new_altitude(float new_alt) { // if no change exit immediately - if(new_alt == wp_nav.get_target_alt()) { + if(new_alt == wp_nav.get_destination_alt()) { return; } // update new target altitude - wp_nav.set_target_alt(new_alt); + wp_nav.set_destination_alt(new_alt); if(new_alt > (current_loc.alt + 80)) { // we are below, going up @@ -223,12 +223,12 @@ static void verify_altitude() { if(alt_change_flag == ASCENDING) { // we are below, going up - if(current_loc.alt > wp_nav.get_target_alt() - 50) { + if(current_loc.alt > wp_nav.get_destination_alt() - 50) { set_alt_change(REACHED_ALT); } }else if (alt_change_flag == DESCENDING) { // we are above, going down - if(current_loc.alt <= wp_nav.get_target_alt() + 50){ + if(current_loc.alt <= wp_nav.get_destination_alt() + 50){ set_alt_change(REACHED_ALT); } }