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);
|
||||
}
|
||||
|
||||
|
@ -232,7 +232,7 @@ static int subaru_tx_hook(CANPacket_t *to_send) {
|
|||
if (addr == MSG_SUBARU_ES_Distance) {
|
||||
int cruise_throttle = (GET_BYTES(to_send, 2, 2) & 0xFFFU);
|
||||
bool cruise_cancel = GET_BIT(to_send, 56U) != 0U;
|
||||
|
||||
|
||||
if (subaru_longitudinal) {
|
||||
violation |= longitudinal_gas_checks(cruise_throttle, SUBARU_LONG_LIMITS);
|
||||
} else {
|
||||
|
|
|
@ -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