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

{Sponsored by Intelliterra} Made "Declare Emergency" button send MAV_CMD to set emergency #10770

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/Vehicle/RemoteIDManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,22 @@ void RemoteIDManager::setEmergency(bool declare)
{
_emergencyDeclared = declare;
emit emergencyDeclaredChanged();
// Wether we are starting an emergency or cancelling it, we need to enforce sending

// We send a MAV Command to the vehicle to start or stop the emergency
_vehicle->sendMavCommand(
_vehicle->compId(), // Target component
MAV_CMD_DO_SET_EMERGENCY, // MAV_CMD
true, // ShowError
_emergencyDeclared ? 1 : 0,
0,
0,
0,
0,
0,
0);


// Whether we are starting an emergency or cancelling it, we need to enforce sending
// this message. Otherwise, if non optimal connection quality, vehicle RID device
// could remain in the wrong state. It is clarified to the user in remoteidsettings.qml
_enforceSendingSelfID = true;
Expand Down
Loading