Skip to content

Data models for Log Quality Analysis#1818

Draft
OmkarSarkar204 wants to merge 2 commits into
ArduPilot:masterfrom
OmkarSarkar204:data-models
Draft

Data models for Log Quality Analysis#1818
OmkarSarkar204 wants to merge 2 commits into
ArduPilot:masterfrom
OmkarSarkar204:data-models

Conversation

@OmkarSarkar204

Copy link
Copy Markdown
Contributor

Description

Describe what this PR is trying to achieve. Please read our Contributing Guide for detailed guidelines.

Checklist

  • Run pre-commit checks locally
  • Verified by a human programmer
  • All commits are signed off (use git commit --signoff)
  • Code follows our coding standards
  • Documentation updated if needed
  • No breaking changes or properly documented

Testing

Describe how you tested these changes:

  • Unit tests pass
  • Integration tests pass
  • Manual testing performed
  • Tested on flight controller hardware

Signed-off-by: Omkar Sarkar <omkarsarkar24@gmail.com>
Copilot AI review requested due to automatic review settings July 11, 2026 17:53
@OmkarSarkar204 OmkarSarkar204 marked this pull request as draft July 11, 2026 17:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 + BaseLogQualityAnalysisModel and 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.

Comment thread ardupilot_methodic_configurator/log_analysis/backend_log_analysis.py Outdated
@OmkarSarkar204 OmkarSarkar204 changed the title feat(log-analysis): added data_models and base quality check Data models for Log Quality Analysis Jul 12, 2026
Signed-off-by: Omkar Sarkar <omkarsarkar24@gmail.com>
Comment on lines +100 to +101
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoding again.

NAME = "GPS"
CONFIG_STEP = "12_gnss.param"
# GPS logging is bit 2 (2^2) in LOG_BITMASK
LOG_BIT = 4

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants