Help needed with swerve code (Unknown Error)

Currently we’re experiencing an issue with our code where we’re getting the rio log below with errors and we have no clue whats wrong. If anyone could tell us our problem it’d be a big help, we know it’s something regarding the SwerveSubsystem.java file but we’re lost on the madder

GitHub:
BR8817/2025_Swerve: Our 2025 test code for our swerve originally using our 2024 season code

RIO LOG

  • ********** Robot program starting **********

  • NT: Listening on NT3 port 1735, NT4 port 5810

  • NT: Got a NT4 connection from 10.88.17.180 port 64771

  • NT: CONNECTED NT4 client ‘shuffleboard@1’ (from 10.88.17.180:64771)

  • CS: USB Camera 0: Attempting to connect to USB camera on /dev/video0

  • CS: USB Camera 0: Attempting to connect to USB camera on /dev/video0

  • CS: USB Camera 0: Attempting to connect to USB camera on /dev/video0

  • ********** Robot program starting **********

  • NT: Listening on NT3 port 1735, NT4 port 5810

  • NT: Got a NT4 connection from 10.88.17.180 port 64819

  • NT: CONNECTED NT4 client ‘shuffleboard@1’ (from 10.88.17.180:64819)

  • CS: USB Camera 0: Attempting to connect to USB camera on /dev/video0

  • CS: USB Camera 0: Attempting to connect to USB camera on /dev/video0

  • CS: USB Camera 0: Attempting to connect to USB camera on /dev/video0

  • CS: USB Camera 0: Attempting to connect to USB camera on /dev/video0

  • “conversionFactors”: {

  • “angle”: {“factor”: 28.125 },

  • “drive”: {“factor”: 0.047286787200699704 }

  • }

  • CS: USB Camera 0: Attempting to connect to USB camera on /dev/video0

  • [CAN SPARK] IDs: 8, Received parameter invalid error parameter id 113

  • Unhandled exception: java.lang.RuntimeException: java.lang.IllegalStateException: Received parameter invalid error parameter id

  • Error at frc.robot.subsystems.swervedrive.SwerveSubsystem.(SwerveSubsystem.java:109): Unhandled exception: java.lang.RuntimeException: java.lang.IllegalStateException: Received parameter invalid error parameter id

  • at frc.robot.subsystems.swervedrive.SwerveSubsystem.(SwerveSubsystem.java:109)

  • at frc.robot.RobotContainer.(RobotContainer.java:63)

  • at frc.robot.Robot.robotInit(Robot.java:55)

  • at edu.wpi.first.wpilibj.TimedRobot.startCompetition(TimedRobot.java:107)

  • at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:419)

  • at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:510)

  • at frc.robot.Main.main(Main.java:27)

  • The robot program quit unexpectedly. This is usually due to a code error.
    The above stacktrace can help determine where the error occurred.
    See Reading Stacktraces — FIRST Robotics Competition documentation for more information.

from: edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:433)

  • Warning at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:433): The robot program quit unexpectedly. This is usually due to a code error.

  • The above stacktrace can help determine where the error occurred.

  • See Reading Stacktraces — FIRST Robotics Competition documentation for more information.

  • The startCompetition() method (or methods called by it) should have handled the exception above.

  • Error at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:440): The startCompetition() method (or methods called by it) should have handled the exception above.

Your SwerveSubSystem.java on line 109 is throwing an exception that was captured by the previous try block that tried to parse the swerve configuration. I’m guessing .json files?

In RobotContainer.java:63 the subsystem is passed in a directory that’ll be where it’s deployed on the robot with swerve/neo at the end. So, it’s looking in /home/lvuser/swerve/neo for something or another.

If you don’t have that directory on the roboRIO maybe that’s the source of it?

Please use git appropriately and upload the project intact rather than just uploading all files through the UI. It’s virtually useless in its current state. The folders actually matter in java projects.


Edit:

I realize my phrasing may have been a bit abrasive, so I apologize for that. I was multitasking and typing in a rush, but that’s no excuse.

The point I was trying to convey is that the project directory structure is rather important with java. On top of that, git (and more generically, source control systems) is an invaluable skill to learn, and it gives us the ability to download your project and run it exactly as you have it. Being able to reliably reproduce issues is the best way to identify the root cause and solution to it.

2 Likes