Some suggestion and question about swerve trajectory generator

Our team have completed the basic function of swerve. That’s amazing . Thanks to all who have helped us before.

After completeing the basic function in teleop, we are now digging into the autonomous mode. Before asking this , l have tried the Pathweaver of WPILIB to draw a path and use my swerve to follow it. It seems that the result doesn’t seem to be good. l think that the PathWeaver isn’t so good in swerve . Besides , l have also learned about other team’s better solution to swerve trajectory generating. Would you share with us?

Any help is appreciated.

3 Likes
  1. Define what you mean by not good. What specifically is causing a problem for you?

  2. Have you read the relevant example: https://github.com/wpilibsuite/allwpilib/tree/main/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervecontrollercommand

1 Like

I can’t control the robot smoothly because it seems that l can’t control it’s head through it.
Besides, it seems that what is the length of the field in Pathweaver? For example , if l use bounce path of Pathweaver, what is the length of the whole trajectory(The length between the Start zone and the Finish zone)?

Yes , l have . l first use this to achieve an alpha version of our swerve.

1 Like

D2 - D10 is 20 feet as detailed in the 2021 game manual.

This thread will help you with your other issue.

If you are still looking for other trajectory generation solutions (while I do believe that WPILib has what you need and is thus more sustainable for your team), someone else will have to chime in

1 Like

Hello , l have run into some trouble when running the trajectory. l just use this simple trajectory. However , when l let it run. My robot won’t turn 45 degree at the end of this trajectory. It doesn’t turn at all. Can you help me with it?

We are working on the same thing and I wrote this today. We are planning to test it at our next meeting Tuesday so I will post if we can get the rotation to work. Sidenote, we have trajectory generation from PathWeaver working for rotation so this is probably an easy fix.

Thanks , do you use swerveControllerCommand or holonomicDriveController?

We actually use neither. We wrote the swerve drive base to follow states from kinematics. During auto, we use a timer to iterate through states of the trajectory, pass through a Ramsete controller, pass through swerve drive kinematics, and we get the states for each swerve module. During teleop we do a similar thing but we send controller input through the kinematics library. The feedback is done using a mix of odometry and gyro.

2 Likes

To follow up, I didn’t work on it today, but the person who did got rotation on path weaver to work (generally). It actually had not been before. There is still refinement to be done but that should be simple, we will post our observations about manual trajectories when we test them Thursday.

As for what he did to solve it, I don’t know, he forgot to push to git, I will reply with an explanation of that as well to see if it helps.

1 Like

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