Serveur FastAPI reçoit le flux JSONL (sim ou ROV réel) sur /ws/ingest, SLAM incrémental, rediffuse carte+poses sur /ws/live, GUI live et export PLY. Déployé Docker sur caddy-net, exposé /moulin-live/. Client PC stream_client.py. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
67 lines
1.6 KiB
Markdown
67 lines
1.6 KiB
Markdown
# moulin-mapper server
|
|
|
|
## Lancement local
|
|
|
|
```bash
|
|
cd server/
|
|
python -m venv .venv
|
|
source .venv/bin/activate
|
|
pip install -r requirements.txt
|
|
|
|
uvicorn app:app --host 0.0.0.0 --port 8211
|
|
```
|
|
|
|
GUI accessible sur : http://localhost:8211/
|
|
|
|
## Variables d'environnement
|
|
|
|
| Variable | Défaut | Description |
|
|
|----------|--------|-------------|
|
|
| `MOULIN_TOKEN` | `moulin-2026` | Token authentification ingest WS |
|
|
|
|
## Endpoints
|
|
|
|
| Endpoint | Description |
|
|
|----------|-------------|
|
|
| `GET /` | GUI live (HTML statique) |
|
|
| `WS /ws/ingest?token=…` | Reçoit le flux JSONL du client ROV/sim |
|
|
| `WS /ws/live` | Navigateur s'abonne aux mises à jour temps réel |
|
|
| `POST /session/reset` | Remet la session à zéro (form: token) |
|
|
| `GET /healthz` | Santé + compteurs |
|
|
| `GET /cloud.ply` | Export nuage 3D courant |
|
|
|
|
## Déploiement derrière Caddy (préfixe `/moulin-live/`)
|
|
|
|
Exemple Caddyfile :
|
|
```
|
|
handle /moulin-live/* {
|
|
uri strip_prefix /moulin-live
|
|
reverse_proxy localhost:8211
|
|
}
|
|
```
|
|
|
|
**Important** : la GUI construit les URLs WS depuis `window.location.pathname`,
|
|
donc le préfixe de déploiement est automatiquement inclus.
|
|
Ne PAS utiliser d'URLs en dur dans le code client.
|
|
|
|
## Lancer le client stream (sur le PC de Flag)
|
|
|
|
```bash
|
|
cd client/
|
|
pip install -r requirements.txt
|
|
|
|
# Simulation rapide (test)
|
|
python stream_client.py \
|
|
--file ../../data/sim/run_L.jsonl \
|
|
--url wss://laboratoire.freeboxos.fr/moulin-live/ws/ingest \
|
|
--token moulin-2026 \
|
|
--speed 0
|
|
|
|
# Temps réel
|
|
python stream_client.py \
|
|
--file ../../data/sim/run_L.jsonl \
|
|
--url wss://laboratoire.freeboxos.fr/moulin-live/ws/ingest \
|
|
--token moulin-2026 \
|
|
--speed 1.0
|
|
```
|