diff --git a/libraries/AC_WPNav/AC_WPNav.cpp b/libraries/AC_WPNav/AC_WPNav.cpp index b0d18df3e0..0d9f9d2951 100644 --- a/libraries/AC_WPNav/AC_WPNav.cpp +++ b/libraries/AC_WPNav/AC_WPNav.cpp @@ -386,7 +386,7 @@ bool AC_WPNav::advance_wp_target_along_track(float dt) // calculate point at which velocity switches from linear to sqrt float linear_velocity = _wp_speed_cms; float kP = _pos_control.get_pos_xy_p().kP(); - if (kP >= 0.0f) { // avoid divide by zero + if (is_positive(kP)) { // avoid divide by zero linear_velocity = _track_accel/kP; }