Generating Autonomous Routines for Swerve Drive

My team has begun development on a coaxial swerve drive and our programming team is starting work on creating autonomous routines for it. We are looking for related resources for figuring out how to get what we want it to do. We’ve come across Pathweaver, but we are a LabView team and the tutorials from WPILib don’t cover LabView, not to mention I’ve seen some bad things about Pathweaver as well. Are there any other resources we can use? If need be, we can deal with importing DLLs into LabView to run with the code that we already have if it can somehow make life simpler.

Here’s a quick picture of what we used last year, that I believe is fairly representative of what most teams do for trajectory following with swerve drive.

Waypoints are your definition of where you’d like the robot to be, how it should move between those critical points, and what constraints it should have while moving.

Pathweaver and Pathplanner are offboard tools to help you define your waypoints.

The Trajectory is a time-varying pose - that is to say, at any time after the routine starts, you should be able to look up a notion of where the robot is at, and how it should be moving. By looking up the pose at the current time, you get your desired pose.

Separately, we assume there’s sensor feedback from the hardware on the robot. This has to be interpreted in a way that gets you an estimate of where the robot happens to be at on the field at the current time.

The Holonomic Drive Controller is a set of feedback (PID) and feed-forward controllers which take the difference between the estimated position of the robot and the trajectory-defined desired position, and convert it to a set of rotation and translation commands. Same sort of commands a human would be inputting on a set of joysticks if they were in control. The requirement is that the commands must be appropriate to cause the estimated pose to converge to the desired pose.

From there, everything downstream is just “standard” swerve - convert a set of chassis motion commands (rotation, translation) into desired states for each swerve drive module, then send out commands to motor controllers to put each module into the right state.

@JSIMPSO has a ton of resources on github that make up major components of this stack - jsimpso81 (Jim S.) · GitHub would definitely be worth investigating what you want to pull from there, and what you want to implement yourself. The trajectory following tutorial would likely be of particular interest.

Obviously a lot here to dig into, and I’m happy to go into depth on any of the components. Let me know what you need more info on!

3 Likes