From 4d0cf2c11d1e881aea51c387cb73109d351cd799 Mon Sep 17 00:00:00 2001 From: Leonard Hall Date: Mon, 6 Sep 2021 17:19:27 +0930 Subject: [PATCH] AC_WPNav: Fix calculation of _scurve_jerk_time using radians. --- libraries/AC_WPNav/AC_WPNav.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/AC_WPNav/AC_WPNav.cpp b/libraries/AC_WPNav/AC_WPNav.cpp index e27705c25d..ffaf35f2cd 100644 --- a/libraries/AC_WPNav/AC_WPNav.cpp +++ b/libraries/AC_WPNav/AC_WPNav.cpp @@ -860,9 +860,9 @@ void AC_WPNav::calc_scurve_jerk_and_jerk_time() } // calculate jerk time - // jounce (the rate of change of jerk) uses the attitude control input time constant because multicopters - // lean to accelerate meaning the change in angle is equivalent to the change in acceleration - const float jounce = MIN(_attitude_control.get_accel_roll_max() * GRAVITY_MSS, _attitude_control.get_accel_pitch_max() * GRAVITY_MSS); + // Jounce (the rate of change of jerk) uses the attitude control input time constant because multicopters + // lean to accelerate. This means the change in angle is equivalent to the change in acceleration + const float jounce = MIN(_attitude_control.get_accel_roll_max_radss() * GRAVITY_MSS, _attitude_control.get_accel_pitch_max_radss() * GRAVITY_MSS); if (is_positive(jounce)) { _scurve_jerk_time = MAX(_attitude_control.get_input_tc(), 0.5f * _scurve_jerk * M_PI / jounce); } else {