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

@@ -268,6 +268,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"FPSCounter", PERSISTENT},
{"FrogPilotTogglesUpdated", PERSISTENT},
{"FrogsGoMoo", PERSISTENT},
{"FrogsGoMooTune", PERSISTENT},
{"GoatScream", PERSISTENT},
{"LaneLinesWidth", PERSISTENT},
{"LateralTune", PERSISTENT},

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:

View File

@@ -282,6 +282,25 @@ class CarInterface(CarInterfaceBase):
tune.kpV = [0.8, 1.]
tune.kiBP = [0., 5.]
tune.kiV = [0.3, 1.]
elif params.get_bool("FrogsGoMooTune"):
tune.deadzoneBP = [0., 16., 20., 30.]
tune.deadzoneV = [0., .03, .06, .15]
tune.kpBP = [0., 5., 20.]
tune.kpV = [1.3, 1.0, 0.7]
# In MPH = [ 0, 27, 45, 60, 89]
tune.kiBP = [ 0., 12., 20., 27., 40.]
tune.kiV = [.35, .215, .195, .10, .01]
if candidate in TSS2_CAR:
ret.stopAccel = -2.5
ret.stoppingDecelRate = 0.009 # reach stopping target smoothly
else:
ret.stopAccel = -2.5 # on stock Toyota this is -2.5
ret.stoppingDecelRate = 0.3 # This is okay for TSS-P
ret.vEgoStarting = 0.1
ret.vEgoStopping = 0.1
elif (candidate in TSS2_CAR or ret.enableGasInterceptor) and params.get_bool("DragonPilotTune"):
# Credit goes to the DragonPilot team!
tune.deadzoneBP = [0., 16., 20., 30.]

View File

@@ -121,6 +121,7 @@ FrogPilotVehiclesPanel::FrogPilotVehiclesPanel(SettingsWindow *parent) : FrogPil
{"StockTune", tr("Stock")},
{"CydiaTune", tr("Cydia's")},
{"DragonPilotTune", tr("DragonPilot's")},
{"FrogsGoMooTune", tr("FrogPilot's")},
};
toggle = new FrogPilotButtonsParamControl(param, title, desc, icon, tuneOptions);