mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-18 05:57:34 +08:00
mavlink: Do not miss a vehicle_command
If 2 or more vehicle_command are queued a call to update() will return the oldest vehicle_command and set the _cmd_time to the timestamp of the last vehicle_command queued losing it. Using update_if_changed() fix this causing all item being consumed one at each call of send().
This commit is contained in:
committed by
Lorenz Meier
parent
dddac6c85a
commit
66170d1c01
@@ -461,7 +461,7 @@ protected:
|
||||
struct vehicle_command_s cmd;
|
||||
bool sent = false;
|
||||
|
||||
if (_cmd_sub->update(&_cmd_time, &cmd)) {
|
||||
if (_cmd_sub->update_if_changed(&cmd)) {
|
||||
|
||||
if (!cmd.from_external) {
|
||||
if (_mavlink->verbose()) {
|
||||
|
||||
Reference in New Issue
Block a user