Hi, I’m having a problem with Pathplanner’s SwerveSetpointGenerator. Whenever a setpoint is generated, it drastically reduces the ChasisSpeeds from the target speeds making it accelarate and decelarate a lot slower. Does anyone know what the problem might be and how to fix it?
The code can be found here.
the limits the setpoint generator is trying to enforce can be adjusted. try making them higher.
I tried changing them. Didn’t make a noticeable difference
good! if you’re adjusting an input, but the output isn’t changing, then probably there’s something wrong with your understanding of the thing in between. or maybe you’re changing the wrong input. try logging more stuff around and inside it. if the path planner setpoint generator doesn’t have enough logging, you could cut and paste the code into your own setpoint generator class, and add logging there.
I think the key here is that you can’t learn much by watching what the robot does. ever. you have to look at data.
I am looking at the data. This is what the data shows. The green is the desired states acording to how I rotate my joystick, blue is the target states generated from the generator, and red is the current state. My problem is that the generated state takes a long time to get to the desired state.
good! to me, that looks like it’s working perfectly, it’s just configured to use a low acceleration limit.
looking at the setpoint generator code, i don’t see much useful logging, so you might want to cut and paste a version of your own that you can investigate more deeply.
you could also just play more aggressively with the config: if you set all the limits very high, the you should get the setpoint generator to do nothing. if you can’t do that with the config, then you’re definitely not using the right config at all, or something else is overwriting your changes. I saw in your code that the config comes from some (mysterious to me) “GUI.” maybe take that out, make it simpler.
I tried drastically changing config, it changed the output but it never improved anything. And I don’t think it’s a problem with getting the config because I double checked and the values in the code are the same as in the config. And getFromGUI()
just get’s the configuration from the pathplanner GUI. Nothing mysterious about it.
when you say it changed the output, what did it do?