Skip to content

Commit f2c8d40

Browse files
committed
AC_AttitudeControl: Real time S-Curve Command Model
1 parent 82c1dc8 commit f2c8d40

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

libraries/AC_AttitudeControl/AC_AttitudeControl.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,17 +1089,16 @@ void AC_AttitudeControl::thrust_vector_rotation_angles(const Quaternion& attitud
10891089
// deceleration limits including basic jerk limiting using _input_tc
10901090
void AC_AttitudeControl::attitude_command_model(float error_angle, float desired_ang_vel, float& target_ang_vel, float& target_ang_accel, float max_ang_vel, float accel_max, float input_tc, float dt) const
10911091
{
1092+
if (!is_positive(dt)) {
1093+
return;
1094+
}
1095+
10921096
// protect against divide by zero
10931097
if (!is_positive(accel_max)) {
10941098
// no acceleration set so default to 1800 degrees/s²
10951099
accel_max = radians(1800);
10961100
}
10971101

1098-
if (!is_positive(dt)) {
1099-
// plane can set this to zero
1100-
dt = 1/400.0;
1101-
}
1102-
11031102
if (!is_positive(input_tc)) {
11041103
// no acceleration set so default to achieve maximum acceleration in 10 clock cycles
11051104
input_tc = dt * 10.0;

0 commit comments

Comments
 (0)