In high school I participated in VEX robotics competitions, in which teams from other schools would compete under various challenges. I worked on a team with my friend to design robots with advanced software.

 

2015-16: Nothing But Net

Nothing But Net was a competition in which robots had to be designed to launch foam balls placed throughout the play field into net baskets about a yard off of the ground.

Our team at the time had a third member who pushed the use of some calculus to turn our robot into something that could operate practically entirely autonomously. First, we used motor incoders and integration to estimate the robot's position in the playing field, achieving accuracy to the nearest inch. The robot's coordinates were then used to estimate the necessary power (RPM) for the ball launcher to successfully score a basket. Feeding the launcher was an automatic ball intake system which would pull balls in front of the robot into a central lift. The lift had either an ultrasonic sensor or a limit switch to detect when balls were at the top of the lift, ready to be fired.

Finally, the central lift and launcher were built on top of a rotating joint, allowing the launcher to automatically aim at the basket based on its field position. The result was a system that could collect, aim, and launch balls into the scoring basket with only a few button presses from the driver.

In fact, the robot was designed to be operated by two drivers. The primary driver would navigate the robot through the field to collect balls (or be on defense to prevent the opposing team from scoring). The secondary driver had control over the robot's autonomous systems with the ability to enable them, disable them for a manual override, or adjust parameters to account for any variable drifts during a match.

The front ball intake had two different designs during the season. The photo above shows a tread design that would scoop up balls that the robot drives over; a second design used spinning rubber bands to grab balls instead:

 

Some version of our code for this robot can be found here. It may be revisited in the future for code clean-up or documentation.

2016-17: Starstruck

Starstruck was a competition in which large foam stars and heavy cube bags were placed throughout the field. A fence divided the two teams' sides, and the goal was to move as many stars and cubes as possible to the other team's side.

In the previous year, we used PROS, a framework for writing robot code in native C/C++. However, for Starstruck my team opted for ConVEX, a low-level VEX firmware library based on the popular real-time operating system ChibiOS/RT.

Our robot took a simple design, consisting of a tall lift with a claw at the top. The lift used motors with internal encoders to allow position-setting based on encoder value. This allowed for simpler and more reliable user control as compared to only messing with motor speeds (what most other teams did).

Unlike previous years we switched to C++ from C, mainly for better code organization. We were also able to utilize atomic objects for communicating between different threads; lift control and controller input were handled on separate threads for improved performance.

A version of our code can be found here. I may revisit it to clean things up or add additional documentation.