From e845ae7eb69979023e94881e9cf0c03fa1c09e3f Mon Sep 17 00:00:00 2001 From: PitresAli Date: Tue, 25 Aug 2026 22:18:31 +0200 Subject: [PATCH] Rename app and document virtual environment setup --- SUB Control/README.md | 23 ++++++++++++++++++++--- SUB Control/app.py | 4 ++-- SUB Control/run.ps1 | 13 ++++++++++--- SUB Control/web/index.html | 6 +++--- SUB Control/web_ui.py | 2 +- 5 files changed, 36 insertions(+), 12 deletions(-) diff --git a/SUB Control/README.md b/SUB Control/README.md index 00d27f8..bc9db4a 100644 --- a/SUB Control/README.md +++ b/SUB Control/README.md @@ -1,4 +1,4 @@ -# ArduSub Minimal Control +# SUB Control A deliberately small, low-bandwidth MAVLink controller for bench-testing an ArduSub vehicle over a USB serial connection. It sends no parameter-list @@ -33,14 +33,31 @@ the frame mixing and generates the configured ESC outputs. For ArduSub, ## Run on Windows -1. Install Python 3.11 or newer. -2. Open PowerShell in this folder and run `./run.ps1`. +1. Install Python 3.11 or newer. A virtual environment installs packages, but + it does not install Python itself. +2. Open PowerShell in this folder and run `./run.ps1` (or right-click it and + choose **Run with PowerShell**). 3. Select the autopilot's COM port, then click **Connect**. Baud and control-rate settings are under the small `•••` link button (normally 57600 baud / 20 Hz). 4. Confirm `ArduSub` and a live heartbeat are shown. 5. Click **Set MANUAL**, then **ARM** only when the bench is safe. 6. Move the controls. Once armed, no additional enable button is needed. +`run.ps1` automatically creates a private `.venv` on the first run, installs +the versions declared in `requirements.txt`, and starts SUB Control. Later runs +reuse the same environment and update missing dependencies when necessary. +The `.venv` directory is intentionally ignored by Git: virtual environments +contain machine-specific executables and can be recreated from +`requirements.txt`. + +## Repository layout + +The Gitea repository is named `argo`. `SUB Control` is a normal directory inside +that repository containing this application. A Gitea **Project** is a planning +board for issues and tasks; source code is not attached to a Project board. +Git tracks the folder automatically because its files are committed on the +repository's `main` branch. + Keyboard controls for SimpleROV-3: W/S forward/back, A/D yaw left/right, Q/E alternative yaw control, and R/F rise/dive. Releasing movement keys eases their controls back to neutral. diff --git a/SUB Control/app.py b/SUB Control/app.py index 8fd3fdc..e4664ac 100644 --- a/SUB Control/app.py +++ b/SUB Control/app.py @@ -569,7 +569,7 @@ class SpringScale(ctk.CTkSlider): class App(tk.Tk): def __init__(self): super().__init__() - self.title("ArduSub Minimal Control") + self.title("SUB Control") self.geometry("1040x800") self.minsize(920, 720) self.events = queue.Queue() @@ -676,7 +676,7 @@ class App(tk.Tk): workspace = ctk.CTkFrame(shell, fg_color="#fbfbf9", corner_radius=22) workspace.grid(row=0, column=1, sticky="nsew") - ctk.CTkLabel(rail, text="SIMPLE ROV / 03", text_color="#f4f4f1", + ctk.CTkLabel(rail, text="SUB CONTROL / 03", text_color="#f4f4f1", font=ctk.CTkFont("Helvetica", 13, "bold")).pack( anchor="w", padx=24, pady=(24, 0)) ctk.CTkLabel(rail, text="ArduSub vehicle", text_color="#8f9699", diff --git a/SUB Control/run.ps1 b/SUB Control/run.ps1 index 54284e2..104e4da 100644 --- a/SUB Control/run.ps1 +++ b/SUB Control/run.ps1 @@ -1,8 +1,15 @@ $ErrorActionPreference = "Stop" -if (-not (Test-Path -LiteralPath ".venv\Scripts\python.exe")) { - py -m venv .venv +$projectRoot = Split-Path -Parent $MyInvocation.MyCommand.Path +Set-Location -LiteralPath $projectRoot + +if (-not (Get-Command py -ErrorAction SilentlyContinue)) { + throw "Python 3.11 or newer is required. Install Python from python.org, then run this script again." } -& .venv\Scripts\python.exe -m pip install -r requirements.txt +if (-not (Test-Path -LiteralPath ".venv\Scripts\python.exe")) { + & py -3 -m venv .venv +} + +& .venv\Scripts\python.exe -m pip install --disable-pip-version-check -r requirements.txt & .venv\Scripts\python.exe app.py diff --git a/SUB Control/web/index.html b/SUB Control/web/index.html index b974c24..9b0248d 100644 --- a/SUB Control/web/index.html +++ b/SUB Control/web/index.html @@ -3,12 +3,12 @@ - Simple ROV Control + SUB Control
-
SSimple ROV ControlBuilt-in vehicle
+
SSUB ControlBuilt-in vehicle
@@ -17,7 +17,7 @@