mirror of https://github.com/commaai/panda.git
Subaru: consider true angle sign in safety (#1681)
* this fails * this doesn't!
This commit is contained in:
parent
9fd1b268b4
commit
635db84095
|
@ -159,7 +159,7 @@ static int subaru_rx_hook(CANPacket_t *to_push) {
|
|||
|
||||
int angle_meas_new = (GET_BYTES(to_push, 4, 2) & 0xFFFFU);
|
||||
// convert Steering_Torque -> Steering_Angle to centidegrees, to match the ES_LKAS_ANGLE angle request units
|
||||
angle_meas_new = ROUND(to_signed(angle_meas_new, 16) * 2.17);
|
||||
angle_meas_new = ROUND(to_signed(angle_meas_new, 16) * -2.17);
|
||||
update_sample(&angle_meas, angle_meas_new);
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ class TestSubaruSafetyBase(common.PandaSafetyTest, MeasurementSafetyTest):
|
|||
ALT_MAIN_BUS = SUBARU_MAIN_BUS
|
||||
ALT_CAM_BUS = SUBARU_CAM_BUS
|
||||
|
||||
DEG_TO_CAN = -100
|
||||
DEG_TO_CAN = 100
|
||||
|
||||
INACTIVE_GAS = 1818
|
||||
|
||||
|
|
Loading…
Reference in New Issue