Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN 'Do nothing for autopilot' #13230

Merged
merged 1 commit into from Oct 18, 2019
Merged

Handle MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN 'Do nothing for autopilot' #13230

merged 1 commit into from Oct 18, 2019

Conversation

nsteele
Copy link
Contributor

@nsteele nsteele commented Oct 18, 2019

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:

QGCButton {
text: "Shutdown Onboard Computer"
// Arguments to CustomCommandWidgetController::sendCommand (MAVLink COMMAND_LONG)
// command id MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN (246) https://mavlink.io/en/messages/common.html#MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN
// target_component id = 0 (MAV_COMP_ID_ALL)
// confirmation
// param 1 - 7
onClicked: controller.sendCommand(246, 0, 0, 0, 2, 0, 0, 0, 0, 0)
}

Here is a screenshot of what would happen before the changes:

Screenshot from 2019-10-18 09-55-21

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants