Handle MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN 'Do nothing for autopilot' #13230
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.
Describe problem solved by this pull request
I was using MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN to signal an onboard computer to shutdown and for the PX4 autopilot to "do nothing." This is specified by setting param1=0 and param2=2 in the command, but PX4 does not explicitly handle the case of param1=0, which causes PX4 to incorrectly respond with DENIED. My changes cause PX4 to respond with ACCEPTED instead.
Describe your solution
When param1=0, respond with ACCEPTED and do nothing else.
Test data / coverage
The problem is reproducible using a custom QGC widget. I used a widget which includes the following:
Here is a screenshot of what would happen before the changes:
Notice the critical notification near the top of the QGC window. With the code changes, the critical notification no longer appears at the top of the QGC window.