Closed tonyn10 closed 2 years ago
Sorry for my own thought-dump, these are kinda my notes for my next testing trials. Another potential problem could be that we're passing a Pose2d to the RamseteCommand that only has the x and y translations but not the rotational component so the RamseteCommand doesn't have a rotational value to work with.
I think we might have to do something like:
Pose2d positionPose = odometry.getPoseMeters(); return new Pose2d(positionPose.getX(), positionPose.getY(), gyro.getRotation2d());
This is fishy however because wouldn't DifferentialDriveOdometry have a method that makes this easier.
After trying to test the path for three-ball auton, here is the issue Calvin and I found today.
When running curves and more complicated paths as found in our path for the three ball mode, it overshoots how much it should turn and continues to keep turning--sometimes making a 360+. This might not be the exact reason why it does this but based on our observation, it must have to something with the robot's pose or angle. When running straight paths (found in two-ball, one-ball, and taxi modes), this wasn't really an issue so it seems like the more you command the robot to follow a curvature, the more it fails to keep up.
I think it might be worth looking at using the gyro's turn rate or angle to somehow stabilize this.
I found some documentation relating to this: https://docs.wpilib.org/en/stable/docs/software/hardware-apis/sensors/gyros-software.html#example-tank-drive-stabilization-using-turn-rate
I'm generally not familiar with control loops so I hope I can get some help.
I also thought about the potentiality of the issue arising from PID. Since we were mainly testing on the test robot, the PID values that we had attained on the competition robot could've caused inaccuracies. The whole thing could just be a PID issue (which would be annoying) but I don't think the PIDs should be too different between each robot that it completely changes its auton functionality. I found two-ball auton to be a little jagged but its start and arrival were correct.