Can someone link a good example of autonomous code?

we’re using pathweaver to generate paths and I have a general understanding of how the code works but I’m still missing a few things. If someone could link somewhere with really good example code that would be great. I’m really looking for how everything is structured in the code. Thanks!

Did you look at the WPILib Example Projects? Gearsbot is a pretty good example of auto using the new Command framework.

This is our first year doing autonomous but we got it working and mainly we just followed the tutorial FIRST provides here.

You can view the example code from the tutorial on github here.

When we got it working eventually, we released our repo publically here. Our code runs PID on the talons instead of on the roborio, and uses a navx and 2 grayhill encoders (1024 ticks per rev but with gearing) to track its position.

1 Like

Oh yes, if the question is how to drive the path from Path Weaver, that’s another topic. I agree the WPILib docs are the best place to start, go through the Trajectory Tutorial step-by-step.

Here is WPILibs example for running trajectories.

There are several other topics on this if you search for the right terms. Try “trajectory” or “ramsetecommand”.

How ironic, that’s exactly what my team does :stuck_out_tongue:
I wrote most of that code so ping me if you have questions.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.