Skip to content

Attempt to set parameters 3 times by default#1037

Merged
1Blademaster merged 6 commits intomainfrom
1010-bug-fix-flakey-copter-test
Mar 5, 2026
Merged

Attempt to set parameters 3 times by default#1037
1Blademaster merged 6 commits intomainfrom
1010-bug-fix-flakey-copter-test

Conversation

@1Blademaster
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings March 1, 2026 20:50
@1Blademaster 1Blademaster linked an issue Mar 1, 2026 that may be closed by this pull request
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 updates parameter-setting behavior to retry (up to the default 3 attempts) when a PARAM_VALUE ack is received but does not confirm the requested value, and removes a magic-number MAVLink param type in the flight modes controller.

Changes:

  • Update ParamsController.setParam() to track remaining retries explicitly and re-attempt setting when the acked value mismatches.
  • Improve log messaging around retries/attempt counts for parameter setting failures.
  • Replace hard-coded param_type = 2 with mavutil.mavlink.MAV_PARAM_TYPE_INT8 in flight mode parameter updates.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
radio/app/controllers/paramsController.py Adjusts retry loop/ack-handling so value mismatches trigger another attempt; updates logging.
radio/app/controllers/flightModesController.py Replaces a magic-number MAVLink param type with a named constant for clarity.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread radio/app/controllers/paramsController.py
Comment thread radio/app/controllers/paramsController.py
Comment thread radio/app/controllers/paramsController.py
@1Blademaster
Copy link
Copy Markdown
Member Author

Will keep this PR open for a while just so I can ensure that the tests pass repeatedly...

@1Blademaster
Copy link
Copy Markdown
Member Author

Looking at the AP firmware, it's a uint8_t data type for the parameter for flight modes... Maybe that's causing this to fail.

@1Blademaster 1Blademaster merged commit f821070 into main Mar 5, 2026
7 checks passed
@1Blademaster 1Blademaster deleted the 1010-bug-fix-flakey-copter-test branch March 5, 2026 18:57
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.

[BUG] Fix flakey copter test

2 participants