Swerve Drive Code: startCompetition() Error

Our team has been trying to get swerve drive up for the off-season but we keep encountering the same error. Could anyone please assist us as we cannot find any resources to troubleshoot this error. Below are some pictures of the error on DriverStation and a GitHub to our code. Thanks again!



You’re initializing the SwerveDriveOdometry object with null instead of an array of SwerveModulePositions. Relevant line here. Notice how the line number (35) corresponds to the error message.

Instead of null, pass an array of the current module positions. More information here.

1 Like

Thanks, that makes sense!

Hello, thank you for your help before! However, now we face the issue of “stale CANcoders” as well. There seems to be things wrong with using getPosition (). How should I go about fixing this? We updated the GitHub we posted above.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.