Skip to content

Commit

Permalink
Send remote id development command on emergency set
Browse files Browse the repository at this point in the history
  • Loading branch information
jnomikos committed Mar 10, 2024
1 parent 364f2f7 commit 9509bae
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Vehicle/RemoteIDManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,20 @@ void RemoteIDManager::setEmergency(bool declare)
{
_emergencyDeclared = declare;
emit emergencyDeclaredChanged();

// We send a MAV Command to the vehicle to start or stop the emergency
_vehicle->sendMavCommand(
_vehicle->compId(), // Target component
static_cast<MAV_CMD>(12900), // MAV_CMD_ODID_SET_EMERGENCY - Called from number because from development.xml
true, // ShowError
_emergencyDeclared ? 1 : 0,
0,
0,
0,
0,
0,
0);

// Wether 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
Expand Down

0 comments on commit 9509bae

Please sign in to comment.