#825: Tracking Wind data over certain amount of time (seconds)#847
Open
#825: Tracking Wind data over certain amount of time (seconds)#847
Conversation
…of X amount of data, and basic tests
… to specify that it's in apparent wind
…ere from a previous implementation
AMaharaj16
reviewed
Mar 7, 2026
| Returns: | ||
| Optional[wcs.Wind]: Average wind object, or None if history is empty. | ||
| """ | ||
| avg_speed = sum(wind.speed_kmph for wind in self.wind_history) / len(self.wind_history) |
Contributor
There was a problem hiding this comment.
Return none if wind_history is empty before this line or it may cause an error.
AMaharaj16
reviewed
Mar 7, 2026
AMaharaj16
reviewed
Mar 7, 2026
| wind_history (List[wcs.Wind]): History of wind sensor readings | ||
| (Queue with max length WIND_HISTORY_LEN). | ||
| wind_average (Optional[wcs.Wind]): Average of the wind history, used for path planning. | ||
| Updated every time a new wind sensor reading is added to wind_history. |
Contributor
There was a problem hiding this comment.
Make it clear here that the direction for this wind object is in degrees.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
wind_historyandwind_averageas fields in theLocalPathclass to store valuesupdate_wind_historyfunction that adds the newest wind reading to wind_history_calculate_average_windhelper function to updatewind_average's speed (kmph) and direction (deg) every time a new wind reading is added in wind_historyBehavior
Verification
test_local_path.pyResources
https://en.wikipedia.org/wiki/Circular_mean