My team have been using the Ramsete Controller with WPILIB’s Trajectory classes to drive our autonomous paths. It works awesome!
I have wondered however:
Is there any functionality built in to then drive the trajectory in reverse? Say I got to the end point of my trajectory, and I want to then backtrack (maybe even in reverse) back to where I came from, as accurate to my original trajectory?
Another concept I’ve thought about, is our autonomous uses a camera to line up to balls. This is probably overkill for most cases because of bang bang reckoning is probably good enough. But I’ve thought about the more advanced concept of tracking movements of robot (when it is driven by a camera based loop), and then being able to backtrack more accurately.
oh wow, cool so you can just reverse the trajectory. Thanks for that. guess I just need to figure out a way to log and create trajectories dynamically.
Here is our bounce path from last year. You just generate the trajectory and then add a setReversed to the trajectory config. Since bounce had forward and reversed paths we used two configs. There maybe some newer ways to construct this all since last year fair warning. The path waypoints are in the deploy folder. https://github.com/frc1108/BabyAckbar/blob/master/src/main/java/frc/robot/commands/auto/Bounce.java
The trajectory generator uses start, interior waypoints, and end, and the config. I expect it is possible to deconstruct the trajectory to reapply a different config, but don’t see a method for doing that in the trajectory classes.
Using the reversed config flag lets you follow the path A to B facing the other way, but it doesn’t mean you go from B to A.
You could do something like this to create a new, inverted(?) trajectory based on an existing one given you also set the new config to reverse the original.
ah. yeah thats what we do. I was hoping I could then modify the config of that (say in testing to bump our speeds, doesn’t look like it supports that though).
Looks like I’ll have to make the paths in code. Pathweaver was great for the visualization. Although the scale seemed off.
Its possible its our robot, but we uploaded a field image of the current game and plotted some points. The scale does not seem correct. I need to rerrun the characterization system with our robot to be sure thought that it is pathweaver.