angle safety: make angle conversion factor a float (#1498)

* make this a float

* no need to cast to float now
This commit is contained in:
Shane Smiskol 2023-07-06 17:06:31 -07:00 committed by GitHub
parent c97f572208
commit c1e79333fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -219,7 +219,7 @@ static int ford_rx_hook(CANPacket_t *to_push) {
float ford_yaw_rate = (((GET_BYTE(to_push, 2) << 8U) | GET_BYTE(to_push, 3)) * 0.0002) - 6.5;
float current_curvature = ford_yaw_rate / MAX(vehicle_speed.values[0] / VEHICLE_SPEED_FACTOR, 0.1);
// convert current curvature into units on CAN for comparison with desired curvature
update_sample(&angle_meas, ROUND(current_curvature * (float)FORD_STEERING_LIMITS.angle_deg_to_can));
update_sample(&angle_meas, ROUND(current_curvature * FORD_STEERING_LIMITS.angle_deg_to_can));
}
// Update gas pedal

View File

@ -67,7 +67,7 @@ typedef struct {
const bool has_steer_req_tolerance;
// angle cmd limits
const int angle_deg_to_can;
const float angle_deg_to_can;
const struct lookup_t angle_rate_up_lookup;
const struct lookup_t angle_rate_down_lookup;
const int max_angle_error; // used to limit error between meas and cmd while enabled