#!/usr/bin/env bash # # argonaut-api.sh — launch wrapper for the Argonaut 3 FastAPI backend. # # DEPLOY LOCATION: /usr/local/bin/argonaut-api.sh (chmod +x) # # systemd does NOT read ~/.bashrc, so ROS2 and the workspace overlay must # be sourced explicitly here before running the node. Mirrors the # argonaut-stack.sh wrapper used by argonaut.service. # # Sourcing order: base ROS2 Jazzy first, then the workspace overlay so # rov_interfaces and rov_api resolve from the local build. set -e # Base ROS2 Jazzy environment source /opt/ros/jazzy/setup.bash # Workspace overlay (rov_interfaces, rov_api, etc.) # Note: /home/ubuntu/ros2_ws is a symlink to /data/ros2_ws (NVMe data drive). source /data/ros2_ws/install/setup.bash # Run the FastAPI backend node. exec replaces the shell so systemd tracks # the Python process directly (correct signal handling on stop/restart). exec ros2 run rov_api api_node