FrogPilot's Toyota tune
This commit is contained in:
@@ -268,6 +268,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
|||||||
{"FPSCounter", PERSISTENT},
|
{"FPSCounter", PERSISTENT},
|
||||||
{"FrogPilotTogglesUpdated", PERSISTENT},
|
{"FrogPilotTogglesUpdated", PERSISTENT},
|
||||||
{"FrogsGoMoo", PERSISTENT},
|
{"FrogsGoMoo", PERSISTENT},
|
||||||
|
{"FrogsGoMooTune", PERSISTENT},
|
||||||
{"GoatScream", PERSISTENT},
|
{"GoatScream", PERSISTENT},
|
||||||
{"LaneLinesWidth", PERSISTENT},
|
{"LaneLinesWidth", PERSISTENT},
|
||||||
{"LateralTune", PERSISTENT},
|
{"LateralTune", PERSISTENT},
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ class CarController:
|
|||||||
params = Params()
|
params = Params()
|
||||||
|
|
||||||
self.cydia_tune = params.get_bool("CydiaTune")
|
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):
|
def update(self, CC, CS, now_nanos, frogpilot_variables):
|
||||||
actuators = CC.actuators
|
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:
|
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
|
should_compensate = False
|
||||||
# limit minimum to only positive until first positive is reached after engagement, don't calculate when long isn't active
|
# 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
|
accel_offset = CS.pcm_neutral_force / self.CP.mass
|
||||||
else:
|
else:
|
||||||
accel_offset = 0.
|
accel_offset = 0.
|
||||||
@@ -176,7 +177,7 @@ class CarController:
|
|||||||
if (self.frame % 3 == 0 and self.CP.openpilotLongitudinalControl) or pcm_cancel_cmd:
|
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
|
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
|
# 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
|
# Lexus IS uses a different cancellation message
|
||||||
if pcm_cancel_cmd and self.CP.carFingerprint in UNSUPPORTED_DSU_CAR:
|
if pcm_cancel_cmd and self.CP.carFingerprint in UNSUPPORTED_DSU_CAR:
|
||||||
|
|||||||
@@ -282,6 +282,25 @@ class CarInterface(CarInterfaceBase):
|
|||||||
tune.kpV = [0.8, 1.]
|
tune.kpV = [0.8, 1.]
|
||||||
tune.kiBP = [0., 5.]
|
tune.kiBP = [0., 5.]
|
||||||
tune.kiV = [0.3, 1.]
|
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"):
|
elif (candidate in TSS2_CAR or ret.enableGasInterceptor) and params.get_bool("DragonPilotTune"):
|
||||||
# Credit goes to the DragonPilot team!
|
# Credit goes to the DragonPilot team!
|
||||||
tune.deadzoneBP = [0., 16., 20., 30.]
|
tune.deadzoneBP = [0., 16., 20., 30.]
|
||||||
|
|||||||
@@ -121,6 +121,7 @@ FrogPilotVehiclesPanel::FrogPilotVehiclesPanel(SettingsWindow *parent) : FrogPil
|
|||||||
{"StockTune", tr("Stock")},
|
{"StockTune", tr("Stock")},
|
||||||
{"CydiaTune", tr("Cydia's")},
|
{"CydiaTune", tr("Cydia's")},
|
||||||
{"DragonPilotTune", tr("DragonPilot's")},
|
{"DragonPilotTune", tr("DragonPilot's")},
|
||||||
|
{"FrogsGoMooTune", tr("FrogPilot's")},
|
||||||
};
|
};
|
||||||
toggle = new FrogPilotButtonsParamControl(param, title, desc, icon, tuneOptions);
|
toggle = new FrogPilotButtonsParamControl(param, title, desc, icon, tuneOptions);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user