Posts

Showing posts from March 3, 2019

Trajectory Prediction - Linear Regression

Image
Hi, If I know the coordinate of the puck within a period of time, I can calculate the change of the puck's y-coordinate in respect to its x-coordinate. Plotting multiple puck's positions in a graph shows the puck's direction of travel and most importantly, I can estimate a future position using the line of best fit, also called regression line. Below is an example of how I can predict the trajectory of the puck using equation: Y = mX + b Where; Y = mean of all y-coordinates X = mean of all x-coordinates m = slope of the line b = intercept point of line in the Y-axis Applying the knowledge gained of calculating linear regression using the least-square method and wonderful tutorials online, I have created a function to calculate m and b to predict a y-coordinate given an x-coordinate. Video of softbots playing with each other using two different methods The video below shows the paddles moving autonomously. Note that the paddle on the left i

Following the puck's y-coordinate

Image
Hi, This week I have explored ways to defend the robot's goal. I have followed a tutorial to create a game using the turtle module on Python. The tutorial is a two-player pong game that uses keyboard keys to move the paddle. Click here to view the tutorial. I have amended the tutorial to program the paddles to move autonomously. Video of two softbots following the ball and playing with each other The video above shows two softbots playing with each other. I programmed the paddles to follow the y-coordinates of the ball and move accordingly. Although, this is not trajectory prediction, it is a plausible solution to defend the robot's goal. However, with all robotic systems in simulation and the physical world, I expect that the robot will not be able to move in relation to the speed of the ball. I have to explore a method to predict the location of the ball in the y-axis given an x-coordinate to avoid moving the robot when it is not needed. Immanuel