Fix parameters and commands uplink from drone#682
Merged
1Blademaster merged 4 commits intorelease-alpha-0.1.10from Sep 10, 2025
Merged
Conversation
…ion, fix loiter radius parameter fetching bug
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a thread-safe locking mechanism to fix the "getsingleparam fails every time" issue by ensuring only one command is sent to the drone at a time before waiting for a response.
- Adds a
sendingCommandLockdecorator and Lock instance to prevent concurrent command execution - Applies the decorator to all drone command methods across controllers
- Fixes UI logic to only show loiter radius controls for planes (aircraft type 1)
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| radio/app/utils.py | Adds sendingCommandLock decorator for thread-safe command execution |
| radio/app/drone.py | Adds Lock instance and applies decorator to drone command methods |
| radio/app/controllers/*.py | Applies sendingCommandLock decorator to controller command methods |
| gcs/src/redux/middleware/socketMiddleware.js | Fixes comparison operators and conditionally calls loiter radius for planes only |
| gcs/src/components/layout.jsx | Adds home position and conditional loiter radius requests on dashboard load |
| gcs/src/components/dashboard/tabsSectionTabs/actionTabsSection.jsx | Conditionally renders loiter radius action only for planes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
1Blademaster
added a commit
that referenced
this pull request
Sep 28, 2025
* Add sendingCommandLock decorator to ensure thread-safe command execution, fix loiter radius parameter fetching bug * Only fetch loiter radius if aircraft is plane * Skip autopilot reboot test * Fix autopilot and gripper tests
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.
It should be noted that the decorator should be used when sending a command and checking for a receiving message. Some commands such as
getSingleParamorsetCurrentFlightModeuse the decorator themselves, so in that case you have to acquire and release the lock manually. You must ensure to release the lock before any return statement or when appropriate (i.e. when other commands can be sent to the drone without impacting the rest of your function).