Posts

Showing posts from March 10, 2019

Linear Regression - Bounce Trajectory 2

Image
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

Linear Regression - Bounce Trajectory 1

Image
Hi, In the previous post, I described a method for predicting a future puck position by using linear regression to calculate the slope between at least two points when the puck passes a specified x-coordinate. This method works well in simulation as the paddle could move instantaneously to intercept the puck at any given time. However, in the real-world, the ABB might not be able to move as quickly or as safely as I would want it to like the simulation. Therefore, instead of predicting the trajectory of a puck when it passes an x-coordinate, a possible solution is to predict as soon as the puck is moving towards the ABB so that the ABB does not have to move as fast. The problem with this method is handling possible bounces when the puck hits the table edges before a point that the ABB can intercept the puck. A possible solution to handle bounce trajectories is shown below. This method works by swapping the axis of the table and finding out the point that the slope interce