FIRST is an international organization that operates robotics competitions for grade-school students. Their most popular is the FIRST Robotics Competition (FRC), which takes place every January. Thousands of students spend 10 weeks with their teams building a 125-lb robot to play a 3 vs. 3 game that changes every year. The students are encouraged to use 3D printing, metalworking techniques, CAD, and Java programming to design and build their robots.
Although I'd been on a robotics team in high school, we competed in the smaller FIRST Tech Challenge (FTC) competition. When I moved to Pittsburgh recently, I wanted to pass on the robotics knowledge I had gained and sought out a local FRC team: Sarah Heinz Advanced Robotics Program (Team SHARP) based out of the Sarah Heinz House located in the North Side of Pittsburgh.
I took a keen interest in understanding the programming team's major challenges and quickly learned that their biggest hurdle every year was lack of time with the robot because the hardware design took a lot of time. This had led to flaky software in the past and no time to tackle more complex logic.
Leveraging my industry experience, I explained to the team that we could build a simulation of the robot to experiment until the real robot was finished. We set to work and ultimately built something resembling a videogame that helped springboard the programming team in the 2020 season. Check out the results on our GitHub.
The system works as three separate modules communicating over fast UDP using JSON. The first mimics an Xbox controller (so the students wouldn't always be forced to share a real one), the second runs their custom Java code, and the third runs the physics simulation of the robot and field. For the physics simulation, I chose to use OpenSceneGraph for lightweight 3D visualization and Box2D for the physics.
Just a few weeks later, the simulator solved an unforseen problem: after the pandemic hit, unfortunately all the FRC competitions were canceled for the year and Team SHARP didn't get to compete at all. The students still yearned to meet and continue working on the robot, especially over the summer, but could not use the lab—so I launched an online lab using the simulator!
To teach the students about autonomous robotics, I added a simulated LIDAR to the physics simulation. Over 10 short weeks over the summer, we built a highly sophisticated AI that could distinguish robots from balls on the field, collect and score balls, and avoid hitting other robots without any human intervention. We shared our results with the rest of the community to some amazing feedback. The students are continuing to use the code and are planning to purchase a $100 LIDAR with the same specs as the simulated one to attempt to automate their gameplay in 2021.