Andy Killorin's
website

/ /projects /code /about

FRCrs - Rust in FRC

For the 2024 FRC season, I led Team 2502 in porting our robot code from Java to Rust. This had a number of motivations.

We became the only team to use Rust in 2024 and won the innovation in control award at the Minnesota regional.

barebones test robot running rust

Rust’s killer feature for us is its async support, which is very effective at defining concurrent robot behavior quickly.

async fn shoot(intake: &Intake, shooter: &mut Shooter) {
    wait(|| shooter.get_velocity() > 5400.).await;
    intake.set_rollers(-1.);
    shooter.set_feeder(-1.);
    wait(|| shooter.get_velocity() < 5300.).await;
    shooter.set_feeder(0.);
    intake.set_rollers(0.);
}

This snippet is the entirety of our composable shoot method, which can be called as if it is a blocking method. Using our old Java-based framework, this snippet would need to become its own class with a manually defined state machine.

Since I graduated, this framework has been extended and maintained by other students. Take a look on github.