Driving backwards in pathweaver

Has anybody found a way to drive backwards using the pathweaver 2020 tool?

1 Like

Draw your path forward , and transform it when it’s time to run?

1 Like

Here is an example (untested code) that should be able to generate a trajectory that is loadable in either forward or reverse, based on the boolean of direction.

Will have students test it out tomorrow, but logically it should work I think.

Catered for TalonSRX specifically, but probably generalizable.

If we were to swap the first and last poses of the trajectory by using the transformBy method, would simply just doing

trajectory.transformBy(lastPoseOfInitialTrajectory, firstPoseOfInitialTrajectory)

allow us to follow the path in reverse?

The easiest way to do this is to genera the the trajectory on the fly on the roboRIO and set reversed to true on the trajectory config.

Here’s a quick visualization I made to illustrate what setting reverse does.

1 Like

Seems like I’ve misinterpreted what the reverse flag would does. I thought that it would mean that your travelling from the last position of your trajectory to your initial, facing the opposite direction, as opposed to just regularly going from the first to last position of the trajectory.

If I wanted to go from the last point to first point on the trajectory, rather than the first to last, how would I approach this?

To do it within the framework of Pathweaver you would have to make a new path that is the old one backwards.

The ability to flip paths horizontally and vertically and drag entire paths should make the process pretty straightforward.