Skip to content

#825: Tracking Wind data over certain amount of time (seconds)#847

Open
MilcToast wants to merge 10 commits intomainfrom
MilcToast/track-wind-data-825
Open

#825: Tracking Wind data over certain amount of time (seconds)#847
MilcToast wants to merge 10 commits intomainfrom
MilcToast/track-wind-data-825

Conversation

@MilcToast
Copy link
Contributor

Description

  • added wind_history and wind_average as fields in the LocalPath class to store values
  • created update_wind_history function that adds the newest wind reading to wind_history
  • created _calculate_average_wind helper function to update wind_average's speed (kmph) and direction (deg) every time a new wind reading is added in wind_history

Behavior

  • To account for the circular nature of angles (i.e. the average of -170 degrees and 170 degrees is 180, and not 0), we use the formula for the circular mean:
image

Verification

  • tests in test_local_path.py

Resources

https://en.wikipedia.org/wiki/Circular_mean

@MilcToast MilcToast requested a review from AMaharaj16 March 7, 2026 08:28
@MilcToast MilcToast added the path Pathfinding team label Mar 7, 2026
@MilcToast MilcToast requested a review from SPDonaghy March 7, 2026 08:29
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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Return none if wind_history is empty before this line or it may cause an error.

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Make it clear here that the direction for this wind object is in degrees.

@MilcToast MilcToast requested a review from AMaharaj16 March 8, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

path Pathfinding team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PATH: Conditions to switch paths -> track wind data over 10 minutes

2 participants