Recommendations for Path Following/Trajectory in Time Based

Hi Everyone!

I’m looking to setup a path following system for my teams autonomous. I am tired of bang bang navigation.

Are there any recommendations on code to look at for this? I’m guessing 254’s code is the standard for this? Are there any other examples you’d recommend? I want to implement something high end, its the offseason…we have the time!

Thanks in advance!

1 Like

WPILib has done some great work recently with internal support!

5 Likes

Command Based :frowning:

1 Like

Command-based isn’t required to use WPILib’s trajectory library. I suggest the ramsete controller Java example.

3 Likes

Here is an example using RamseteController to follow a trajectory rather than RamseteCommand, and here is documentation on using RamseteController.

1 Like

Thanks for the reply! I guess I can’t read docs!

This is awesome! Thank you!

@calcmogul @connellsensational

Thanks for the information!

Was the logic adapted from what 254 does? Looks familiar to some of their stuff. I want to implement the highest end stuff possible haha

1 Like

This will give you a pretty big payoff for relatively little work on your end.

One more for the pile - I’d started working through an “all-bells-and-whistles” drivetrain implementation a while back. Here’s the relevant drivetrain code that includes drivetrain control, fed by Autonomous trajectories parsed from .json files which in turn come out of pathweaver. It’s far from the level of 254’s, but should show one particular way of doing trajectory following from wpilib stuff.

also it needs code reviewed so if you don’t like it feel free to rip it to shreds

2 Likes

Here is a really awesome textbook that you might also want to dive into if you really want to get into the high end things.

3 Likes

I would disagree that any one team’s implementation is the standard. I think the WPILib stuff is the “standard” as it is both advanced and accessible. You really don’t want to emulate what the top teams are doing, unless you know that you need that extra level of accuracy (sometimes you won’t even get that) for significant extra work.

I can understand not wanting to implement old or outdated technologies, and can assure you that the WPILib trajectory generation / following isn’t that.

The idea of wanting to implement the highest end stuff possible with no experience, not reading the documentation or theory, and limited time is going to be near impossible. I am not trying to be mean here I just want you to have properly set expectations. This is probably the hardest/most complicated stuff in FRC and it takes significant work!

4 Likes

Didn’t say I have no experience. Not worried about my capabilities. Just figured I would get the right source before I dive in. I don’t need the teaching moment here :slight_smile:

Referring to Ramsete Controller right?

Really my point of this post was to learn from the best… so I guess I am trying to understand…who currently has the best

The “best” at this are almost certainly not doing it in FRC; if you really want to push boundaries you’re going to want to read some actual control theory texts (the one linked above is a good introduction!).

More fundamentally, I think this is a bad way to approach technical learning; you’re placing too much emphasis on the “who” and not enough on the “what.”

Yeah I guess I meant the best in FRC

I don’t think there’s any consensus as to who this really is (it’s been two years since we had any actual competitions, during which the controls landscape has changed considerably), and I don’t think it really matters.

The WPILib tools give you enough to follow paths to within fraction-of-an-inch tolerance - that’s as good a place to start as any, unless there’s something else you want to learn how to do.

1 Like

State-of-the-art is WPILib’s trajectory support, and R&D beyond that would be 604’s kinodynamic trajectory planning (trajectory optimization using CasADi):

I wouldn’t consider it ready for general usage; it works, but the model is kinda jank.

1 Like

Thank you! Good to know!