diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py index 35858557f4..ad56ee78b4 100644 --- a/selfdrive/car/interfaces.py +++ b/selfdrive/car/interfaces.py @@ -410,7 +410,7 @@ class CarInterfaceBase(ABC): @staticmethod def sp_configure_custom_torque_tune(ret, params): - ret.lateralTuning.torque.friction = float(params.get("TorqueFriction", encoding="utf8")) * 0.01 + ret.lateralTuning.torque.friction = float(params.get("TorqueFriction", encoding="utf8")) * 0.001 ret.lateralTuning.torque.latAccelFactor = float(params.get("TorqueMaxLatAccel", encoding="utf8")) * 0.01 return ret diff --git a/selfdrive/controls/lib/latcontrol_torque.py b/selfdrive/controls/lib/latcontrol_torque.py index 63b0a701ef..8713a3a508 100644 --- a/selfdrive/controls/lib/latcontrol_torque.py +++ b/selfdrive/controls/lib/latcontrol_torque.py @@ -147,7 +147,7 @@ class LatControlTorque(LatControl): return self.torque_params.latAccelFactor = float(self.param_s.get("TorqueMaxLatAccel", encoding="utf8")) * 0.01 - self.torque_params.friction = float(self.param_s.get("TorqueFriction", encoding="utf8")) * 0.01 + self.torque_params.friction = float(self.param_s.get("TorqueFriction", encoding="utf8")) * 0.001 @property def pid_long_sp(self): diff --git a/selfdrive/locationd/torqued.py b/selfdrive/locationd/torqued.py index 73a2efeec8..439f0c3d4a 100755 --- a/selfdrive/locationd/torqued.py +++ b/selfdrive/locationd/torqued.py @@ -79,7 +79,7 @@ class TorqueEstimator(ParameterEstimator): params = Params() if params.get_bool("EnforceTorqueLateral"): if params.get_bool("CustomTorqueLateral"): - self.offline_friction = float(params.get("TorqueFriction", encoding="utf8")) * 0.01 + self.offline_friction = float(params.get("TorqueFriction", encoding="utf8")) * 0.001 self.offline_latAccelFactor = float(params.get("TorqueMaxLatAccel", encoding="utf8")) * 0.01 if params.get_bool("LiveTorqueRelaxed"): self.min_bucket_points = np.array([0, 200, 300, 500, 500, 300, 200, 0]) / (10 if decimated else 1) diff --git a/selfdrive/ui/qt/offroad/sunnypilot/sunnypilot_settings.cc b/selfdrive/ui/qt/offroad/sunnypilot/sunnypilot_settings.cc index 0413102bb5..3eac53a4c1 100644 --- a/selfdrive/ui/qt/offroad/sunnypilot/sunnypilot_settings.cc +++ b/selfdrive/ui/qt/offroad/sunnypilot/sunnypilot_settings.cc @@ -586,13 +586,14 @@ TorqueFriction::TorqueFriction() : SPOptionControl ( tr("FRICTION"), tr("Adjust Friction for the Torque Lateral Controller. Live: Override self-tune values; Offline: Override self-tune offline values at car restart."), "../assets/offroad/icon_blank.png", - {0, 50}) { + {0, 50}, + 5) { refresh(); } void TorqueFriction::refresh() { - float torqueFrictionVal = QString::fromStdString(params.get("TorqueFriction")).toInt() * 0.01; + float torqueFrictionVal = QString::fromStdString(params.get("TorqueFriction")).toInt() * 0.001; setTitle("FRICTION - " + (params.getBool("TorquedOverride") ? tr("Real-time and Offline") : tr("Offline Only"))); setLabel(QString::number(torqueFrictionVal)); } diff --git a/system/manager/manager.py b/system/manager/manager.py index 388198736c..be931353e0 100755 --- a/system/manager/manager.py +++ b/system/manager/manager.py @@ -97,7 +97,7 @@ def manager_init() -> None: ("StandStillTimer", "0"), ("StockLongToyota", "0"), ("TorqueDeadzoneDeg", "0"), - ("TorqueFriction", "1"), + ("TorqueFriction", "10"), ("TorqueMaxLatAccel", "250"), ("ToyotaAutoHold", "0"), ("ToyotaAutoLockBySpeed", "0"), @@ -117,6 +117,8 @@ def manager_init() -> None: ("CustomDrivingModel", "0"), ("DrivingModelGeneration", "4"), ("LastSunnylinkPingTime", "0"), + ("ToyotaCruiseOverride", "0"), + ("ToyotaCruiseOverrideSpeed", "30"), ] if not PC: default_params.append(("LastUpdateTime", datetime.datetime.now(datetime.UTC).replace(tzinfo=None).isoformat().encode('utf8')))