feat: add esc connection match protocol check - #2046
Conversation
amilcarlucas
left a comment
There was a problem hiding this comment.
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.
6dbe80f to
6e9cb87
Compare
There was a problem hiding this comment.
🟡 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_codesis empty and every non-Noneactual 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.potand 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.
| mismatch_issue = self._pwm_type_mismatch_issue() | ||
| issues = ( | ||
| [mismatch_issue] | ||
| if mismatch_issue is not None | ||
| else [ |
| 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, |
407798a to
c2d2fe1
Compare
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>
c2d2fe1 to
02afa4c
Compare
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: