Browse Source

AC_WPNav: add get_target_alt method

mission-4.1.18
Randy Mackay 12 years ago
parent
commit
bc87118062
  1. 2
      ArduCopter/ArduCopter.pde
  2. 3
      libraries/AC_WPNav/AC_WPNav.h

2
ArduCopter/ArduCopter.pde

@ -1967,7 +1967,7 @@ void update_throttle_mode(void) @@ -1967,7 +1967,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_destination_alt(), g.auto_velocity_z_min, g.auto_velocity_z_max);
get_throttle_althold_with_slew(wp_nav.get_target_alt(), g.auto_velocity_z_min, g.auto_velocity_z_max);
}
break;

3
libraries/AC_WPNav/AC_WPNav.h

@ -39,6 +39,9 @@ public: @@ -39,6 +39,9 @@ public:
/// get_loiter_target - get loiter target as position vector (from home in cm)
Vector3f get_loiter_target() { return _target; }
/// get_target_alt - get loiter's target altitude
float get_target_alt() { return _target.z; }
/// set_loiter_target in cm from home
void set_loiter_target(const Vector3f& position) { _target = position; }

Loading…
Cancel
Save