SnakeSkin: Team 401 Robot Framework
SnakeSkin was our primary focus over the 2017 offseason. SnakeSkin is a Kotlin framework that provides a DSL to organize robot subsystems and components. It consists of three modules (Core, FRC, and CTRE), allowing the user to pick only the components that they need.
SnakeSkin-Core is platform independent and provides most of the base functionality, including a state machine based subsystem model (based on 254's 2016 design), as well as many utility classes (such as a fully thread-safe PIDF controller, simple low pass filter, etc.)
SnakeSkin-FRC provides the majority of features for an FRC robot, such as access to joysticks (several mappings created so far, as well as the ability to create your own), autonomous scheduling, and sensors.
SnakeSkin-CTRE provides compatibility and drop-in replacements for CTRE’s Phoenix framework, including the “drivetrain model” for organizing motor controllers, and integrates with SnakeSkin’s auto executor.
In terms of overhead, SnakeSkin has a very low impact (CPU usage for the user code process measured around 4% on an empty project). SnakeSkin makes heavy use of the Java Executor framework to allow flexibly timed tasks to be executed reliably and concurrently. While SnakeSkin is (we think, at least) stable for competition use, we do plan to add more features in the near future including better logging and power management.
The introductory Gitbook covers setup, subsystems, and state machines.