added timing

This commit is contained in:
Ayzen
2026-05-26 15:08:56 +03:00
parent 5b480f1b55
commit 83a934f251
42 changed files with 1680 additions and 740 deletions
+30 -4
View File
@@ -16,6 +16,7 @@ CLEAN_SHM=0
KAMIL_ADC_MODE=0
AUTO_START=0
PRODUCER_ONLY=0
HEADLESS=0
print_usage() {
cat <<'EOF'
@@ -25,6 +26,10 @@ Options:
--kamil-adc Use the Raspberry Pi Kamil ADC profile
--profile PATH Use a specific GUI/run config profile
--auto-start Start the GUI pipeline automatically after launch
--headless Run without a display (Qt offscreen platform) and apply
the active radar config, then start the pipeline. Suitable
for unattended Raspberry Pi deployments. Implies
--auto-start.
--producer-only Run only the raw producer selected by the profile
--skip-build Skip C++ build step
--build-only Build C++ binaries and exit
@@ -59,6 +64,10 @@ parse_args() {
--auto-start)
AUTO_START=1
;;
--headless)
HEADLESS=1
AUTO_START=1
;;
--producer-only)
PRODUCER_ONLY=1
;;
@@ -140,12 +149,15 @@ ensure_python_dependencies() {
exit 1
fi
if ! "${VENV_PYTHON}" -c "${dependency_check}" >/dev/null 2>&1; then
echo "[start.sh] Installing Python dependencies into virtual environment..."
"${VENV_PIP}" install --upgrade pip
"${VENV_PIP}" install -r "${REQUIREMENTS_FILE}"
if "${VENV_PYTHON}" -c "${dependency_check}" >/dev/null 2>&1; then
PYTHON_CMD="${VENV_PYTHON}"
return
fi
echo "[start.sh] Installing Python dependencies into virtual environment..."
"${VENV_PIP}" install --upgrade pip
"${VENV_PIP}" install -r "${REQUIREMENTS_FILE}"
if ! "${VENV_PYTHON}" -c "${dependency_check}" >/dev/null 2>&1; then
echo "Required Python dependencies are still unavailable in virtual environment: ${PROJECT_ROOT}/.venv" >&2
exit 1
@@ -234,6 +246,10 @@ EOF
}
build_cpp_binaries() {
if make -C "${PROJECT_ROOT}" -q all >/dev/null 2>&1; then
echo "[start.sh] C++ binaries are up to date; skipping build."
return
fi
local jobs
jobs="${BUILD_JOBS:-$(nproc)}"
echo "[start.sh] Building C++ binaries (jobs=${jobs})..."
@@ -265,6 +281,16 @@ run_gui() {
export RADAR_SYSTEM_AUTO_START=1
echo "[start.sh] GUI auto-start is enabled."
fi
if ((HEADLESS == 1)); then
# Qt offscreen platform lets the GUI controller and its event loop run
# on a machine with no display (typical Raspberry Pi deployment). All
# backend services — supervisor, Python device drivers, SHM readers,
# locator client (vlc) handling — continue to work unchanged.
export QT_QPA_PLATFORM=offscreen
export RADAR_SYSTEM_HEADLESS=1
export RADAR_SYSTEM_AUTO_APPLY_RADAR=1
echo "[start.sh] Headless mode: Qt offscreen + auto apply-radar + auto-start."
fi
echo "[start.sh] Launching GUI..."
exec "${PYTHON_CMD}" "${GUI_ENTRY}"