diff --git a/common/params.cc b/common/params.cc index cce2649..3749f5c 100644 --- a/common/params.cc +++ b/common/params.cc @@ -268,6 +268,7 @@ std::unordered_map keys = { {"FPSCounter", PERSISTENT}, {"FrogPilotTogglesUpdated", PERSISTENT}, {"FrogsGoMoo", PERSISTENT}, + {"FrogsGoMooTune", PERSISTENT}, {"GoatScream", PERSISTENT}, {"LaneLinesWidth", PERSISTENT}, {"LateralTune", PERSISTENT}, diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py index fe8cd4b..40358f5 100644 --- a/selfdrive/car/toyota/carcontroller.py +++ b/selfdrive/car/toyota/carcontroller.py @@ -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: diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 13c1eb6..eef6124 100644 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -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.] diff --git a/selfdrive/frogpilot/ui/vehicle_settings.cc b/selfdrive/frogpilot/ui/vehicle_settings.cc index 8143807..0fb0277 100644 --- a/selfdrive/frogpilot/ui/vehicle_settings.cc +++ b/selfdrive/frogpilot/ui/vehicle_settings.cc @@ -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);