This week, I implemented the physics of the ball collisions and helped to build the pool table structure. Most of the week was spent reading and understanding the different physics libraries, and even playing pool games to see if the different calculations were right. I will go through some of the math involved in my physics implementation that we are using.
Using the principles of conservation of momentum and conservation of kinetic energy, we realized that the trajectory of the balls upon collision will always move away at 90 degrees from each other. This assumes that the balls have equal mass and that no energy is lost to sound and heat, meaning it is an elastic collision. It turns out that most of the time, the effects of sound and heat are negligible, as we took ten videos that verified the balls moved away at 90 degrees. With that in mind, we used that to code the physics trajectory model.
Our group also met yesterday and spent quite a bit of time assembling the pool table. Initially, we realized that our shelves were slightly smaller than our pool table, but we managed to eventually find a way to unscrew some parts of the pool table and managed to assemble the pool table onto the shelf. We managed to also place both a phone camera and the projector on top, and took some videos to test our detection models. The arrival of these parts have become a significant step to helping us achieve our goal.
I am slightly behind schedule for whatever I wanted to accomplish. I managed to implement the mathematics of the ball collisions, but I have not managed to show the outputs onto opencv. This is mainly because the ball and cue detection models that we have now are not that accurate, thus, it is difficult for me to simulate the physics trajectory with the ball. Hence, I spent a lot of time trying to correct the accuracy of these models and have not managed to render the trajectory images. However, I am planning to have a simulation image so that I can at least show the trajectory prediction is correct by tomorrow.
Here is an image of our completed frame.