One‑click electrical compatibility & mission‑performance checks for UAV part combinations. This repository provides:
- A rule‑based Compatibility Checker that verifies electrical fit (battery↔ESC↔motor↔payload, etc.).
- A physics‑backed Performance Estimator that scores a component set against mission requirements.
- A minimal Flask UI + REST API so you can test combos in a browser or script it from build pipelines.
# 1 · Unpack (or git clone) ----------------------------------
unzip BNT---Component-Validation-Module--main.zip
cd "Component Validation/uav_component_estimator" # <— project root
# 2 · Create & activate an isolated env -----------------------
python -m venv .venv && source .venv/bin/activate # PowerShell: .venv\Scripts\Activate
# 3 · Install the exact package set --------------------------
pip install --upgrade pip
pip install -r requirements.txt
# 4 · Smoke‑test the checker ---------------------------------
python -m estimator.quicktest # prints PASS/FAIL table
# 5 · Launch the mini‑UI -------------------------------------
python app.py # open http://127.0.0.1:5000/| Tool | Version | Notes |
|---|---|---|
| Python | 3.10 – 3.12 | Official installers or brew install python@3.12 |
| Git (optional) | latest | Only needed if you clone instead of unzip |
No C/Fortran system libraries required – pure‑Python deps only.
uav_component_estimator/
├── app.py # Flask entry‑point
├── estimator/ # Core library (compatibility, performance, utils)
├── data/ # Inventory CSVs (do **not** edit – treat as source‑of‑truth)
├── requirements.txt # Locked dependency versions
└── README.md # <— you are here
python - << 'PY'
from estimator import load_components, check_component_compatibility
from estimator.utils import CSV_PATHS, list_components
ids = {cat: list_components(path)[0] for cat, path in CSV_PATHS.items()}
comps = load_components(ids)
ok, log = check_component_compatibility(comps, detailed=True)
print("COMPATIBLE:", ok)
print("\n".join(log))
PYExpected output starts with COMPATIBLE: True followed by a rule‑by‑rule PASS/SKIP breakdown.
python app.py- Binds to http://127.0.0.1:5000/
- Auto‑reloads on code changes
- Features dropdown selectors populated from
data/CSVs and a JSON textbox for mission profiles.
Use Ctrl +C to stop.
GET /api/components/<category>
# example
curl http://127.0.0.1:5000/api/components/batteryPOST /api/check
{
"battery": "BAT-123",
"esc": "ESC-30A",
"motor": "EDF-50mm",
"propeller": "PROP-9x6"
}Sample response:
{
"compatible": true,
"links": { "battery": "https://…", "esc": "https://…" },
"reasons": [
"[PASS] Battery voltage within every load’s range",
"[SKIP] No regulator present",
"[PASS] Battery 300 A ≥ est. draw 245 A (margin 10%)"
]
}POST /api/evaluate
{
"components": {
"battery": "BAT-123",
"esc": "ESC-30A",
"motor": "EDF-50mm"
},
"mission": {
"payload_mass_kg": 0.8,
"cruise_speed_m_s": 14,
"endurance_min": 25,
"takeoff_distance_m": 40
}
}Returns an object containing computed metrics and an overall score.
pip install pytest
pytest # zero tests for now – add yours in tests/Pull requests are welcome! Please open an issue to discuss major changes first and ensure new logic ships with unit tests.
Released under the MIT License – see LICENSE for details.