This commit is contained in:
James
2026-02-09 13:19:50 -07:00
parent 88816b375a
commit 5e224f8c9a
15 changed files with 888 additions and 900 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ from openpilot.system.version import get_version
from openpilot.frogpilot.common.frogpilot_utilities import use_konik_server
API_HOST = os.getenv('API_HOST', f'https://api.{'konik.ai' if use_konik_server() else 'commadotai.com'}')
API_HOST = os.getenv('API_HOST', f"https://api.{'konik.ai' if use_konik_server() else 'commadotai.com'}")
# name: jwt signature algorithm
KEYS = {"id_rsa": "RS256",
+2 -7
View File
@@ -270,13 +270,8 @@ class ThemeManager:
if "~" in base:
base, creator = base.split("~", 1)
parts = base.replace("_", "-").split("-")
capitalized_parts = [part.capitalize() for part in parts if part]
if len(capitalized_parts) > 1 and component != "steering_wheels":
display = f"{capitalized_parts[0]} ({' '.join(capitalized_parts[1:])})"
else:
display = " ".join(capitalized_parts)
parts = base.replace("_", " ").replace("-", " ").split()
display = " ".join(part.capitalize() for part in parts)
if creator:
return f"{display} - by: {creator}"
+1 -1
View File
@@ -54,7 +54,7 @@ def backup_toggles(params, boot_run=False):
print("Toggles are identical to the previous backup. Aborting...")
return
destination = TOGGLE_BACKUPS / f"{datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}_auto"
destination = TOGGLE_BACKUPS / f"{datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}_auto"
create_backup(Path(params_backup.get_param_path()), destination, "Successfully backed up toggles!", "Failed to backup toggles...", params)
+2 -1
View File
@@ -277,7 +277,7 @@ class FrogPilotVariables:
for source in (theme_colors, self.stock_colors):
color = source.get(key)
if isinstance(color, dict):
return f"#{color.get("alpha", 255):02X}{color.get("red", 255):02X}{color.get("green", 255):02X}{color.get("blue", 255):02X}"
return f"#{color.get('alpha', 255):02X}{color.get('red', 255):02X}{color.get('green', 255):02X}{color.get('blue', 255):02X}"
return "#FFFFFFFF"
def get_value(self, key, cast=bool, condition=True, conversion=None, default=None, min=None, max=None):
@@ -739,4 +739,5 @@ class FrogPilotVariables:
toggle.volt_sng = self.get_value("VoltSNG", condition=toggle.car_model == "CHEVROLET_VOLT")
process_frogpilot_toggles.cache_clear()
self.params_memory.remove("FrogPilotTogglesUpdated")
+1 -1
View File
@@ -74,7 +74,7 @@ class FrogPilotPlanner:
self.driving_in_curve = abs(self.lateral_acceleration) >= MINIMUM_LATERAL_ACCELERATION
self.frogpilot_events.update(v_cruise, sm, frogpilot_toggles)
self.frogpilot_events.update(long_control_active, v_cruise, sm, frogpilot_toggles)
self.frogpilot_following.update(long_control_active, v_ego, sm, frogpilot_toggles)
+3 -3
View File
@@ -36,7 +36,7 @@ class FrogPilotEvents:
self.error_log = error_log
def update(self, v_cruise, sm, frogpilot_toggles):
def update(self, long_control_active, v_cruise, sm, frogpilot_toggles):
current_alert = sm["selfdriveState"].alertType
current_frogpilot_alert = sm["selfdriveState"].alertType
@@ -44,9 +44,9 @@ class FrogPilotEvents:
self.events.clear()
acceleration = sm["carState"].aEgo
acceleration = sm["carControl"].actuators.accel
if not sm["carState"].gasPressed:
if long_control_active:
self.max_acceleration = max(acceleration, self.max_acceleration)
else:
self.max_acceleration = 0
+1 -1
View File
@@ -92,7 +92,7 @@ class FrogPilotTracking:
self.previous_sound = sm["frogpilotSelfdriveState"].alertSound
self.frogpilot_stats["HighestAcceleration"] = max(self.frogpilot_events.max_acceleration, self.frogpilot_stats.get("HighestAcceleration", 0))
self.frogpilot_stats["MaxAcceleration"] = max(self.frogpilot_events.max_acceleration, self.frogpilot_stats.get("MaxAcceleration", 0))
if sm["carControl"].latActive:
self.frogpilot_stats["LateralTime"] = self.frogpilot_stats.get("LateralTime", 0) + DT_MDL
+1 -1
View File
@@ -657,10 +657,10 @@ void FrogPilotDataPanel::updateStatsLabels(FrogPilotListWidget *labelsList) {
{"FrogPilotSeconds", {tr("Total Driving Time"), "time"}},
{"FrogSqueaks", {tr("Total Frog Squeaks"), "count"}},
{"GoatScreams", {tr("Total Goat Screams"), "count"}},
{"HighestAcceleration", {tr("Highest Acceleration Rate"), "accel"}},
{"LateralTime", {tr("Time Using Lateral Control"), "timePercent"}},
{"LongestDistanceWithoutOverride", {tr("Longest Distance Without an Override"), "distance"}},
{"LongitudinalTime", {tr("Time Using Longitudinal Control"), "timePercent"}},
{"MaxAcceleration", {tr("Highest Acceleration Rate"), "accel"}},
{"ModelTimes", {tr("Driving Models:"), "parent"}},
{"Month", {tr("Month"), "other"}},
{"NightTime", {tr("Time Driving (Nighttime)"), "timePercent"}},
+1 -7
View File
@@ -41,13 +41,7 @@ FrogPilotDevicePanel::FrogPilotDevicePanel(FrogPilotSettingsWindow *parent, bool
{"ScreenRecorder", tr("Screen Recorder"), tr("<b>Add a button to the driving screen to record the display.</b>"), ""},
{"ScreenTimeout", tr("Screen Timeout (Offroad)"), tr("<b>How long the screen stays on after being tapped while not driving.</b>"), ""},
{"ScreenTimeoutOnroad", tr("Screen Timeout (Onroad)"), tr("<b>How long the screen stays on after being tapped while driving.</b>"), ""},
{"StandbyMode", tr("Standby Mode"), tr("<b>Turn the screen off while driving and automatically wake it up for alerts or engagement state changes.</b>"), ""},
{"IgnoreMe", "Ignore Me", "This is simply used to fix the layout when the user opens the descriptions and the menu gets wonky. No idea why it happens, but I can't be asked to properly fix it so whatever. Sue me.", ""},
{"IgnoreMe2", "Ignore Me", "This is simply used to fix the layout when the user opens the descriptions and the menu gets wonky. No idea why it happens, but I can't be asked to properly fix it so whatever. Sue me.", ""},
{"IgnoreMe3", "Ignore Me", "This is simply used to fix the layout when the user opens the descriptions and the menu gets wonky. No idea why it happens, but I can't be asked to properly fix it so whatever. Sue me.", ""},
{"IgnoreMe4", "Ignore Me", "This is simply used to fix the layout when the user opens the descriptions and the menu gets wonky. No idea why it happens, but I can't be asked to properly fix it so whatever. Sue me.", ""},
{"IgnoreMe5", "Ignore Me", "This is simply used to fix the layout when the user opens the descriptions and the menu gets wonky. No idea why it happens, but I can't be asked to properly fix it so whatever. Sue me.", ""}
{"StandbyMode", tr("Standby Mode"), tr("<b>Turn the screen off while driving and automatically wake it up for alerts or engagement state changes.</b>"), ""}
};
for (const auto &[param, title, desc, icon] : deviceToggles) {
+1 -4
View File
@@ -58,10 +58,7 @@ FrogPilotLateralPanel::FrogPilotLateralPanel(FrogPilotSettingsWindow *parent, bo
{"NNFFLite", tr("Neural Network Feedforward (NNFF) Lite"), tr("<b>A lightweight version of Twilsonco's \"Neural Network FeedForward\" controller.</b> Uses the \"look-ahead\" planned lateral jerk logic from the full model to help smoothen steering adjustments in curves, but does not use the full neural network for torque calculation."), ""},
{"QOLLateral", tr("Quality of Life"), tr("<b>Steering control changes to fine-tune how openpilot drives.</b>"), "../../frogpilot/assets/toggle_icons/icon_quality_of_life.png"},
{"PauseLateralSpeed", tr("Pause Steering Below"), tr("<b>Pause steering below the set speed.</b>"), ""},
{"IgnoreMe", "Ignore Me", "This is simply used to fix the layout when the user opens the descriptions and the menu gets wonky. No idea why it happens, but I can't be asked to properly fix it so whatever. Sue me.", ""},
{"IgnoreMe2", "Ignore Me", "This is simply used to fix the layout when the user opens the descriptions and the menu gets wonky. No idea why it happens, but I can't be asked to properly fix it so whatever. Sue me.", ""}
{"PauseLateralSpeed", tr("Pause Steering Below"), tr("<b>Pause steering below the set speed.</b>"), ""}
};
for (const auto &[param, title, desc, icon] : lateralToggles) {
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -68,7 +68,7 @@ class FrogPilotListWidget : public QWidget {
outer_layout.addStretch();
}
inline void addItem(QWidget *w, bool expanding = false) {
w->setSizePolicy(QSizePolicy::Preferred, expanding ? QSizePolicy::Expanding : QSizePolicy::Fixed);
w->setSizePolicy(QSizePolicy::Preferred, expanding ? QSizePolicy::Expanding : QSizePolicy::Maximum);
inner_layout.addWidget(w);
}
inline void addItem(QLayout *layout) { inner_layout.addLayout(layout); }
+1 -1
View File
@@ -3,7 +3,7 @@ import requests
from openpilot.frogpilot.common.frogpilot_utilities import use_konik_server
API_HOST = os.getenv('API_HOST', f'https://api.{'konik.ai' if use_konik_server() else 'commadotai.com'}')
API_HOST = os.getenv('API_HOST', f"https://api.{'konik.ai' if use_konik_server() else 'commadotai.com'}")
# TODO: this should be merged into common.api
+1 -1
View File
@@ -35,7 +35,7 @@ from openpilot.tools.lib.auth_config import set_token, get_token
from openpilot.frogpilot.common.frogpilot_utilities import use_konik_server
API_HOST = os.getenv('API_HOST', f'https://api.{'konik' if use_konik_server() else 'comma'}.ai')
API_HOST = os.getenv('API_HOST', f"https://api.{'konik' if use_konik_server() else 'comma'}.ai")
PORT = 3000
+1 -1
View File
@@ -26,7 +26,7 @@ segment = int(sys.argv[2])
frame = int(sys.argv[3])
camera = cameras[sys.argv[4]] if len(sys.argv) > 4 and sys.argv[4] in cameras else "cameras"
url = f'https://api.{'konik.ai' if use_konik_server() else 'commadotai.com'}/v1/route/{route}/files'
url = f"https://api.{'konik.ai' if use_konik_server() else 'commadotai.com'}/v1/route/{route}/files"
r = requests.get(url, headers={"Authorization": f"JWT {jwt}"}, timeout=10)
assert r.status_code == 200
print("got api response")