mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 11:43:34 +08:00
logger: send post-flight perf data when stopping mavlink log streaming
- send out VEHICLE_CMD_RESULT_IN_PROGRESS - delete the ulog object when receiving the ACK from logger, instead of the stop command
This commit is contained in:
@@ -2381,6 +2381,7 @@ Mavlink::task_main(int argc, char *argv[])
|
||||
|
||||
/* send command ACK */
|
||||
bool cmd_logging_start_acknowledgement = false;
|
||||
bool cmd_logging_stop_acknowledgement = false;
|
||||
|
||||
if (_vehicle_command_ack_sub.updated()) {
|
||||
static constexpr size_t COMMAND_ACK_TOTAL_LEN = MAVLINK_MSG_ID_COMMAND_ACK_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES;
|
||||
@@ -2412,6 +2413,10 @@ Mavlink::task_main(int argc, char *argv[])
|
||||
|
||||
if (command_ack.command == vehicle_command_s::VEHICLE_CMD_LOGGING_START) {
|
||||
cmd_logging_start_acknowledgement = true;
|
||||
|
||||
} else if (command_ack.command == vehicle_command_s::VEHICLE_CMD_LOGGING_STOP
|
||||
&& command_ack.result == vehicle_command_ack_s::VEHICLE_RESULT_ACCEPTED) {
|
||||
cmd_logging_stop_acknowledgement = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2453,10 +2458,9 @@ Mavlink::task_main(int argc, char *argv[])
|
||||
|
||||
/* check for ulog streaming messages */
|
||||
if (_mavlink_ulog) {
|
||||
if (_mavlink_ulog_stop_requested.load()) {
|
||||
if (cmd_logging_stop_acknowledgement) {
|
||||
_mavlink_ulog->stop();
|
||||
_mavlink_ulog = nullptr;
|
||||
_mavlink_ulog_stop_requested.store(false);
|
||||
|
||||
} else {
|
||||
if (cmd_logging_start_acknowledgement) {
|
||||
|
||||
Reference in New Issue
Block a user