Files
fhd_scan_web_app/run_scan_web.sh
T
gardentech f34817d5b6 Initial commit: scan_web integrated recording UI
FastAPI backend + vanilla JS frontend for LiDAR/camera startup, camera
settings, and rosbag recording, unifying the previous scan_gui/scan_gui_dual/
scan_gui_triple desktop tools into one web app.
2026-08-07 14:26:00 +09:00

27 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Launches scan_web: sources the ROS overlays the backend's ManagedProcess
# commands need to be able to `ros2 launch`/`ros2 bag record` against, then
# runs the FastAPI app with a single uvicorn worker (required — see
# backend/app.py: the rclpy context + ProcessManager registry live in
# process memory and must not be duplicated across workers).
# NOTE: no `-u` (nounset) — ROS's setup.bash references unset variables
# internally (e.g. AMENT_TRACE_SETUP_FILES) and isn't nounset-safe.
set -eo pipefail
HOME_DIR="/home/gardentech"
source /opt/ros/humble/setup.bash
# fast_ws deprecated (2026-08-05) — it was the pre-3-camera predecessor to
# fast_dual_ws and never had its own livox_ros_driver2 build (only chained
# to lidar2_ws/install as an underlay). Source lidar2_ws directly.
source "${HOME_DIR}/lidar2_ws/install/setup.bash"
source "${HOME_DIR}/camera2_ws/install/setup.bash"
if [ -f "${HOME_DIR}/fast_dual_ws/install/setup.bash" ]; then
source "${HOME_DIR}/fast_dual_ws/install/setup.bash"
fi
# rtk_ws intentionally not sourced yet — GPS/RTK integration is Phase 1
# Milestone 2, unused until then.
cd "${HOME_DIR}/scan_web/backend"
exec python3 -m uvicorn app:app --host 0.0.0.0 --port 8000 --workers 1