Caspar Chen

Back to selected work

Competitive robotics

VEX robotics · C++

C++ for competitive VEX robots. Virtual Skills State Champion and World Finalist.

What the code does

Odometry keeps track of where the robot is on the field by adding up small movements from its sensors. Autonomous routines use that position to follow a path. PID control handles the last part, correcting the gap between where the robot is and where it is supposed to be.

Competition

In VEX we were Virtual Skills State Champion and a World Finalist. The competition code for High Stakes is on GitHub.

Software and hardware

The code depends on the physical robot, including things like wheel size and where the sensors sit. The software and the robot's design had to be worked out together.

What goes wrong

Wheels slip, and odometry errors add up over a run. A path that looks right in the plan can end up somewhere else on the field. The drawing above shows that gap.

(0,0)field · 6 × 6 tiles123goalstartwheel slip, onceΔplanneddroveend errorPIDovershoot, settleΔ: where the plan andthe field disagreed
A planned path, the path actually driven, and the gap between them. Illustration, not data.
A person crouching at the edge of a VEX robotics field, a robot and scattered rings on the grey tiles beside him.
At a VEX field.