Add support to new fields in command_ack

This commit is contained in:
José Roberto de Souza
2017-08-19 09:04:52 +02:00
committed by Lorenz Meier
parent d640d1aaf1
commit 4462869432
11 changed files with 77 additions and 23 deletions
+4
View File
@@ -2207,6 +2207,10 @@ Mavlink::task_main(int argc, char *argv[])
mavlink_command_ack_t msg;
msg.result = command_ack.result;
msg.command = command_ack.command;
msg.progress = command_ack.result_param1;
msg.result_param2 = command_ack.result_param2;
msg.target_system = command_ack.target_system;
msg.target_component = command_ack.target_component;
current_command_ack = command_ack.command;
mavlink_msg_command_ack_send_struct(get_channel(), &msg);
+17 -3
View File
@@ -472,8 +472,13 @@ out:
if (send_ack) {
vehicle_command_ack_s command_ack = {
.timestamp = 0,
.result_param2 = 0,
.command = cmd_mavlink.command,
.result = (ret == PX4_OK ? vehicle_command_ack_s::VEHICLE_RESULT_ACCEPTED : vehicle_command_ack_s::VEHICLE_RESULT_FAILED)
.result = (ret == PX4_OK ? vehicle_command_ack_s::VEHICLE_RESULT_ACCEPTED : vehicle_command_ack_s::VEHICLE_RESULT_FAILED),
.from_external = 0,
.result_param1 = 0,
.target_system = msg->sysid,
.target_component = msg->compid
};
if (_command_ack_pub == nullptr) {
@@ -564,8 +569,13 @@ out:
if (send_ack) {
vehicle_command_ack_s command_ack = {
.timestamp = 0,
.result_param2 = 0,
.command = cmd_mavlink.command,
.result = (ret == PX4_OK ? vehicle_command_ack_s::VEHICLE_RESULT_ACCEPTED : vehicle_command_ack_s::VEHICLE_RESULT_FAILED)
.result = (ret == PX4_OK ? vehicle_command_ack_s::VEHICLE_RESULT_ACCEPTED : vehicle_command_ack_s::VEHICLE_RESULT_FAILED),
.from_external = 0,
.result_param1 = 0,
.target_system = msg->sysid,
.target_component = msg->compid
};
if (_command_ack_pub == nullptr) {
@@ -588,9 +598,13 @@ MavlinkReceiver::handle_message_command_ack(mavlink_message_t *msg)
vehicle_command_ack_s command_ack = {
.timestamp = hrt_absolute_time(),
.result_param2 = ack.result_param2,
.command = ack.command,
.result = ack.result,
.from_external = 1
.from_external = 1,
.result_param1 = ack.progress,
.target_system = ack.target_system,
.target_component = ack.target_component
};
if (_command_ack_pub == nullptr) {