Been trying to track down an issue with our code. We built some autos with Path Planner, I built the auto builder, named commands, etc. and tried running an auto. It seems like the motions are proportionally off - seems like the robot will overshoot fairly drastically or miss the target all together. Wondering if someone can look through our swerve code and give me some pointers.
If I run the ‘sample auto’, it seems like it works as intended. Driver control swerve seems to function normally, just seems to be path planner.
When watching the smart dashboard field element, the robot position doesn’t match where it should actually be. There are random axis changes, however they are sometimes correct. It will also sometimes think it is going backwards when the robot is actually going forward.
You haven’t tuned your PID controllers in your auto builders try changing these values and seeing if you get a desirable behavior new change your values in the PID constants line
new PIDConstants(5.0, 0.0, 0.0), // Translation PID constants
new PIDConstants(5.0, 0.0, 0.0), // Rotation PID constants
That would cause the robot pose to be erratic on the field 2d element?
I belive that the field 2d is showing the path that the robot should take and not the current pose of the robot so changing the PID loop constants wouldn’t change it this is also why the field2D widget dosen’t match what your robot is really doing to see that look into the network tables for the tab under Pathplanner named current pose. I used advantage scope to log the current pose for comparsion it’s a really easy and useful tool to setup for debugging things like this. Even with out it if your current pose dosen’t match the target pose, which is another tab under path planner, tune your PID constants till it does