mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 14:33:35 +08:00
vehicle_command topic: use uorb queuing with length 3
Just to make sure we don't lose any messages.
This commit is contained in:
@@ -302,9 +302,14 @@ void InputMavlinkCmdMount::_ack_vehicle_command(uint16_t command)
|
||||
vehicle_command_ack.command = command;
|
||||
vehicle_command_ack.result = vehicle_command_s::VEHICLE_CMD_RESULT_ACCEPTED;
|
||||
|
||||
int instance;
|
||||
orb_publish_auto(ORB_ID(vehicle_command_ack), &_vehicle_command_ack_pub, &vehicle_command_ack,
|
||||
&instance, ORB_PRIO_DEFAULT);
|
||||
if (_vehicle_command_ack_pub == nullptr) {
|
||||
_vehicle_command_ack_pub = orb_advertise_queue(ORB_ID(vehicle_command_ack), &vehicle_command_ack,
|
||||
vehicle_command_ack_s::ORB_QUEUE_LENGTH);
|
||||
|
||||
} else {
|
||||
orb_publish(ORB_ID(vehicle_command_ack), _vehicle_command_ack_pub, &vehicle_command_ack);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void InputMavlinkCmdMount::print_status()
|
||||
|
||||
@@ -75,7 +75,8 @@ int OutputMavlink::update(const ControlData *control_data)
|
||||
orb_publish(ORB_ID(vehicle_command), _vehicle_command_pub, &vehicle_command);
|
||||
|
||||
} else {
|
||||
_vehicle_command_pub = orb_advertise_queue(ORB_ID(vehicle_command), &vehicle_command, 3);
|
||||
_vehicle_command_pub = orb_advertise_queue(ORB_ID(vehicle_command), &vehicle_command,
|
||||
vehicle_command_s::ORB_QUEUE_LENGTH);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user