Skip to content

Fix parameters and commands uplink from drone#682

Merged
1Blademaster merged 4 commits intorelease-alpha-0.1.10from
alpha-0.1.10/681-getsingleparam-fails-every-time
Sep 10, 2025
Merged

Fix parameters and commands uplink from drone#682
1Blademaster merged 4 commits intorelease-alpha-0.1.10from
alpha-0.1.10/681-getsingleparam-fails-every-time

Conversation

@1Blademaster
Copy link
Copy Markdown
Member

@1Blademaster 1Blademaster commented Sep 9, 2025

It should be noted that the decorator should be used when sending a command and checking for a receiving message. Some commands such as getSingleParam or setCurrentFlightMode use 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).

@1Blademaster 1Blademaster requested a review from Copilot September 9, 2025 20:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 sendingCommandLock decorator 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.

Comment thread radio/app/controllers/navController.py
Comment thread radio/app/controllers/missionController.py
Comment thread radio/app/controllers/navController.py
@1Blademaster 1Blademaster changed the title Alpha 0.1.10/681 getsingleparam fails every time Fix parameters and commands uplink from drone Sep 9, 2025
Copy link
Copy Markdown
Contributor

@NexInfinite NexInfinite left a comment

Choose a reason for hiding this comment

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

LGTM

@1Blademaster 1Blademaster merged commit 5808ba4 into release-alpha-0.1.10 Sep 10, 2025
7 checks passed
@1Blademaster 1Blademaster deleted the alpha-0.1.10/681-getsingleparam-fails-every-time branch September 10, 2025 20:07
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants