- receive_cam.py : pipeline GStreamer UDP 5600 → MJPEG HTTP 5601 - CLAUDE.md : Pi Zero IP, ports 5600/5601, commandes de session caméra Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4.1 KiB
4.1 KiB
WireClaw — Drone d'Inspection Thermique Autonome
Contexte du projet
WireClaw est un système de pilotage de drone en langage naturel. L'opérateur donne des instructions en français (texte ou voix), un LLM les interprète et génère des commandes MAVLink vers ArduPilot.
Architecture
- Jetson Orin Nano 8Go : station sol, héberge WireClaw + SITL
- ESP32 DevKitV4 : relais WiFi↔UART (firmware PlatformIO sur Windows)
- Pi Zero 2W : IP 192.168.1.132 — flux vidéo H.264 UDP → Jetson (câblé, arrêté pour l'instant)
- Matek H743 : à venir — contrôleur de vol ArduPilot réel
Stack logicielle
- Python 3.10, asyncio
- MAVSDK Python (udp://:14551)
- pymavlink (udpin:0.0.0.0:14552)
- Gemini 2.0 Flash API (clé dans .env, jamais en dur)
- MAVProxy en daemon (ports TCP:5760, UDP:14550/14551/14552)
- ArduPilot SITL (binaire ARM64 ~/ardupilot/build/sitl/bin/arducopter)
Fichiers principaux
wireclaw_core.py: cerveau principal, boucle de commandeconfig.py: configuration (lit .env via python-dotenv).env: secrets — NE JAMAIS MODIFIER NI COMMITTERstart.sh: lance ArduCopter + MAVProxy + WireClaw automatiquementsitl_params.parm: paramètres SITL (batterie désactivée)receive_cam.py: réception H.264 UDP port 5600 → MJPEG port 5601 (Pi Zero)
Ports réseau
- 5760 TCP : ArduCopter ↔ MAVProxy
- 14550 UDP : MAVProxy output standard + ESP32 source
- 14551 UDP : MAVSDK (WireClaw) + heartbeats ESP32
- 14552 UDP : pymavlink (WireClaw)
- 5600 UDP : flux H.264 RTP entrant depuis Pi Zero (caméra OV5647)
- 5601 TCP : MJPEG stream exposé par receive_cam.py (→ YOLOv8, interface web)
Réseau local
- Jetson Ethernet : 192.168.1.84
- Jetson WiFi : 192.168.1.143 (utilisé pour ESP32)
- ESP32 WiFi : 192.168.1.122
Règles importantes
- Ne jamais modifier
.envnicredentials.h(secrets WiFi/API) - Toujours tester via
~/wireclaw/start.shavant de commiter - Les commandes MAVLink passent toutes par
execute_command()dans wireclaw_core.py - L'état armement est synchronisé en temps réel via
monitor_armed()(tâche de fond) MAV_CMD_DO_ORBIT(commande 34) non supportée en SITL → fallback waypoints circulaires 16 points- La batterie SITL est désactivée (BATT_MONITOR=0) pour éviter les failsafes en simulation
Commandes de session
# Démarrer tout
~/wireclaw/start.sh
# Vérifier SITL actif
ps aux | grep -E "arducopter|mavproxy" | grep -v grep
# Vérifier WiFi Jetson actif
nmcli dev status | grep wifi
# Tuer Hermes si actif (occupe port 14550)
pkill -f hermes
# Lancer la réception caméra Pi Zero (quand Pi Zero actif)
python3 ~/wireclaw/receive_cam.py
# Vérifier MJPEG stream caméra
curl -s --max-time 2 http://localhost:5601/ | head -1
# Pipeline GStreamer brute (debug)
gst-launch-1.0 udpsrc port=5600 ! application/x-rtp,payload=96 ! rtph264depay ! avdec_h264 ! videoconvert ! fakesink
# Git commit + push
git add . && git commit -m "message" && git push origin master
Commandes WireClaw validées
takeoff Xm→ décollage altitude X mètresland/atterris→ atterrissagertl/rentre→ retour à la basehover→ maintien de positiongoto→ navigation vers coordonnées (calcul depuis description naturelle)status→ position, altitude, batterie, mode, armementorbit→ orbite native (fallback waypoints en SITL)
Prochaines étapes
Réception Pi Zero 2W + caméra OV5647✅ Pi Zero IP 192.168.1.132, reçu et testé- Câblage UART ESP32 ↔ Pi Zero (GPIO17→GPIO15, GPIO16←GPIO14, GND)
Préparation réception flux H.264 UDP Jetson✅ receive_cam.py prêt, port 5600→5601- Activer receive_cam.py quand Pi Zero remis en service + ouvrir port 5600 iptables
- Intégrer MJPEG 5601 dans l'interface web (flux vidéo + commandes)
- Matek H743 + ArduPilot réel (remplace SITL)
- SkyDroid C12 (caméra thermique + gimbal 3 axes, 117g)
- YOLOv8 détection anomalies thermiques
- Whisper local (transcription vocale)
Gitea
- WireClaw Python : git.syoul.fr/nicoboy/wireclaw
- Firmware ESP32 : git.syoul.fr/nicoboy/wireclaw-esp32