inav-toolkit 2.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- inav_toolkit/__init__.py +3 -0
- inav_toolkit/autotune.py +504 -0
- inav_toolkit/blackbox_analyzer.py +11070 -0
- inav_toolkit/flight_db.py +674 -0
- inav_toolkit/i18n.py +192 -0
- inav_toolkit/locales/en.json +187 -0
- inav_toolkit/locales/es.json +187 -0
- inav_toolkit/locales/pt_BR.json +187 -0
- inav_toolkit/msp.py +1293 -0
- inav_toolkit/param_analyzer.py +2832 -0
- inav_toolkit/vtol_configurator.py +856 -0
- inav_toolkit/wizard.py +1095 -0
- inav_toolkit-2.3.0.dist-info/METADATA +296 -0
- inav_toolkit-2.3.0.dist-info/RECORD +18 -0
- inav_toolkit-2.3.0.dist-info/WHEEL +5 -0
- inav_toolkit-2.3.0.dist-info/entry_points.txt +5 -0
- inav_toolkit-2.3.0.dist-info/licenses/LICENSE +674 -0
- inav_toolkit-2.3.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: inav-toolkit
|
|
3
|
+
Version: 2.3.0
|
|
4
|
+
Summary: Blackbox analyzer, parameter checker, and tuning wizard for INAV flight controllers
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/agoliveira/INAV-Toolkit
|
|
7
|
+
Project-URL: Issues, https://github.com/agoliveira/INAV-Toolkit/issues
|
|
8
|
+
Keywords: inav,drone,blackbox,pid,tuning,flight-controller,multirotor
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering
|
|
22
|
+
Requires-Python: >=3.8
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: numpy>=1.21.0
|
|
26
|
+
Requires-Dist: scipy>=1.7.0
|
|
27
|
+
Requires-Dist: matplotlib>=3.5.0
|
|
28
|
+
Requires-Dist: pyserial>=3.5
|
|
29
|
+
Provides-Extra: test
|
|
30
|
+
Requires-Dist: pytest>=7.0; extra == "test"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# INAV Toolkit
|
|
34
|
+
|
|
35
|
+
A Python toolkit for analyzing blackbox logs, validating configurations, and tuning INAV flight controllers. Plug in your FC via USB - it pulls the config, downloads the blackbox, analyzes PID tuning and navigation performance, tells you exactly what to change, and gives you the CLI commands to paste.
|
|
36
|
+
|
|
37
|
+
Built for the INAV long-range community. Tested on 7" to 15" multirotors with GPS navigation, INAV 9.0.x.
|
|
38
|
+
|
|
39
|
+
## Install / Update
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install inav-toolkit
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Or from source:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
git clone https://github.com/agoliveira/INAV-Toolkit.git
|
|
49
|
+
cd INAV-Toolkit
|
|
50
|
+
python3 -m venv .venv
|
|
51
|
+
source .venv/bin/activate
|
|
52
|
+
pip install -r requirements.txt
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Or on Debian/Ubuntu, system packages:
|
|
56
|
+
```bash
|
|
57
|
+
sudo apt install python3-numpy python3-scipy python3-serial
|
|
58
|
+
```
|
|
59
|
+
Python 3.8+. `pyserial` only needed for direct FC connection.
|
|
60
|
+
|
|
61
|
+
> **Note:** If using a venv, activate it (`source .venv/bin/activate`) before running any commands below.
|
|
62
|
+
|
|
63
|
+
### Connect and Analyze
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
That's it. The tool will auto-detect your FC, pull the full config dump, download the blackbox, split multi-flight logs, run PID tuning and navigation analysis, clean up log files, and erase flash. Results are presented in an interactive menu:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
TUNE QUALITY: █████████░░░░░░░░░░░ 46/100
|
|
73
|
+
Noise:94 | PID:26 | Motors:53
|
|
74
|
+
|
|
75
|
+
[1] PID Tuning R:62%OS P:ok Y:N/A
|
|
76
|
+
[2] Noise Analysis 94/100 - 2 sources
|
|
77
|
+
[3] Hover & Stability R:moderate P:wind Y:wind
|
|
78
|
+
[4] Nav Performance 45/100 - 4 decel events, CEP 1271cm
|
|
79
|
+
[5] Nav Sensors Com:70 GPS:100 Bar:70
|
|
80
|
+
[6] Config Review 1 critical, 2 warnings
|
|
81
|
+
[7] Flight History available
|
|
82
|
+
[C] CLI Commands 2 changes
|
|
83
|
+
[A] Show All
|
|
84
|
+
[Q] Quit
|
|
85
|
+
|
|
86
|
+
Section (1-7, C, A, Q):
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Each section shows a one-line status at a glance. Select a number to drill into details. The CLI Commands section gives you paste-ready commands for INAV Configurator.
|
|
90
|
+
|
|
91
|
+
## Tools
|
|
92
|
+
|
|
93
|
+
### Blackbox Analyzer
|
|
94
|
+
|
|
95
|
+
Decodes `.bbl` / `.bfl` blackbox logs natively in Python (no `blackbox_decode` needed) and produces actionable tuning and navigation recommendations.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Connect to FC - pull config + download + analyze + cleanup + erase
|
|
99
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto
|
|
100
|
+
|
|
101
|
+
# Analyze an existing log file
|
|
102
|
+
python3 -m inav_toolkit.blackbox_analyzer flight.bbl
|
|
103
|
+
|
|
104
|
+
# With a saved dump/diff for config comparison
|
|
105
|
+
python3 -m inav_toolkit.blackbox_analyzer flight.bbl --config my_dump.txt
|
|
106
|
+
|
|
107
|
+
# Specify frame size for tailored thresholds
|
|
108
|
+
python3 -m inav_toolkit.blackbox_analyzer flight.bbl --frame 10
|
|
109
|
+
|
|
110
|
+
# Download only, analyze later
|
|
111
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto --download-only
|
|
112
|
+
|
|
113
|
+
# Keep raw log files (skip auto-cleanup)
|
|
114
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto --keep-logs
|
|
115
|
+
|
|
116
|
+
# Don't erase flash after download
|
|
117
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto --no-erase
|
|
118
|
+
|
|
119
|
+
# Archive analyzed flight (compress to blackbox/archive/)
|
|
120
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto --archive
|
|
121
|
+
|
|
122
|
+
# Skip nav analysis even if nav fields are present
|
|
123
|
+
python3 -m inav_toolkit.blackbox_analyzer flight.bbl --no-nav
|
|
124
|
+
|
|
125
|
+
# Flight progression history
|
|
126
|
+
python3 -m inav_toolkit.blackbox_analyzer flight.bbl --history
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**What it analyzes (auto-detected from available data):**
|
|
130
|
+
|
|
131
|
+
PID tuning:
|
|
132
|
+
- Step response - overshoot %, tracking delay, settling time per axis
|
|
133
|
+
- FeedForward-aware - attributes overshoot between FF and P, recommends FF reduction before P cuts
|
|
134
|
+
- Hover oscillation - RMS and peak-to-peak gyro, wind buffeting vs P oscillation on large frames
|
|
135
|
+
- Noise spectrum - peak frequencies, source classification (propwash, electrical, motor imbalance)
|
|
136
|
+
- Filter recommendations - phase-lag-aware, won't recommend destructive LPF cuts on 10"+ frames
|
|
137
|
+
- Motor balance - average load and saturation per motor
|
|
138
|
+
|
|
139
|
+
Navigation performance (when nav fields are present):
|
|
140
|
+
- Deceleration overshoot - measures position error when stopping, oscillation count, settling time
|
|
141
|
+
- Position hold quality - CEP, RMS error, max drift, toilet-bowl pattern detection
|
|
142
|
+
- Altitude hold quality - vertical error RMS, oscillation detection
|
|
143
|
+
- Controller saturation - detects when nav demands exceed platform capability
|
|
144
|
+
- Wind vs tuning - correlates position error with wind estimates to separate environmental drift from PID problems
|
|
145
|
+
|
|
146
|
+
Navigation sensors:
|
|
147
|
+
- Compass health - heading jitter, magnetic interference, drift rate
|
|
148
|
+
- GPS quality - fix type, satellite count, HDOP, position jumps
|
|
149
|
+
- Barometer - noise level, spike detection, throttle correlation
|
|
150
|
+
- Position estimator - GPS vs estimator divergence
|
|
151
|
+
|
|
152
|
+
**What it outputs:**
|
|
153
|
+
- Interactive terminal menu (with `--device auto`) or sequential report
|
|
154
|
+
- HTML report with interactive charts (noise spectrum, PID response, motor traces)
|
|
155
|
+
- `state.json` for cross-referencing with the parameter analyzer
|
|
156
|
+
- SQLite flight database for progression tracking across sessions
|
|
157
|
+
|
|
158
|
+
### Parameter Analyzer
|
|
159
|
+
|
|
160
|
+
Validates an INAV config for issues. Accepts `dump all` or `diff all` output. Catches problems that blackbox data alone can't detect.
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Check existing config
|
|
164
|
+
python3 -m inav_toolkit.param_analyzer my_dump.txt --frame 10
|
|
165
|
+
|
|
166
|
+
# Generate starting PIDs for a new build
|
|
167
|
+
python3 -m inav_toolkit.param_analyzer --setup 10 --voltage 6S
|
|
168
|
+
|
|
169
|
+
# Compare starting PIDs with current config
|
|
170
|
+
python3 -m inav_toolkit.param_analyzer --setup 10 --voltage 6S my_dump.txt
|
|
171
|
+
|
|
172
|
+
# Cross-reference with blackbox results
|
|
173
|
+
python3 -m inav_toolkit.param_analyzer my_dump.txt --blackbox state.json
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**What it checks:** safety (beepers, failsafe, battery limits), motors (protocol, RPM filter, ESC telemetry), filters (frame-appropriate LPF, dynamic notch), PIDs (cross-profile consistency, FF, antigravity), navigation (frame-aware nav PID thresholds, RTH altitude, deceleration time, position PIDs, safehome), GPS (constellations, compass cal), blackbox (logging rate, essential fields).
|
|
177
|
+
|
|
178
|
+
**Setup mode** generates conservative starting PIDs for 7/10/12/15" frames at 4S/6S/8S/12S.
|
|
179
|
+
|
|
180
|
+
### VTOL Configurator
|
|
181
|
+
|
|
182
|
+
Validates INAV VTOL configurations using mixer_profile switching.
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
python3 -m inav_toolkit.vtol_configurator vtol_config.txt
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Checks MC/FW mixer profiles, tilt servo rules, motor role inference, yaw authority, FW control surfaces, mode assignments, automated RTH transition, and airmode conflicts.
|
|
189
|
+
|
|
190
|
+
### Guided Wizard
|
|
191
|
+
|
|
192
|
+
Interactive session manager that walks you through the full workflow.
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
python3 -m inav_toolkit.wizard
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Connects to your FC and offers: tuning session, nav health check, new build safety check, blackbox download, or config restore from backup.
|
|
199
|
+
|
|
200
|
+
### MSP Module
|
|
201
|
+
|
|
202
|
+
Direct serial communication with INAV flight controllers. Used internally by the other tools, also usable standalone.
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# Standalone: identify FC and download blackbox
|
|
206
|
+
python3 -m inav_toolkit.msp --device auto
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Handles MSP v2 framing, pipelined dataflash download (4-deep), CLI command/batch, `dump all`/`diff all` config pull, auto-reconnection after USB VCP reset.
|
|
210
|
+
|
|
211
|
+
## Tuning Workflow
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
1. NEW BUILD
|
|
215
|
+
python3 -m inav_toolkit.param_analyzer --setup 10 --voltage 6S
|
|
216
|
+
-> Conservative starting PIDs, filters, and nav settings
|
|
217
|
+
-> Paste CLI commands into INAV Configurator
|
|
218
|
+
|
|
219
|
+
2. SAFETY CHECK
|
|
220
|
+
python3 -m inav_toolkit.param_analyzer my_dump.txt --frame 10
|
|
221
|
+
-> Catches disabled beepers, failsafe issues, battery limits
|
|
222
|
+
-> Flags nav PIDs that are INAV defaults (tuned for 5") on larger frames
|
|
223
|
+
-> Fix before flying
|
|
224
|
+
|
|
225
|
+
3. FLY
|
|
226
|
+
-> Enable blackbox logging (GYRO_RAW, MOTORS, RC_COMMAND)
|
|
227
|
+
-> Hover for 10s, then do deliberate roll/pitch/yaw sweeps
|
|
228
|
+
-> Engage POSHOLD and RTH for nav analysis data
|
|
229
|
+
|
|
230
|
+
4. ANALYZE
|
|
231
|
+
python3 -m inav_toolkit.blackbox_analyzer --device auto
|
|
232
|
+
-> Downloads log, pulls full config dump, runs all analysis
|
|
233
|
+
-> Interactive menu with PID, noise, nav, config review sections
|
|
234
|
+
-> Shows exactly what to change with CLI commands
|
|
235
|
+
-> Auto-cleans log files and erases flash when done
|
|
236
|
+
|
|
237
|
+
5. APPLY + REPEAT
|
|
238
|
+
-> Paste CLI commands, fly again
|
|
239
|
+
-> Tool auto-detects which flights use the new config
|
|
240
|
+
-> Flight database tracks your progression across sessions
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## Frame Size Profiles
|
|
244
|
+
|
|
245
|
+
The `--setup` mode provides conservative starting configurations:
|
|
246
|
+
|
|
247
|
+
| Frame | P Roll | P Pitch | D | Gyro LPF | Dyn Notch Min |
|
|
248
|
+
|-------|--------|---------|---|----------|---------------|
|
|
249
|
+
| 7" 4S | 35 | 38 | 23 | 90 Hz | 60 Hz |
|
|
250
|
+
| 10" 4S | 25 | 28 | 18 | 65 Hz | 50 Hz |
|
|
251
|
+
| 12" 4S | 20 | 22 | 14 | 50 Hz | 35 Hz |
|
|
252
|
+
| 15" 4S | 15 | 16 | 10 | 40 Hz | 25 Hz |
|
|
253
|
+
|
|
254
|
+
Higher voltage (6S/8S/12S) scales P and D down proportionally.
|
|
255
|
+
|
|
256
|
+
## Project Structure
|
|
257
|
+
|
|
258
|
+
```
|
|
259
|
+
INAV-Toolkit/
|
|
260
|
+
├── inav_toolkit/
|
|
261
|
+
│ ├── __init__.py # Package version
|
|
262
|
+
│ ├── blackbox_analyzer.py # Blackbox log analyzer + nav performance
|
|
263
|
+
│ ├── msp.py # MSP v2 serial communication
|
|
264
|
+
│ ├── flight_db.py # SQLite flight history
|
|
265
|
+
│ ├── param_analyzer.py # Config validator + setup generator
|
|
266
|
+
│ ├── vtol_configurator.py # VTOL mixer validator
|
|
267
|
+
│ ├── wizard.py # Guided session manager
|
|
268
|
+
│ ├── autotune.py # Autotune orchestrator (experimental)
|
|
269
|
+
│ ├── i18n.py # Internationalization
|
|
270
|
+
│ └── locales/ # en, pt_BR, es
|
|
271
|
+
├── docs/
|
|
272
|
+
├── tests/
|
|
273
|
+
├── README.md
|
|
274
|
+
├── CHANGELOG.md
|
|
275
|
+
├── LICENSE # MIT
|
|
276
|
+
└── requirements.txt
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
## INAV Version Support
|
|
280
|
+
|
|
281
|
+
Developed and tested against **INAV 9.0.x**. The blackbox binary decoder handles the Cleanflight/INAV encoding format natively in Python - no external `blackbox_decode` tool needed. Parameter names are INAV-specific; Betaflight is not currently supported.
|
|
282
|
+
|
|
283
|
+
## Contributing
|
|
284
|
+
|
|
285
|
+
This is an active project. Planned: autonomous tuning loop (Pi Zero 2W or ESP32 strapped to the quad) and web-based report viewer.
|
|
286
|
+
|
|
287
|
+
## License
|
|
288
|
+
|
|
289
|
+
MIT License. See [LICENSE](LICENSE).
|
|
290
|
+
|
|
291
|
+
## Acknowledgments
|
|
292
|
+
|
|
293
|
+
- The INAV development team and community
|
|
294
|
+
- QuadMeUp (Pawel Spychalski) for filter and RPM analysis research
|
|
295
|
+
- The INAV Fixed Wing Group for modes documentation
|
|
296
|
+
- UAV Tech for the spark that gave me the idea to create this
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
inav_toolkit/__init__.py,sha256=NuLVQivUZUyzKswLyjjqbX1veU1raCB3t7g0U7PNpUY,129
|
|
2
|
+
inav_toolkit/autotune.py,sha256=LemxctIJvuaudsDKz3y9QwATgTmJeMU9-GhoeYZ7K9g,20514
|
|
3
|
+
inav_toolkit/blackbox_analyzer.py,sha256=Hda4PK9TUsJsGUl-22XKBHEbb9kf7pPdfq9EpSh6xRs,479574
|
|
4
|
+
inav_toolkit/flight_db.py,sha256=_cuLSBhA0xwNJPZv38CJErXVncmdmnUxRTBwZuDQf90,25456
|
|
5
|
+
inav_toolkit/i18n.py,sha256=kDd1nIpo9WE48RmW3ZyvEvrWPfAcM4E7Y-XKx1b9Azg,5521
|
|
6
|
+
inav_toolkit/msp.py,sha256=BRBD8ExS7cGS0N8VFpFit2wqcarRTKhVFRUudGvHmYM,47315
|
|
7
|
+
inav_toolkit/param_analyzer.py,sha256=Ps19BdY8-GR-X-lkYnsxse86PpondLBwkH5jTnlo9zw,129366
|
|
8
|
+
inav_toolkit/vtol_configurator.py,sha256=awd5UIH8tfG-Ie5qUUsP4s0ZfJmsXZavJi-_SZdBBZw,35812
|
|
9
|
+
inav_toolkit/wizard.py,sha256=psnRPazPxsKdiehmP8cfvZnH9JAh-v3vOvLzDg7TIVE,38153
|
|
10
|
+
inav_toolkit/locales/en.json,sha256=LbyQt0Ira_A5j8ClrGmnFPn-bQierzpbEoUBtY4oY7I,9348
|
|
11
|
+
inav_toolkit/locales/es.json,sha256=RygiaAY2vx96qXESUWjFxhUbOvHiszwuBsq-hhyYKKg,10217
|
|
12
|
+
inav_toolkit/locales/pt_BR.json,sha256=EnNtwzVOncJhq7PseBiDTnNEOLG46FgajEoCYDJUoGQ,10076
|
|
13
|
+
inav_toolkit-2.3.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
14
|
+
inav_toolkit-2.3.0.dist-info/METADATA,sha256=IhsQnueEKZUWk3iVUk16LnCZBk-3nZD9q-hCOMcXvug,11521
|
|
15
|
+
inav_toolkit-2.3.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
16
|
+
inav_toolkit-2.3.0.dist-info/entry_points.txt,sha256=izJpHekrM3ENH1p27jNiKfmgdrAc9sOkH7N8AtGnXjg,189
|
|
17
|
+
inav_toolkit-2.3.0.dist-info/top_level.txt,sha256=AkBMhOHRUgjHwR2VnYp4RcxB6NWeZtGYRdLgtzOUpH0,13
|
|
18
|
+
inav_toolkit-2.3.0.dist-info/RECORD,,
|