Setting Swerve Modules to Point In Direction of Path before Following Trajectory

I have noticed that if the swerve modules are not pointed in the direction that the robot moves before following the trajectory, it doesn’t follow the path very well. I was wondering how to set the module angles to point in the direction of movement before starting the path to prevent this issue. I have a method in my drivetrain class that can set the module angles, but I am not sure how to get the initial angle that the modules are pointed in from the trajectory object. I am using PathPlanner, with has a method called getInitialState(), however I am not sure of how to extract the angle from this. Any help would be appreciated. Thank you

Normally, our team doesn’t care about setting the modules to point a specific direction, as soon as your swerve drivetrain is given an impulse it should snap to the correct azimuthal angle.

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