Move Vehicle Command Result Enum defs to Vehicle Command Ack (#19729)

- As it is always only used for the vehicle command ack message
- It was a duplicate, hence making it error prone for maintainment
- The uORB message comments were updated to make the relationship with
the MAVLink message / enum definitions clear
This commit is contained in:
Junwoo Hwang
2022-07-07 16:15:11 +02:00
committed by GitHub
parent af4038aa7e
commit 32ae00fd44
23 changed files with 212 additions and 209 deletions
+6 -6
View File
@@ -360,7 +360,7 @@ void InputMavlinkCmdMount::_ack_vehicle_command(const vehicle_command_s &cmd)
vehicle_command_ack.timestamp = hrt_absolute_time();
vehicle_command_ack.command = cmd.command;
vehicle_command_ack.result = vehicle_command_s::VEHICLE_CMD_RESULT_ACCEPTED;
vehicle_command_ack.result = vehicle_command_ack_s::VEHICLE_CMD_RESULT_ACCEPTED;
vehicle_command_ack.target_system = cmd.source_system;
vehicle_command_ack.target_component = cmd.source_component;
@@ -729,7 +729,7 @@ InputMavlinkGimbalV2::_process_command(ControlData &control_data, const vehicle_
break;
}
_ack_vehicle_command(vehicle_command, vehicle_command_s::VEHICLE_CMD_RESULT_ACCEPTED);
_ack_vehicle_command(vehicle_command, vehicle_command_ack_s::VEHICLE_CMD_RESULT_ACCEPTED);
return update_result;
} else if (vehicle_command.command == vehicle_command_s::VEHICLE_CMD_DO_MOUNT_CONFIGURE) {
@@ -763,7 +763,7 @@ InputMavlinkGimbalV2::_process_command(ControlData &control_data, const vehicle_
}
}
_ack_vehicle_command(vehicle_command, vehicle_command_s::VEHICLE_CMD_RESULT_ACCEPTED);
_ack_vehicle_command(vehicle_command, vehicle_command_ack_s::VEHICLE_CMD_RESULT_ACCEPTED);
return UpdateResult::UpdatedActive;
} else if (vehicle_command.command ==
@@ -828,7 +828,7 @@ InputMavlinkGimbalV2::_process_command(ControlData &control_data, const vehicle_
}
}();
_ack_vehicle_command(vehicle_command, vehicle_command_s::VEHICLE_CMD_RESULT_ACCEPTED);
_ack_vehicle_command(vehicle_command, vehicle_command_ack_s::VEHICLE_CMD_RESULT_ACCEPTED);
if (new_sysid_primary_control != control_data.sysid_primary_control ||
new_compid_primary_control != control_data.compid_primary_control) {
@@ -861,7 +861,7 @@ InputMavlinkGimbalV2::_process_command(ControlData &control_data, const vehicle_
_set_control_data_from_set_attitude(control_data, flags, q, angular_velocity);
_ack_vehicle_command(vehicle_command,
vehicle_command_s::VEHICLE_CMD_RESULT_ACCEPTED);
vehicle_command_ack_s::VEHICLE_CMD_RESULT_ACCEPTED);
return UpdateResult::UpdatedActive;
@@ -871,7 +871,7 @@ InputMavlinkGimbalV2::_process_command(ControlData &control_data, const vehicle_
vehicle_command.source_component,
control_data.sysid_primary_control, control_data.compid_primary_control);
_ack_vehicle_command(vehicle_command,
vehicle_command_s::VEHICLE_CMD_RESULT_DENIED);
vehicle_command_ack_s::VEHICLE_CMD_RESULT_DENIED);
return UpdateResult::UpdatedNotActive;
}