FrogPilot base

This commit is contained in:
James
2025-12-01 12:00:00 -07:00
parent 4726bdce29
commit 41bf1bd2cb
144 changed files with 1254 additions and 39 deletions
+10
View File
@@ -212,6 +212,8 @@ def hardware_thread(end_event, hw_queue) -> None:
fan_controller = None
# FrogPilot variables
while not end_event.is_set():
sm.update(PANDA_STATES_TIMEOUT)
@@ -292,6 +294,8 @@ def hardware_thread(end_event, hw_queue) -> None:
if fan_controller is not None:
msg.deviceState.fanSpeedPercentDesired = fan_controller.update(all_comp_temp, onroad_conditions["ignition"])
# FrogPilot variables
is_offroad_for_5_min = (started_ts is None) and ((not started_seen) or (off_ts is None) or (time.monotonic() - off_ts > 60 * 5))
if is_offroad_for_5_min and offroad_comp_temp > OFFROAD_DANGER_TEMP:
# if device is offroad and already hot without the extra onroad load,
@@ -341,6 +345,8 @@ def hardware_thread(end_event, hw_queue) -> None:
if started_ts is None:
should_start = should_start and all(startup_conditions.values())
# FrogPilot variables
if should_start != should_start_prev or (count == 0):
params.put_bool("IsEngaged", False)
engaged_prev = False
@@ -410,6 +416,8 @@ def hardware_thread(end_event, hw_queue) -> None:
msg.deviceState.thermalStatus = thermal_status
pm.send("deviceState", msg)
# FrogPilot variables
# Log to statsd
statlog.gauge("free_space_percent", msg.deviceState.freeSpacePercent)
statlog.gauge("gpu_usage_percent", msg.deviceState.gpuUsagePercent)
@@ -463,6 +471,8 @@ def hardware_thread(end_event, hw_queue) -> None:
count += 1
should_start_prev = should_start
# FrogPilot variables
def main():
hw_queue = queue.Queue(maxsize=1)
+8 -1
View File
@@ -26,7 +26,14 @@ namespace Path {
if (const char *env = getenv("LOG_ROOT")) {
return env;
}
return Hardware::PC() ? Path::comma_home() + "/media/0/realdata" : "/data/media/0/realdata";
if (Hardware::PC()) {
return Path::comma_home() + "/media/0/realdata";
}
// FrogPilot variables
return "/data/media/0/realdata";
}
inline std::string params() {