toyota SNG hack

This commit is contained in:
Rick Lan
2024-07-01 15:27:59 +08:00
parent 7048b83cde
commit bfcdf31291
3 changed files with 8 additions and 1 deletions
+1
View File
@@ -236,6 +236,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"dp_toyota_enhanced_bsm", PERSISTENT},
{"dp_toyota_auto_brake_hold", PERSISTENT},
{"dp_device_offroad", CLEAR_ON_MANAGER_START},
{"dp_toyota_sng", PERSISTENT},
};
} // namespace
+6 -1
View File
@@ -54,10 +54,12 @@ class CarController(CarControllerBase):
self.gas = 0
self.accel = 0
# dp
params = Params()
self.dlc = DoorLockController()
self.pcc = PCMCompensationController(CP, self.params, Params().get_bool("dp_toyota_pcm_compensation"))
self.pcc = PCMCompensationController(CP, self.params, params.get_bool("dp_toyota_pcm_compensation"))
self.bsmc = BSMController(self.CP)
self.bhc = BrakeHoldController()
self._dp_toyota_sng = params.get_bool("dp_toyota_sng")
def update(self, CC, CS, now_nanos):
actuators = CC.actuators
@@ -140,6 +142,9 @@ class CarController(CarControllerBase):
if CS.pcm_acc_status != 8:
# pcm entered standstill or it's disabled
self.standstill_req = False
# dp - sng hack
if self.dp_toyota_sng:
self.standstill_req = False
self.last_standstill = CS.out.standstill
+1
View File
@@ -74,6 +74,7 @@ def manager_init() -> None:
("dp_device_dm_unavailable", "0"),
("dp_toyota_enhanced_bsm", "0"),
("dp_toyota_auto_brake_hold", "0"),
("dp_toyota_sng", "0"),
]
if not PC:
default_params.append(("LastUpdateTime", datetime.datetime.now(datetime.UTC).replace(tzinfo=None).isoformat().encode('utf8')))