Skip to content

tools: Add stats menu and widget, with rate and totals around incoming/outgoing messages#1911

Open
rafaellehmkuhl wants to merge 4 commits intobluerobotics:masterfrom
rafaellehmkuhl:add-io-info
Open

tools: Add stats menu and widget, with rate and totals around incoming/outgoing messages#1911
rafaellehmkuhl wants to merge 4 commits intobluerobotics:masterfrom
rafaellehmkuhl:add-io-info

Conversation

@rafaellehmkuhl
Copy link
Copy Markdown
Member

@rafaellehmkuhl rafaellehmkuhl commented May 26, 2025

New Features

Name Description Purpose Sources Future
Tools / Stats Helps the user know whether Cockpit is sending/receiving MAVLink messages Troubleshooting This is a start - in future it could include more information sources, and/or display things in more intuitive ways.
Stats mini-widget Tools / Stats, but in mini-widget form Live connection monitoring
Kapture.2025-05-26.at.17.26.49.mp4
Kapture.2025-05-26.at.18.06.30.mp4

Modified Features

Setup

  • Autopilot connection (MAVLink)
    • Allows peace of mind checking that messages are being sent and received, and/or helps determine which direction a connection is failing in if it is not working properly

Vehicle usage

  • Connection stability
    • Significant message rate changes can indicate connection instability when it is not lost for long enough to be considered disconnected
  • MAVLink message monitoring
    • MAVLink-specific variant of connection stability point

Tests Required to Merge (by dev and/or testers)

Text/display changes

  • Open Cockpit
  • Confirm the change displays as expected
  • Test multiple screen sizes
    • Steam deck
    • 1080p laptop screen

Functionality changes

  • Connect to the vehicle
    • Connect a joystick, and confirm at least one button and one axis works
  • Confirm existing widgets load as expected
  • Check that memory usage seems bounded
  • Test critical vehicle functions
    • Arm and disarm
    • Switch flight modes
  • Switch users without unexpected errors

@rafaellehmkuhl rafaellehmkuhl changed the title tools: Add stats menu with rate and totals around incoming/outgoing messages tools: Add stats menu and widget, with rate and totals around incoming/outgoing messages May 26, 2025
Copy link
Copy Markdown
Contributor

@ArturoManzoli ArturoManzoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's visually very nice

I noticed on the code a number of comments that is way larger than usual.
Some of these comments are a little redundant with the function names and some are describing elements that would be ok without a comment.

Can you review them?

@rafaellehmkuhl rafaellehmkuhl force-pushed the add-io-info branch 4 times, most recently from a246114 to 83d302e Compare May 30, 2025 20:32
@rafaellehmkuhl
Copy link
Copy Markdown
Member Author

It's visually very nice

I noticed on the code a number of comments that is way larger than usual. Some of these comments are a little redundant with the function names and some are describing elements that would be ok without a comment.

Can you review them?

Removed some of them that appeared to be unnecessary. Let me know if there are any others that you think should be removed as well.

@rafaellehmkuhl
Copy link
Copy Markdown
Member Author

ping @ArturoManzoli

Copy link
Copy Markdown
Contributor

@ES-Alexander ES-Alexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the potential of this page. It seems to quite naturally extend to including things like network latency, video stream stats, and tether diagnostics (maybe an API would be useful?) :-)


From some light testing, this seems to mostly work as expected, except that the MAVLink time-related stats seem poorly determined - they're frequently showing up as negative (e.g. the message was received more recently than the "current time" timestamp it's being compared to):

Screenshot 2025-11-06 at 6 21 32 am

@rafaellehmkuhl
Copy link
Copy Markdown
Member Author

I like the potential of this page. It seems to quite naturally extend to including things like network latency, video stream stats, and tether diagnostics (maybe an API would be useful?) :-)

From some light testing, this seems to mostly work as expected, except that the MAVLink time-related stats seem poorly determined - they're frequently showing up as negative (e.g. the message was received more recently than the "current time" timestamp it's being compared to):

Screenshot 2025-11-06 at 6 21 32 am

Unfortunately this is a problem in mavlink2rest itself. If you open it's frontend, you will see the same values.

@patrickelectric any idea on that?

@ES-Alexander ES-Alexander added the docs-needed Change needs to be documented label Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-needed Change needs to be documented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants