You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug Description This might not be a PP issue because I can't see how PP directly causes it but everything is fine after reverting version
On enabling after a deploy, the robot's swerve module for some reason drive uncontrollably straight. This started occurring after we updated to PP 2025 beta "version": "2025.0.0-beta-2.2". Here is what it looks like
The following image contains raw input chassis speed (I apologize for naming but ChassisSpeed is the ChassisSpeed generated from the controller input and RunVelocity/ are the values that the robot is setting the velocity to).
public void runVelocity(ChassisSpeeds speeds) {
Logger.recordOutput(
"RunVelocity/StackTrace", Arrays.toString(Thread.currentThread().getStackTrace()));
Logger.recordOutput("RunVelocity/Speeds", speeds);
// Calculate module setpoints
ChassisSpeeds discreteSpeeds = ChassisSpeeds.discretize(speeds, 0.02);
SwerveModuleState[] setpointStates = kinematics.toSwerveModuleStates(discreteSpeeds);
SwerveDriveKinematics.desaturateWheelSpeeds(setpointStates, MAX_LINEAR_SPEED);
// Send setpoints to modules
SwerveModuleState[] optimizedSetpointStates = new SwerveModuleState[4];
for (int i = 0; i < 4; i++) {
// The module returns the optimized state, useful for logging
optimizedSetpointStates[i] = modules[i].runSetpoint(setpointStates[i]);
}
// Log setpoint states
Logger.recordOutput("SwerveStates/Setpoints", setpointStates);
Logger.recordOutput("SwerveStates/SetpointsOptimized", optimizedSetpointStates);
}
The controller input is essentially 0, but the modules are running which I find bizarre.
Note: The code is mostly forked from 6328's Advanced Swerve Examples with minor changes to control and no big changes to math for swerve. This code served us very well the previous season with no instance of this problem.
To Reproduce
Steps to reproduce the behavior:
Deploy (There are no problems)
Redeploy (The modules will run in teleop without any controller input)
To Fix
Fully power cycle the robot and on the first deploy it will be fine
Versions: (please complete the following information):
So from my understanding this isn't happening in anything that uses PPLib code. So, this is definitely not a PPLib issue.
I think your SwerveStates/Measured log entry gives a clue to what the issue could be. Your code thinks that the measured speed of your modules is in the thousands of meters/sec. This indicates that your unit conversions from the motor to meters/sec is wrong. So, it is likely wrong in the other direction as well, causing very small outputs to make the motor drive very fast. I can't really debug this for you, but hopefully that gives you an idea of where to look.
Bug Description
This might not be a PP issue because I can't see how PP directly causes it but everything is fine after reverting version
On enabling after a deploy, the robot's swerve module for some reason drive uncontrollably straight. This started occurring after we updated to PP 2025 beta "version": "2025.0.0-beta-2.2". Here is what it looks like
The following image contains raw input chassis speed (I apologize for naming but ChassisSpeed is the ChassisSpeed generated from the controller input and RunVelocity/ are the values that the robot is setting the velocity to).
The controller input is essentially 0, but the modules are running which I find bizarre.
Here is the code that have this problem https://github.com/WheatleyRobotics/Reefscape/tree/bug/swerve-out-of-control
Here is the old code with 2024 PP that does not have this problem https://github.com/WheatleyRobotics/Reefscape/tree/master
Note: The code is mostly forked from 6328's Advanced Swerve Examples with minor changes to control and no big changes to math for swerve. This code served us very well the previous season with no instance of this problem.
To Reproduce
Steps to reproduce the behavior:
To Fix
Fully power cycle the robot and on the first deploy it will be fine
Versions: (please complete the following information):
Additional context
I made a ChiefDelphi post regarding this problem https://www.chiefdelphi.com/t/swerve-modules-driving-out-of-control/474561/2. I was suggested to reset the controllers because the motor controllers might have the previous input.
I added this right after object initialization but unfortunately the problem still persists
The text was updated successfully, but these errors were encountered: