vtol: only publish generic warning through mavlink to safe flash (#22870)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2024-03-12 13:27:13 +01:00 committed by GitHub
parent 00cc68baa1
commit 9f4ae0a85d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 7 deletions

View File

@ -206,45 +206,41 @@ void
VtolAttitudeControl::quadchute(QuadchuteReason reason)
{
if (!_vtol_vehicle_status.fixed_wing_system_failure) {
// only publish generic warning through mavlink to safe flash
mavlink_log_critical(&_mavlink_log_pub, "Quad-chute triggered\t");
switch (reason) {
case QuadchuteReason::TransitionTimeout:
mavlink_log_critical(&_mavlink_log_pub, "Quadchute: transition timeout\t");
events::send(events::ID("vtol_att_ctrl_quadchute_tout"), events::Log::Critical,
"Quad-chute triggered due to transition timeout");
break;
case QuadchuteReason::ExternalCommand:
mavlink_log_critical(&_mavlink_log_pub, "Quadchute: external command\t");
events::send(events::ID("vtol_att_ctrl_quadchute_ext_cmd"), events::Log::Critical,
"Quad-chute triggered due to external command");
break;
case QuadchuteReason::MinimumAltBreached:
mavlink_log_critical(&_mavlink_log_pub, "Quadchute: minimum altitude breached\t");
events::send(events::ID("vtol_att_ctrl_quadchute_min_alt"), events::Log::Critical,
"Quad-chute triggered due to minimum altitude breach");
break;
case QuadchuteReason::UncommandedDescent:
mavlink_log_critical(&_mavlink_log_pub, "Quadchute: Uncommanded descent detected\t");
events::send(events::ID("vtol_att_ctrl_quadchute_alt_loss"), events::Log::Critical,
"Quad-chute triggered due to uncommanded descent detection");
break;
case QuadchuteReason::TransitionAltitudeLoss:
mavlink_log_critical(&_mavlink_log_pub, "Quadchute: loss of altitude during transition\t");
events::send(events::ID("vtol_att_ctrl_quadchute_trans_alt_err"), events::Log::Critical,
"Quad-chute triggered due to loss of altitude during transition");
break;
case QuadchuteReason::MaximumPitchExceeded:
mavlink_log_critical(&_mavlink_log_pub, "Quadchute: maximum pitch exceeded\t");
events::send(events::ID("vtol_att_ctrl_quadchute_max_pitch"), events::Log::Critical,
"Quad-chute triggered due to maximum pitch angle exceeded");
break;
case QuadchuteReason::MaximumRollExceeded:
mavlink_log_critical(&_mavlink_log_pub, "Quadchute: maximum roll exceeded\t");
events::send(events::ID("vtol_att_ctrl_quadchute_max_roll"), events::Log::Critical,
"Quad-chute triggered due to maximum roll angle exceeded");
break;