I’m having an issue during auto where the robot sometimes a) stops rotating and b) starts drifting off course. The robot never tries to correct despite odom accurately reporting that we’re drifting. I chalk this up as a pathplanner issue specifically because it happens only for the duration of select paths and I can see pathplanner feeding movements where all swerves are told to go to the same state.
During a given auto, the first path might fail, the second might work as normal, and then the third might fail again. Note that this issue isn’t always consistent across runs of the same auto. Generally, a path that fails on one run fails again on the next, but sometimes it’ll work fine (its especially random on longer autos). Although the conditions for this happening are pretty random, there are some things that make a path more or less likely to fail.
- Paths that go forwards and then backwards are more likely to fail
- Adding a period of high acceleration immediately before a path makes it less likely to fail
- Gradual movements are more likely to fail
I’ve also found that PID has no effect on this issue
Below is an image of the graph of chassis speeds sent in by pathplaner for a run where the first path worked as expected and the second failed.
(the change in color of the bottom bar shows the change in paths)
Comparing the two paths, you can see how the speeds sent in for the first are relatively chaotic (as PP does corrections, rotation, etc) and the speeds in the second are a perfect curve, while rotation is a flat 0. Though I think this is only a symptom of the real issue.
Attached (chief doesn’t let new users add more than one embed) is the graph of the velocities of the swerves:
https://ibb.co/rsqWWcp
Again, note the relatively chaotic nature of the target swerves for the first path. However, at the end of the path, you can see all the target swerve speeds converge to 0, after which, they’re all the exact same.
You can see a very similar thing with the azimuth angles:
https://ibb.co/F0pffDC
All the angles are the exact same for the second path.
Given this, I can only conclude that for some paths pathplanner is mapping one swerve state to all 4 while ignoring all feedback. I haven’t yet looked at what times pathplanner is actually polling the current chassis speeds, but I don’t know what that info would give me.
I’m using pathplanner 2024.1.2 and C++
Any and all thoughts, ideas, and speculation regarding this issue are welcome. I’ve tried so many things. I’m so, so tired.