up when 0

This commit is contained in:
Shane Smiskol 2023-05-02 16:34:32 -07:00
parent 14cfb78ab2
commit fc9b459651
1 changed files with 2 additions and 2 deletions

View File

@ -623,8 +623,8 @@ bool steer_angle_cmd_checks(int desired_angle, bool steer_control_enabled, const
int delta_angle_up = (interpolate(limits.angle_rate_up_lookup, vehicle_speed - 1.) * limits.angle_deg_to_can) + 1.;
int delta_angle_down = (interpolate(limits.angle_rate_down_lookup, vehicle_speed - 1.) * limits.angle_deg_to_can) + 1.;
int highest_desired_angle = desired_angle_last + ((desired_angle_last > 0) ? delta_angle_up : delta_angle_down);
int lowest_desired_angle = desired_angle_last - ((desired_angle_last >= 0) ? delta_angle_down : delta_angle_up);
int highest_desired_angle = desired_angle_last + ((desired_angle_last >= 0) ? delta_angle_up : delta_angle_down);
int lowest_desired_angle = desired_angle_last - ((desired_angle_last > 0) ? delta_angle_down : delta_angle_up);
// check for violation;
violation |= max_limit_check(desired_angle, highest_desired_angle, lowest_desired_angle);