Linear Regression - Bounce Trajectory 2
Hi, In the previous method, I described a method for handling bounce trajectories using Linear Regression. Below is an image showcasing another way to predict a bounce without swapping the axis and the need of creating new coordinates from the point that the slope intercepts the Y-axis. Code explained: 1. Calculate slope between atleast two points, as soon as the puck changes direction and is moving towards the ABB. 2. Using the slope, I predict the y position of the puck at the centre of the table. 3. If the prediction is greater than the table height,the error is calculated. 4. A new trajectory called Yc is created by reflecting the error from the end of the table. Video of two softbots playing with each other using two different methods Immanuel