Supervisor: legacy CRTP fallback for pre-protocol-12 firmware#597
Merged
Supervisor: legacy CRTP fallback for pre-protocol-12 firmware#597
Conversation
The deprecated platform.send_arming_request and platform.send_crash_recovery_request delegated to the supervisor module which version-gates on protocol >= 12, causing commands to be silently dropped against old firmware. Add fallback to the old platform port protocol, matching the pattern used in localization.send_emergency_stop.
Supervisor methods now fall back to legacy CRTP ports when connected to firmware with protocol < 12. Arming/recovery falls back to the platform port, emergency stop to the localization port. A warning is emitted in all fallback cases. Reverts platformservice.py wrappers back to simple delegation since supervisor.py now handles the fallback itself.
There was a problem hiding this comment.
Pull request overview
Adds backward-compatible behavior in Supervisor so critical commands (arming/recovery/emergency stop) still work when connected to older Crazyflie firmware that does not support the supervisor CRTP port (protocol < 12), while emitting a warning on fallback.
Changes:
- Introduce legacy-firmware detection and centralized warning helper.
- Route arming and crash recovery commands to the legacy PLATFORM port on older firmware.
- Route emergency stop commands to the legacy LOCALIZATION port on older firmware (with packed payloads).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supervisor methods now fall back to legacy CRTP ports when connected to firmware with protocol < 12 (arming/recovery → platform port, emergency stop → localization port), emitting a warning on fallback. This fixes commands being silently dropped against old firmware.