mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-26 09:42:11 +08:00
Merge branch 'ui-torque-fric-half' into master-dev-c3
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -586,13 +586,14 @@ TorqueFriction::TorqueFriction() : SPOptionControl (
|
||||
tr("FRICTION"),
|
||||
tr("Adjust Friction for the Torque Lateral Controller. <b>Live</b>: Override self-tune values; <b>Offline</b>: 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));
|
||||
}
|
||||
|
||||
@@ -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')))
|
||||
|
||||
Reference in New Issue
Block a user