mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-22 06:22:06 +08:00
toyota SNG hack
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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')))
|
||||
|
||||
Reference in New Issue
Block a user