SpartanLib2

Hello all! The software team of FRC 997 has made some fantastic leaps over this offseason. Hopefully this year we do more than just barely getting the robot to work, and actually make our software and electrical teams be a force to improve our robot.

The biggest effort we’ve gone through has been the development of a library of robot code, with a fair amount of help from our fantastic @ianran. We’re proud to release SpartanLib2 (it’s been open source this whole time but still…):

FEATURES:
Currently released and ready to use:

  • Custom motion profile generation implementation (asymmetric acceleration and deceleration) (this was a massive pain)
  • Custom PID controller implementation (expanded control over integration and differentiation)
  • A family of Commands meant specifically for calling subsystem methods (to avoid bloat as every simple command gets its own verbose file)
  • Differential drivetrain operation modes (abstraction around arcade, curvature/cheezy, etc to make switching for different drivers easy)
  • Xbox controller wrapper/ joystick axis and button objects
  • Large collection of pre-implemented filters
  • Central logging class for environment information/ RoboRio information
  • Object-oriented approach to logging implemented with Java generic types
  • Large collection of utility math methods

Currently in late dev (release targeted for kickoff or the week after):

  • Custom spline generation (cubic hermite/ cardinal/ Catmull-Rom)
  • Dijkstra’s graph traversal algorithm (and spatial case)
  • Abstraction for addressable LED strips, modular support for custom animations, and pre-built animations
  • Simple linear regression, polynomial linear [sic] regression (with Apache Commons Math 3)
  • Linear, polynomial, and harmonic interpolation (also Apache Commons Math 3)
  • Forward and inverse kinematics for revolute-revolute, prismatic-revolute, and revolute-prismatic 2-dof manipulators, as well as another layer of feedforward for these
  • Input mapping modes, similar to the differential drivetrain operation modes already done
  • Configuration-space motion planning for multi-dof mechanisms using Dijkstra’s algorithm

Future plans (no timeline):

  • Hardware API wrappers for standardization/ sim
  • Whatever comes up

The entire project has full javadocs, which can be found here:
https://javadoc.io/doc/org.chsrobotics.lib/spartanLib2/latest/index.html

We have a github wiki, but at this point it’s empty. The plan is to add a basic catalog of the library (especially the UtilityMath class because it’s like 450 lines in a few of the dev branches), and some example usage.

Hopefully somebody out there finds this useful/ helpful!
Suggestions/ feedback of course welcome as well.

4 Likes