mavlink: add class for command retransmission

This adds a class to allow for retransmission of outgoing commands.
The sent commands are kept in a timestamped list to check if they are
acked as required by the mavlink protocol.
If they are not acked within a timeout, they can be retransmitted.
This commit is contained in:
Julian Oes
2017-07-08 11:52:23 +02:00
committed by Lorenz Meier
parent 9854fc0d84
commit af0107ae0a
7 changed files with 527 additions and 18 deletions
+3
View File
@@ -88,6 +88,7 @@
#include "mavlink_bridge_header.h"
#include "mavlink_receiver.h"
#include "mavlink_main.h"
#include "mavlink_command_sender.h"
static const float mg2ms2 = CONSTANTS_ONE_G / 1000.0f;
@@ -628,6 +629,8 @@ MavlinkReceiver::handle_message_command_ack(mavlink_message_t *msg)
mavlink_msg_command_ack_decode(msg, &ack);
if (ack.result != MAV_RESULT_ACCEPTED && ack.result != MAV_RESULT_IN_PROGRESS) {
MavlinkCommandSender::instance().handle_mavlink_command_ack(ack, msg->sysid, msg->compid);
if (msg->compid == MAV_COMP_ID_CAMERA) {
PX4_WARN("Got unsuccessful result %d from camera", ack.result);
}