Implemented has_ball assumption using the last time the ball was seen and a sampling time
Separated chunks of conditionals for future refactoring
Implemented logic as follows:
If ball was found, the ball distance is less than 20 cm, the last time the ball was seen is less than 20 ms and the ball angle from the frame of the robot is between -20 and 20 degrees → has_ball = true
Implemented goal scoring as follows:
If has_ball = true, the goal was found and the distance towards the goal is less than 30 cm → shoot
When false → move closer towards goal
Note that constants from logic implementation and PIDs can be improved
Changes made
has_ball
assumption using the last time the ball was seen and a sampling timeIf ball was found, the ball distance is less than 20 cm, the last time the ball was seen is less than 20 ms and the ball angle from the frame of the robot is between -20 and 20 degrees →
has_ball = true
If
has_ball = true
, the goal was found and the distance towards the goal is less than 30 cm → shoot Whenfalse
→ move closer towards goalNote that constants from logic implementation and PIDs can be improved
Issue ticket number and link
Refers to issue #34 and #33