Coding robots in Scala?! Team 846 Code Release

Team 846 is proud to present its 2017 code base for our robot Punk Monkey. Check it out at https://github.com/team846/code-2017/.

This year, our team made the switch to the Scala programming language, which has a unique combination of functional and object oriented programming and includes many concepts that make it easy to improve compile-time safety without introducing boilerplate.

As part of our switch, we developed Potassium (https://github.com/team846/potassium), an open-source framework for writing robot software. Potassium features a unique stream-based model for writing controllers that makes it possible to define graph structures for control algorithms with familiar collections APIs that can be optimized at runtime. Potassium also includes a commons and FRC module that makes it easy to get started with common subsystems like drivetrains and flywheels (our drivetrain code this year was under 75 lines of code!). Potassium also includes modules for remote communication with co-processors and vision processing through OpenCV.

In addition to supporting the default method of running Scala on the JVM, Potassium supports Scala Native, an experimental Scala to LLVM compiler that allows us to compile our robot code into ahead-of-time optimized native binaries. While Scala Native support for Arm/32bit systems is still in the works, we have already gotten it working on the roboRIO!