Supporting functions are mid-level function used by high-level planners that take strategic decisions for a specific robot or the whole team. All logic inside this module can be seen as a library of functions that focus on interpreting the environment rather than providing strategic decisions.
Inside supporting functions, we can distinguish two groups:
- Capture the ball: set of functions to predict the ball movement without players interactions
- Kick the ball: set of functions to provide information on where the ball can be passed safely or if the goal can be scored.
The basic information about a freely moving ball (without any player in action range) is when and where the ball will hit the field side. This information is essential for more complex logic like an estimation if any player can get to the ball before it gets to the field side.
Assumptions: The ball is moving with uniform linear motion
Inputs: Ball state, field size
Output: Time when the ball hits the field side
If the ball velocity is zero: return infinity
Else: calculate the distance along the trajectory to the end of the field and divide by velocity