Skip to content

feat: add esc connection match protocol check - #2046

Open
OmkarSarkar204 wants to merge 2 commits into
ArduPilot:masterfrom
OmkarSarkar204:more-analysis-checks
Open

feat: add esc connection match protocol check#2046
OmkarSarkar204 wants to merge 2 commits into
ArduPilot:masterfrom
OmkarSarkar204:more-analysis-checks

Conversation

@OmkarSarkar204

@OmkarSarkar204 OmkarSarkar204 commented Sep 7, 2026

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

@amilcarlucas amilcarlucas left a comment

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.

Looks good, but remove the changes that add

SPDX-FileCopyrightText: 2024-2026 Amilcar do Carmo Lucas amilcar.lucas@iav.de

To the files, I have had very little influence over those files.

@OmkarSarkar204
OmkarSarkar204 force-pushed the more-analysis-checks branch 2 times, most recently from 6dbe80f to 6e9cb87 Compare September 12, 2026 19:20
@OmkarSarkar204
OmkarSarkar204 marked this pull request as ready for review September 12, 2026 19:20
Copilot AI lite review requested due to automatic review settings September 12, 2026 19:20

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.

🟡 Changes recommended

Unresolved issues remain in ESC protocol matching, vehicle-specific parameter selection, and absent-mapping handling.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds ESC connection protocol consistency validation to log analysis, with related test coverage and SPDX attribution updates.

Changes:

  • Adds ESC protocol matching diagnostics.
  • Adds parameter derivation and VIBE analysis tests.
  • Updates copyright metadata.
File summaries
File Summary
tests/test_data_model_parameter_history.py Updates SPDX attribution.
tests/test_data_model_parameter_derivation.py Adds derivation tests.
tests/test_data_model_availability_vibe.py Adds VIBE analysis tests.
ardupilot_methodic_configurator/log_analysis/data_model_plane_flight_segment.py Updates SPDX attribution.
ardupilot_methodic_configurator/log_analysis/data_model_parameter_history.py Updates SPDX attribution.
ardupilot_methodic_configurator/log_analysis/data_model_flight_segment.py Updates SPDX attribution.
ardupilot_methodic_configurator/log_analysis/data_model_availability_esc.py Adds ESC protocol consistency diagnostics.
Review details

Suppressed comments (2)

ardupilot_methodic_configurator/log_analysis/data_model_availability_esc.py:131

  • When the parameter definition does not contain the declared protocol, matching_codes is empty and every non-None actual value is reported as a mismatch. An absent mapping means the analyzer cannot establish a mismatch; guard this case (or use the component fallback mapping) before emitting a warning.
        matching_codes = find_matching_param_values(self.apm_doc, "MOT_PWM_TYPE", declared)
        actual = self.parameters.get("MOT_PWM_TYPE")
        if actual is None or str(int(actual)) in matching_codes:
            return None

ardupilot_methodic_configurator/log_analysis/data_model_availability_esc.py:137

  • This new user-facing gettext message is absent from ardupilot_methodic_configurator/locale/ardupilot_methodic_configurator.pot and all language catalogs, so the new diagnostic cannot be translated and the message catalogs remain out of sync with the source. Regenerate the POT file and merge the new entry into the PO catalogs (then compile the MO files) as part of this change.
        return AvailabilityIssue(
            _(
                "MOT_PWM_TYPE is {actual}, but the ESC's FC->ESC Connection protocol is declared as "
                "{declared} in your vehicle_components specifications."
            ).format(actual=int(actual), declared=declared),
  • Files reviewed: 7/7 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +62 to +66
mismatch_issue = self._pwm_type_mismatch_issue()
issues = (
[mismatch_issue]
if mismatch_issue is not None
else [
Comment on lines +128 to +130
matching_codes = find_matching_param_values(self.apm_doc, "MOT_PWM_TYPE", declared)
actual = self.parameters.get("MOT_PWM_TYPE")
if actual is None or str(int(actual)) in matching_codes:
self.check_rpm,
self.check_current,
self.check_error_rate,
self.check_pwm_type_matches_connection_protocol,
Signed-off-by: Omkar Sarkar <omkarsarkar24@gmail.com>

test: fix some pylint

Signed-off-by: Omkar Sarkar <omkarsarkar24@gmail.com>
Signed-off-by: Omkar Sarkar <omkarsarkar24@gmail.com>
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