FrogPilot's Toyota tune

This commit is contained in:
James
2024-02-27 16:34:47 -07:00
committed by FrogAi
parent 9f12f67d06
commit caba8a53b4
4 changed files with 24 additions and 2 deletions

View File

@@ -53,6 +53,7 @@ class CarController:
params = Params()
self.cydia_tune = params.get_bool("CydiaTune")
self.frogs_go_moo_tune = params.get_bool("FrogsGoMooTune")
def update(self, CC, CS, now_nanos, frogpilot_variables):
actuators = CC.actuators
@@ -141,7 +142,7 @@ class CarController:
if (self.CP.carFingerprint in NO_STOP_TIMER_CAR and actuators.accel < 1e-3 or stopping) or CS.out.vEgo < 1e-3:
should_compensate = False
# limit minimum to only positive until first positive is reached after engagement, don't calculate when long isn't active
if CC.longActive and should_compensate and not self.prohibit_neg_calculation and self.cydia_tune:
if CC.longActive and should_compensate and not self.prohibit_neg_calculation and (self.cydia_tune or self.frogs_go_moo_tune):
accel_offset = CS.pcm_neutral_force / self.CP.mass
else:
accel_offset = 0.
@@ -176,7 +177,7 @@ class CarController:
if (self.frame % 3 == 0 and self.CP.openpilotLongitudinalControl) or pcm_cancel_cmd:
lead = hud_control.leadVisible or CS.out.vEgo < 12. # at low speed we always assume the lead is present so ACC can be engaged
# when stopping, send -2.5 raw acceleration immediately to prevent vehicle from creeping, else send actuators.accel
accel_raw = -2.5 if stopping and self.cydia_tune else actuators.accel
accel_raw = -2.5 if stopping and (self.cydia_tune or self.frogs_go_moo_tune) else actuators.accel
# Lexus IS uses a different cancellation message
if pcm_cancel_cmd and self.CP.carFingerprint in UNSUPPORTED_DSU_CAR: