A Deep Dive into WPILib Trajectories

WPILib has a new trajectory generator and followers, and lots of documentation on how to use them. Unfortunately, there aren’t any accessible resources on how everything works under the hood. My team and I used a similar trajectory solution last season (both are based on 254’s 2018 code) , so I thought I would take a whack at making a compelling, accessible introduction to this guts of this subject. This presentation goes in-depth enough to give you a high-level understanding of the important tradeoffs and inner workings of this trajectory generator, while still being at a level that is accessible to non-experts.

My animated slideshow, which runs a JavaScript port of the generator, can be found here.

A video of my presentation is embedded below (if you want to skip the history and context section, go to 6:26):

Not including questions at the end, the presentation is about 35 minutes.

16 Likes

I’m super excited about the upcoming changes to WPILib’s kinematic libraries, and look forward to testing this out this season! Is there a bit of documentation we can browse to understand how to use these new features? A lot of what is covered in the video above is very useful for understanding the ultimate behavior, but I’m not quite sure of where to get started.

2 Likes

There is documentation for the new kinematics, odometry, and trajectory generation classes. A complete tutorial for “zero to tracking trajectories” will be coming soon to the documentation website as well.

There is also a full example in the wpilib repository. That is available here: https://github.com/wpilibsuite/allwpilib/tree/master/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/ramsetecommand

2 Likes

We recently got WPILib’s trajectory generator working with out 2019 robot, it’s been great! Thanks for throwing this together, we’ll definitely be using it to teach our programmers that it’s not just a magic black box.

1 Like

I’m working on “end-to-end” documentation for characterization-through-path-following - it’s next up on my plate right after I finish the new PIDController/motion profile/feedforward component docs (those are about 70% done). I’d say no more than two weeks until the PR is submitted to frc-docs; hopefully it doesn’t get held up in review for too long.

2 Likes

I, too, hope it will not :slight_smile:

2 Likes