1
0
forked from IQ.Lvbs/IQ.Pilot

IQ.Pilot Release Commit @ 5bc9cd3

This commit is contained in:
IQ.Lvbs history cleanup
2026-08-22 23:42:42 -05:00
commit d037016281
4504 changed files with 1129827 additions and 0 deletions

31
system/loggerd/config.py Normal file
View File

@@ -0,0 +1,31 @@
import os
from openpilot.system.hardware.hw import Paths
CAMERA_FPS = 20
SEGMENT_LENGTH = 60
PATH_DICT = {
"internal": Paths.log_root(),
"external": Paths.log_root_external()
}
def get_available_percent(default: float, path_type="internal") -> float:
try:
statvfs = os.statvfs(PATH_DICT[path_type])
available_percent = 100.0 * statvfs.f_bavail / statvfs.f_blocks
except (OSError, KeyError):
available_percent = default
return available_percent
def get_available_bytes(default: int, path_type="internal") -> int:
try:
statvfs = os.statvfs(PATH_DICT[path_type])
available_bytes = statvfs.f_bavail * statvfs.f_frsize
except (OSError, KeyError):
available_bytes = default
return available_bytes