Data models for Log Quality Analysis#1818
Conversation
Signed-off-by: Omkar Sarkar <omkarsarkar24@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds an initial “log analysis” layer to AMC by introducing subsystem quality data models (Battery, GPS/GNSS), a shared quality-result base model, and new summary/metadata helpers to produce a single log-analysis summary for the frontend.
Changes:
- Introduces
LogQualityResult+BaseLogQualityAnalysisModeland two initial subsystem quality models (Battery, GPS/GNSS). - Extends log extraction to compute/store log file size and estimated flight duration.
- Adds a new
analyze_log()orchestrator that composes PM status, subsystem quality results, and configuration-step validation.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| ardupilot_methodic_configurator/log_analysis/data_model_quality_base.py | Adds shared result dataclass + base class for subsystem quality checks. |
| ardupilot_methodic_configurator/log_analysis/data_model_quality_battery.py | Adds battery telemetry/config quality checks and “no data” diagnosis. |
| ardupilot_methodic_configurator/log_analysis/data_model_quality_gnss.py | Adds GPS/GNSS telemetry/config quality checks and “no data” diagnosis. |
| ardupilot_methodic_configurator/log_analysis/backend_log_extraction.py | Captures generic log metadata (file size, computed flight duration). |
| ardupilot_methodic_configurator/log_analysis/backend_log_quality_check.py | Adds PM status summarization and PM message validation helpers. |
| ardupilot_methodic_configurator/log_analysis/backend_log_analysis.py | New orchestration entrypoint returning a unified LogSummary. |
Signed-off-by: Omkar Sarkar <omkarsarkar24@gmail.com>
8c76160 to
8ad7c5e
Compare
| avg_cpu_load = float(load.mean()) / 10.0 if load is not None else 0.0 | ||
| peak_cpu_load = float(load.max()) / 10.0 if load is not None else 0.0 |
There was a problem hiding this comment.
I think these multipliers are in the .bin file and should not be hardcoded here
| """Checks battery telemetry and configuration quality.""" | ||
|
|
||
| NAME = "Battery" | ||
| CONFIG_STEP = "10_battery_monitor.param" |
There was a problem hiding this comment.
This should not be hardcoded here, it must come from configuration_steps_Arducopter.json.
| NAME = "Battery" | ||
| CONFIG_STEP = "10_battery_monitor.param" | ||
| # Battery Monitor logging is bit 9 (2^9) in LOG_BITMASK | ||
| LOG_BIT = 512 |
There was a problem hiding this comment.
This is OK but you should add a validation against the LOG_BITMASK documentation in thE pdef.xml file.
I can do that for you later if you have trouble doing it.
There was a problem hiding this comment.
Ill try it, if i have any problem ill let you know, Thank you!
| efficiency = avg_pow / tow | ||
|
|
||
| if efficiency < 200 or efficiency > 500: | ||
| issues.append(_("Power efficiency out of range, check current vehicle setup")) |
There was a problem hiding this comment.
Please do two messages:
- Power efficiency < 200W/Kg. Current is mis calibrated or take off weight is incorrect or the efficiency is really good.
- Power efficiency > 500W/Kg. Current is mis calibrated or take off weight is incorrect or the efficiency is really bad.
| """Checks GPS/GNSS telemetry and configuration quality.""" | ||
|
|
||
| NAME = "GPS" | ||
| CONFIG_STEP = "12_gnss.param" |
| NAME = "GPS" | ||
| CONFIG_STEP = "12_gnss.param" | ||
| # GPS logging is bit 2 (2^2) in LOG_BITMASK | ||
| LOG_BIT = 4 |
Description
Describe what this PR is trying to achieve. Please read our Contributing Guide for detailed guidelines.
Checklist
git commit --signoff)Testing
Describe how you tested these changes: