mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 07:23:34 +08:00
stop ignoring Wmissing-field-initializers and fix (#9912)
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user