[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-82955":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":10,"pushedAt":10,"updatedAt":22,"readmeContent":23,"aiSummary":24,"trendingCount":15,"starSnapshotCount":15,"syncStatus":13,"lastSyncTime":25,"discoverSource":26},82955,"Flyguard","tylerLiCodes\u002FFlyguard","tylerLiCodes","Autonomous drone horn-fly laser defense for cattle farms","https:\u002F\u002Ftylerlicodes.github.io\u002Fflyguard-web\u002F",null,"Python",96,2,93,0,7,42.63,false,"main",true,[],"2026-06-12 04:01:39","# 🛡️ Flyguard\n\n**Autonomous drone horn-fly laser defense for cattle farms**\n\nHorn flies (*Haematobia irritans*) are among the costliest cattle pests, driving\nweight loss, reduced milk yield, and disease. Flyguard flies an autonomous patrol\nover a pasture, analyzes the video feed to detect and track horn flies on cattle,\nand neutralizes them with a gimbal-aimed laser — while treating **cattle and humans\nas protected entities that are never targeted**.\n\n\n> ⚠️ A laser that kills a fly is a Class 3B\u002F4 eye hazard.\n\n---\n\n## Quick start\n\n```bash\npython3.13 -m venv .venv && source .venv\u002Fbin\u002Factivate\npip install -e \".[dev]\"          # core + opencv + fastapi + pytest\n\nflyguard selftest                # validate config + interlock truth tables\nflyguard sim                     # run the full closed loop (patrol -> detect -> safe-fire -> RTL)\nflyguard sim --person            # SAFETY DEMO: a person in frame -> firing fully inhibited\nflyguard gcs                     # launch the Ground Control Station at http:\u002F\u002F127.0.0.1:8000\n```\n\nTrain the detector (needs `pip install -e \".[ml]\"`):\n\n```bash\nflyguard synth --out data\u002Fsynth --train 400 --val 80   # bootstrap a labeled dataset\nflyguard train --data data\u002Fsynth\u002Fdata.yaml --epochs 50 # train YOLOv11\nflyguard eval  --weights runs\u002Fflyguard\u002Ftrain\u002Fweights\u002Fbest.pt --data data\u002Fsynth\u002Fdata.yaml\nflyguard export --weights runs\u002Fflyguard\u002Ftrain\u002Fweights\u002Fbest.pt --format onnx\n```\n\nThen point the detector at your model in the config:\n```yaml\ndetector: { backend: pytorch, model_path: runs\u002Fflyguard\u002Ftrain\u002Fweights\u002Fbest.pt }\n```\n\n## What's in the box\n\n| Subsystem | Module | Notes |\n|---|---|---|\n| Config (typed, validated, clamped) | `flyguard\u002Fconfig.py` | safety ceilings enforced at load |\n| Hardware abstraction | `flyguard\u002Fhal\u002F` | sim + real (camera, flight, gimbal, laser) |\n| Perception & targeting | `flyguard\u002Fperception\u002F` | YOLO\u002Fmock detect, ByteTrack, no-fire mask, pixel→angle |\n| **Laser fire-control (safety core)** | `flyguard\u002Flaser\u002F` | default-deny interlocks, state machine, hash-chained audit |\n| Flight & patrol | `flyguard\u002Fflight\u002F` | geofence, lawnmower\u002Fperimeter, MAVSDK, failsafes |\n| Orchestrator | `flyguard\u002Forchestrator\u002F` | top-level state machine + async engine |\n| Training | `flyguard\u002Ftraining\u002F` | synthesize → train → eval → export |\n| Ground Control Station | `flyguard\u002Fgcs\u002F` | FastAPI + dashboard, live feed, ARM\u002FDISARM\u002FE-STOP |\n| Simulation | `flyguard\u002Fsim\u002F` | synthetic pasture\u002Fflies, PX4 SITL launcher |\n\n## Safety at a glance\n\nFiring is **default-deny**: every emission must pass *all* independent interlocks\n(armed + hardware key, inside geofence, no person in frame, target is a horn fly\nwith sufficient confidence, clear of cattle head\u002Feyes, range in NOHD-aware window,\ngimbal settled & beam-on-target, duty-cycle\u002Fthermal OK, fresh dead-man heartbeat,\nnot E-STOP). Any interlock evaluation error fails safe. Every fire **and** refusal\nis written to a tamper-evident audit log.\n\n## Real hardware\n\n**Main drone: DJI Enterprise** (e.g. Matrice 350 RTK \u002F M30 \u002F Mavic 3 Enterprise)\n+ NVIDIA Jetson Orin companion computer + a 2-axis gimbal and (gated) laser\ncarried as a **DJI Payload SDK (PSDK)** payload via the aircraft's E-Port.\n\nDJI aircraft don't speak MAVLink natively, so Flyguard's DJI integration takes\none of two paths (set in config):\n\n```yaml\nflight:\n  adapter: dji\n  dji_bridge_url: \"udp:\u002F\u002F:14540\"   # a DJI->MAVLink bridge \u002F PSDK onboard app endpoint\n```\n\n- **DJI→MAVLink bridge (recommended):** a small PSDK onboard app (or open bridge)\n  republishes DJI flight state as MAVLink; Flyguard reuses all its mission \u002F\n  geofence \u002F failsafe logic unchanged against that endpoint.\n- **Onboard PSDK app:** a Payload-SDK app on the Jetson commands DJI waypoint\n  missions directly (integration points in `flyguard\u002Fhal\u002Fflight.py:DjiFlight`).\n\nVideo comes from the DJI payload camera (RTSP livestream \u002F DJI Dock); set\n`camera.source: rtsp`. PX4\u002FPixhawk is also supported (`flight.adapter: mavsdk`),\nand `flight.adapter: sim` needs no hardware at all.\n\n## Accessing the dashboard\n\nThe Ground Control Station is a web app. Start it and open it in a browser:\n\n```bash\nflyguard gcs                                   # built-in demo pasture\nflyguard gcs --config config\u002Ffarm.example.yaml # your farm\nflyguard gcs --flies 8 --cattle 2 --person     # demo the person-safety inhibit\n```\n\nThen open **http:\u002F\u002F127.0.0.1:8000** in your browser. The host\u002Fport come from the\n`gcs:` block in your config:\n\n```yaml\ngcs:\n  host: \"127.0.0.1\"   # use \"0.0.0.0\" to reach it from another machine on the LAN\n  port: 8000\n```\n\nWhat you get on the dashboard:\n- **Live annotated feed** (`\u002Fvideo`) — detections, track IDs, target crosshair,\n  and a banner when firing is inhibited (person in frame \u002F E-STOP).\n- **Telemetry & patrol status**, and the **safety-interlock panel** (all must be\n  green to fire).\n- **Fire \u002F abort log** — every shot and every refusal, with the reason.\n- **ARM & PATROL \u002F DISARM (RTL) \u002F ■ E-STOP** controls.\n\n> Nothing fires until you press **ARM & PATROL**. **E-STOP** latches and\n> hard-offs the (simulated) laser from any state. If you set `host: 0.0.0.0`,\n> put it behind a trusted network — the controls are intentionally unauthenticated\n> so the E-STOP is always one click away.\n\n## Tests\n\n```bash\npytest          # 60 tests incl. the safety-regression suite\n```\n\n## License\n\nMIT (software). The laser\u002Faviation aspects carry separate legal obligations\n","Flyguard 是一个专为牧场设计的自主无人机激光防御系统，用于对抗牛虻。该项目利用 Python 编程语言开发，通过无人机在牧场上空巡逻，分析视频流以检测和跟踪牛身上的牛虻，并使用云台瞄准的激光将其消灭，同时确保不会对牛或人类造成伤害。其核心技术包括基于 YOLO 的目标检测、ByteTrack 跟踪算法以及一系列安全互锁机制来保障操作的安全性。适用于需要减少由牛虻引起经济损失（如体重下降、产奶量减少及疾病传播）的畜牧业场景。","2026-06-11 04:09:42","CREATED_QUERY"]