Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate latency, receive uplink RSSI, calculate bandwidth congestion and packet rate #492

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

gemenerik
Copy link
Member

@gemenerik gemenerik commented Oct 22, 2024

Continuation of #480 and #477

🚀 Features

Introduces a framework for link statistics, enabling the tracking of various metrics, starting with latency measurement.

  • LinkStatistics Class: A new class to manage multiple types of link statistics, facilitating the addition of more metrics in the future.
  • Latency Measurement: A dedicated Latency class is introduced to send periodic ping requests to the Crazyflie. It calculates the round-trip latency and maintains the 95th percentile (p95) latency over recent measurements.

Refactors link quality callback to contain signal health obj with additional signal health information:

  • Uplink RSSI parsed from ack
  • Bandwidth congestion calculated using null packet ratio
  • Packet rate

📝 To-do

The implementation improves the lib's ability to monitor communication quality and lays the groundwork for further enhancements in link statistics.

gemenerik and others added 16 commits September 25, 2024 17:15
- Moved latency measurement from the radio driver to a new Latency class for better organization and readability.
- Generalized the LinkStatistics class to allow for easy addition of other link statistics in the future.
In a valiant attempt to appease the relentless gods of autopep8 and the all-seeing eyes of CI, I embarked on an epic journey to fix double-quoted strings and reorder imports.
- Modified start() and stop() methods for better thread management.
- Implemented thread reinitialization on start after stop.
- Refactor link quality callback to contain signal health obj with additional signal health information
- Parse uplink RSSI in ack into signal health obj
Return a dictionary with all updated signal quality statistics in the callback, rather than the entire class.
@gemenerik gemenerik linked an issue Oct 22, 2024 that may be closed by this pull request
Renamed SignalHealth class to RadioLinkStatistics to better reflect its responsibility of handling and processing radio-specific metrics.
@gemenerik
Copy link
Member Author

gemenerik commented Oct 22, 2024

In the last commit, I renamed the SignalHealth class to RadioLinkStatistics to better represent its focus on metrics specific to the radio communication, such as RSSI. This class exists to measure parameters at the driver level, as metrics like congestion require direct access to the radio driver, while latency can be measured through packet exchanges.

I also want to bring up the consideration of feeding data from RadioLinkStatistics into the general LinkStatistics. This approach could enhance user clarity by centralizing all link-related metrics in one place. However, keeping them separate might maintain clearer responsibilities and modularity. This is something we might want to discuss further as we refine the implementation.

- Move radio link statistics into (universal) link statistics object
- Stop updating radio link statistics from callbacks if stop is called on link statistics. User probably will expect this behavior.
- Deprecation warning on calling link_quality_updated directly. Proxy call to link_statistics.link_quality_updated until removal.
These generally should be visible and fixed.

+ fix deprecated setDaemon warnings
@gemenerik gemenerik marked this pull request as ready for review December 5, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Implement quality stats
2 participants