UBC-Thunderbots / Software

Robot Soccer Playing AI
http://www.ubcthunderbots.ca
GNU Lesser General Public License v3.0
47 stars 98 forks source link

Estimate ball trajectory #2988

Open nimazareian opened 10 months ago

nimazareian commented 10 months ago

Description of the task

Currently we estimate ball's trajectory by assuming constant velocity, ignoring the sliding and rolling frictions of the ball. We should look into creating a new class which generates a realistic trajectory for the ball. This could help with a more accurate rolling/chip ball interception

https://github.com/UBC-Thunderbots/Software/blob/fe5f224d7ca35f4ed443108603995fb6e51a709a/src/software/ai/hl/stp/tactic/dribble/dribble_fsm.cpp#L27-L28

Should also probably update and use Ball::estimateFutureState instead for interception calculations so we dont have multiple implementations https://github.com/UBC-Thunderbots/Software/blob/e8b08390284d306471a812dec5dee14b4951b2d7/src/software/world/ball.cpp#L62

Could likely update PassDefenderFSM::interceptBall to use a unified interception calculation using the ball trajectory https://github.com/UBC-Thunderbots/Software/blob/448661a55e28d885788d0a73332db1c68ec37375/src/software/ai/hl/stp/tactic/pass_defender/pass_defender_fsm.cpp#L55

Other teams such as Tiger's support estimating the ball trajectory when it's rolling and when it's chipped.
https://github.com/TIGERs-Mannheim/Sumatra/blob/259774013fe5fef0c5eeff46db5f04c3f7d61f56/modules/common/src/main/java/edu/tigers/sumatra/ball/trajectory/chipped/ChipBallTrajectory.java#L32

https://github.com/TIGERs-Mannheim/Sumatra/blob/cb8ea325f3e5a1dcc719415fe697108e4705c8b7/modules/common/src/main/java/edu/tigers/sumatra/ball/trajectory/flat/FlatBallTrajectory.java#L31

I believe Zjunlict's TDP from a few years ago (and er forces 2016 TDP) also included some of their testing for ball trajectory estimation which we incorporated in our fork of ErForce sim in #2653.

Acceptance criteria

nimazareian commented 3 months ago

Another place which should be updated is:

https://github.com/UBC-Thunderbots/Software/blob/f0efeafbb0b4ac14bbe108c75384d37cab2493d0/src/software/ai/passing/pass.cpp#L52-L56