We’re starting with Swerve this year, and got the field-centric teleop working very well. We wrote our code using multiple team’s repositories (and can share if interested; we purposefully documented it in detail, and made both motors and IMU interface objects, so easy to substitute for any motor controller or IMU). We’re at the point of configuring and trying the auto path navigation.
With the tank drive in the past we used PathPlanner to much success. However, I noted that PathPlanner does not seem to generate trajectories that have holonomic component or any kind of sideways movement quite well.
The worst one is a sample trajectory where we simply want robot to run in place 90 degrees. Instead of simply turning in place the PathPlanner wants it to go forward a little, turn and then move back. In other words, definitely not turning in place.
With the sideways trajectory if we go from, say, 2,2,0,0 to 2,3,0,0 it goes forward a little, then sideways and back, and then forward a little again.
Why???
We calibrated our robot that the wheel turns are on 1ms cycle, and are VERY fast. There is no need to do any kind of adjustments for the time it takes to turn the wheel to a given angle.
This trajectory suppose to simply move the robot to the left 1 meter. Instead it’s moving a little forward, then to the left and backward, then a little forward again.
The heading (and not the holonimic rotation) determines the path itself. You can change its angle and magnitude by dragging around the white dots that extend from the middle of the poses.
And I think I got it! The magnitude of the forward motion is done via white dots. If you do not want any, just place it in the center. We can see how well that works.
We imagine that the little white dots are representing the way you want the wheels to face (not the way you want the robot frame to face). This means that for the robot to go left, the wheels have to rotate from forward to the left. But at the same time it’s accelerating so the robot will move forward then left. You can adjust the white dots to tell the robot to put the wheels to face left initially and when the routine starts the wheels will snap to the left
You can use the preview function to see it will show the robot following the curved white like path. To just go in a straight line you should move the spline control points to point up and down. Then you can probably lower the magnitude of the length of the line as well.