mirror of https://github.com/commaai/panda.git
Subaru: convert measured angle to centigrees (#1567)
convert to centigrees
This commit is contained in:
parent
972b0dca94
commit
5801582baf
|
@ -108,7 +108,8 @@ static int subaru_rx_hook(CANPacket_t *to_push) {
|
|||
update_sample(&torque_driver, torque_driver_new);
|
||||
|
||||
int angle_meas_new = (GET_BYTES(to_push, 4, 2) & 0xFFFFU);
|
||||
angle_meas_new = ROUND(to_signed(angle_meas_new, 16));
|
||||
// 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);
|
||||
update_sample(&angle_meas, angle_meas_new);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ class TestSubaruSafetyBase(common.PandaSafetyTest, common.DriverTorqueSteeringSa
|
|||
|
||||
ALT_BUS = SUBARU_MAIN_BUS
|
||||
|
||||
DEG_TO_CAN = -46.08
|
||||
DEG_TO_CAN = -100
|
||||
|
||||
def setUp(self):
|
||||
self.packer = CANPackerPanda("subaru_global_2017_generated")
|
||||
|
|
Loading…
Reference in New Issue