mirror of https://github.com/commaai/panda.git
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:
parent
c97f572208
commit
c1e79333fb
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue