stop ignoring Wmissing-field-initializers and fix (#9912)

This commit is contained in:
Daniel Agar
2018-07-22 12:45:52 -04:00
committed by GitHub
parent fc65939f0e
commit b1d3bb0403
21 changed files with 271 additions and 423 deletions
@@ -363,16 +363,12 @@ VtolAttitudeControl::handle_command()
// This might not be optimal but is better than no response at all.
if (_vehicle_cmd.from_external) {
vehicle_command_ack_s command_ack = {
.timestamp = hrt_absolute_time(),
.result_param2 = 0,
.command = _vehicle_cmd.command,
.result = (uint8_t)vehicle_command_ack_s::VEHICLE_RESULT_ACCEPTED,
.from_external = false,
.result_param1 = 0,
.target_system = _vehicle_cmd.source_system,
.target_component = _vehicle_cmd.source_component
};
vehicle_command_ack_s command_ack = {};
command_ack.timestamp = hrt_absolute_time();
command_ack.command = _vehicle_cmd.command;
command_ack.result = (uint8_t)vehicle_command_ack_s::VEHICLE_RESULT_ACCEPTED;
command_ack.target_system = _vehicle_cmd.source_system;
command_ack.target_component = _vehicle_cmd.source_component;
if (_v_cmd_ack_pub == nullptr) {
_v_cmd_ack_pub = orb_advertise_queue(ORB_ID(vehicle_command_ack), &command_ack,
@@ -380,7 +376,6 @@ VtolAttitudeControl::handle_command()
} else {
orb_publish(ORB_ID(vehicle_command_ack), _v_cmd_ack_pub, &command_ack);
}
}
}