mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-09-24 08:23:51 +08:00
Remove ExperimentalLongTune
This commit is contained in:
@@ -570,8 +570,6 @@ std::unordered_map<std::string, uint32_t> keys = {
|
||||
{"RadarInterceptorEnabled", PERSISTENT},
|
||||
{"NoMRCC", PERSISTENT},
|
||||
{"NoFSC", PERSISTENT},
|
||||
{"ExperimentalLongTune", PERSISTENT},
|
||||
{"LongOutputGain", PERSISTENT},
|
||||
{"BlendedACC", PERSISTENT},
|
||||
{"ManualTransmission", PERSISTENT},
|
||||
};
|
||||
|
||||
@@ -98,9 +98,6 @@ class LongControl:
|
||||
self.gain_step = 0.0001 # Step size for increasing/decreasing gain
|
||||
self.params = Params()
|
||||
self.params_memory = Params("/dev/shm/params")
|
||||
gain = self.params.get_float("LongOutputGain")
|
||||
self.auto_tune = self.params.get_bool("ExperimentalLongTune")
|
||||
self.output_gain = gain if gain != 0.0 and self.auto_tune else 1.0 # Initial output gain
|
||||
self.experimental_mode_last = False
|
||||
|
||||
def reset(self):
|
||||
@@ -143,27 +140,8 @@ class LongControl:
|
||||
output_accel = self.pid.update(error, speed=CS.vEgo,
|
||||
feedforward=a_target)
|
||||
|
||||
output_accel = output_accel * self.output_gain
|
||||
self.last_output_accel = clip(output_accel, accel_limits[0], accel_limits[1])
|
||||
is_flat = abs(pitch) <= 0.05
|
||||
|
||||
self.auto_tune = self.params.get_bool("ExperimentalLongTune")
|
||||
if not self.auto_tune:
|
||||
self.output_gain = 1.0
|
||||
if is_flat and self.auto_tune and active and self.last_output_accel == output_accel: # don't adjust when limited or inactive
|
||||
# if the signs of accel and integrator match, increase the output gain
|
||||
i = self.pid.i
|
||||
if (i > 0.02 and a_target > 0.2) or (i < -0.02 and a_target < -0.2):
|
||||
self.output_gain += self.gain_step
|
||||
self.output_gain = max(0.5, min(self.output_gain, 2.0))
|
||||
self.params.put_float_nonblocking("LongOutputGain",self.output_gain)
|
||||
self.pid.i = 0.0
|
||||
# if the signs of accel and integrator are opposite, decrease the output gain
|
||||
elif (i < -0.02 and a_target > 0.2) or (i > 0.02 and a_target < -0.2):
|
||||
self.output_gain -= self.gain_step
|
||||
self.output_gain = max(0.5, min(self.output_gain, 2.0))
|
||||
self.params.put_float_nonblocking("LongOutputGain", self.output_gain)
|
||||
self.pid.i = 0.0
|
||||
|
||||
return self.last_output_accel
|
||||
|
||||
|
||||
@@ -48,12 +48,6 @@ TogglesPanel::TogglesPanel(SettingsWindow *parent) : ListWidget(parent) {
|
||||
"",
|
||||
"../assets/img_experimental_white.svg",
|
||||
},
|
||||
{
|
||||
"ExperimentalLongTune",
|
||||
tr("Longitudinal Auto-Tune (Beta)"),
|
||||
tr("Enable the longitudinal auto-tuning feature. Slowly adjusts the acceleration gain to minimize error"),
|
||||
"../assets/offroad/icon_openpilot.png",
|
||||
},
|
||||
{
|
||||
"BlendedACC",
|
||||
tr("Blended Acc (Experimental)"),
|
||||
|
||||
@@ -363,8 +363,6 @@ def manager_init() -> None:
|
||||
("WD40Score", "0"),
|
||||
("WheelIcon", "frog"),
|
||||
("WheelSpeed", "0"),
|
||||
("ExperimentalLongTune", "0"),
|
||||
("LongOutputGain", "1.0"),
|
||||
("BlendedACC", "0"),
|
||||
]
|
||||
if not PC:
|
||||
|
||||
Reference in New Issue
Block a user