From 04ada8e4368bb80db350a1a748d2884d60c6770e Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 12 Feb 2024 23:28:16 -0600 Subject: [PATCH] Toyota: log engine RPM (#31423) * Update carstate.py * 42 is safe * mirai * we hit this after 30 mins: Exceeded message traversal limit. See capnp::ReaderOptions. * too easy to write this bug, no need to be generic yet * Update ref_commit --- selfdrive/car/toyota/carstate.py | 6 ++++++ selfdrive/test/process_replay/ref_commit | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/toyota/carstate.py b/selfdrive/car/toyota/carstate.py index 2461fa9a2..e4ea0d30f 100644 --- a/selfdrive/car/toyota/carstate.py +++ b/selfdrive/car/toyota/carstate.py @@ -95,6 +95,9 @@ class CarState(CarStateBase): ret.leftBlinker = cp.vl["BLINKERS_STATE"]["TURN_SIGNALS"] == 1 ret.rightBlinker = cp.vl["BLINKERS_STATE"]["TURN_SIGNALS"] == 2 + if self.CP.carFingerprint != CAR.MIRAI: + ret.engineRpm = cp.vl["ENGINE_RPM"]["RPM"] + ret.steeringTorque = cp.vl["STEER_TORQUE_SENSOR"]["STEER_TORQUE_DRIVER"] ret.steeringTorqueEps = cp.vl["STEER_TORQUE_SENSOR"]["STEER_TORQUE_EPS"] * self.eps_torque_scale # we could use the override bit from dbc, but it's triggered at too high torque values @@ -180,6 +183,9 @@ class CarState(CarStateBase): ("STEER_TORQUE_SENSOR", 50), ] + if CP.carFingerprint != CAR.MIRAI: + messages.append(("ENGINE_RPM", 42)) + if CP.carFingerprint in UNSUPPORTED_DSU_CAR: messages.append(("DSU_CRUISE", 5)) messages.append(("PCM_CRUISE_ALT", 1)) diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index f49776ecc..f5ad6407d 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -21472c7936cbf3a3b585ddda8c08f1b814fdd6d3 \ No newline at end of file +bd44a98bdb248f3c7b988f81ee130c2542b18ae7