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:
José Roberto de Souza
2017-07-13 16:37:28 -07:00
committed by Lorenz Meier
parent dddac6c85a
commit 66170d1c01
+1 -1
View File
@@ -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()) {