Trouble with Python swerve splines

My team is trying to use the Swerve4Controller command (what’s with the numbers? I assume it’s 4-wheel swerve, but I’m not sure) to generate spline trajectories. However, when I sim the code, the robot does the wrong things. We haven’t tested it on the physical robot in many months (and plenty has changed and been fixed since we last did) but when we did test it, the robot behaved erratically.

The code is at https://github.com/aesatchien/FRC2429_2023/blob/main/robot/commands_unused/drive_move.py. I just took the spline code out of the if False statement, changed robotcontainer a little bit for testing, and tested it with various values.

Some screencaps:

Also should we try to figure out splines this way, or should we just use Pathplanner?

1 Like

FYI that link doesn’t work (At least for me).

I’ve had success interpolating paths in Python for swerve drivetrains. I then pass the resulting path points to the PathPlannerPath.fromPathPoints method to get a PathPlanner path that I can get a driveable trajectory command from.

Sorry about that! here’s the link: https://github.com/aesatchien/FRC2429_2023/blob/main/robot/commands_unused/drive_move.py

We’re not using pathplanner currently- are you, and do you reccommend it?

1 Like

Personally, I’ve developed my own pathfinding algorithm, and I’m only using the bare minimum from PathPlannerLib to make that functionality work. This functionality is for automating some (or a lot) of the driving during teleop.

However for regular autonomous routines, I plan on using PathPlanner, it’s GUI and API.

1 Like

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