Skip to content

mavutil: Do not use unknown messages to calculate number of lost packets#891

Merged
tridge merged 1 commit intoArduPilot:masterfrom
Winjeel:pr/calculate-lost-packets
Dec 20, 2023
Merged

mavutil: Do not use unknown messages to calculate number of lost packets#891
tridge merged 1 commit intoArduPilot:masterfrom
Winjeel:pr/calculate-lost-packets

Conversation

@joshanne
Copy link
Contributor

Found this one when adding a custom mavlink message.
The decoding of the packet affects the mav_loss calculation because the unknown message does not have its header populated.

To a user, this could appear as though the vehicle radio link is intermittent/bad.

@nexton-winjeel
Copy link
Contributor

nexton-winjeel commented Dec 19, 2023

Just to clarify what @joshanne said:

  • Previously, if a message is unknown in pymavlink, it gets constructed into a dummy message with the sequence number (seq) set to 0.
  • The number of lost messages is calculated as the difference between the sequence number of the previous message and the sequence number of the current message.
  • With the unknown message having a sequence number always set to 0, the number of lost messages is incremented by an average of 128 for every unknown message received.

With this change, the number of lost messages will increment by 1 for each unknown message received.

@tridge tridge merged commit 6216586 into ArduPilot:master Dec 20, 2023
@tridge
Copy link
Contributor

tridge commented Dec 20, 2023

good find, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants