SpeedController Class does not exist

Our team is using the MK4 example code from SDS for our swerve drive. This is our first year with swerve drive and when we deploy our code we get an error from the rio log about missing the SpeedController class. I can’t find any documentation about the SpeedController class but the rio log makes it look like it is a dependency for some of the Mk4 imports. Here is our error

8:17:37.982 PM
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(Unknown Source) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(Unknown Source) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(Unknown Source) at java.base/java.security.SecureClassLoader.defineClass(Unknown Source) at java.base/java.lang.ClassLoader.defineClass(Unknown Source) at java.base/java.lang.ClassLoader.defineClass1(Native Method) ERROR 1 The startCompetition() method (or methods called by it) should have handled the exception above. edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:365) at java.base/java.lang.ClassLoader.loadClass(Unknown Source) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source) Warning 1 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. edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:358) Error at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source): Unhandled exception: java.lang.ClassNotFoundException: edu.wpi.first.wpilibj.SpeedController ERROR 1 Unhandled exception: java.lang.ClassNotFoundException: edu.wpi.first.wpilibj.SpeedController java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)

Thanks in advance!

2 Likes

Don’t use the sds lib, it has a lot of bugs, instead use team 364s BaseFalconSwerve.

SpeedController/SpeedControllerGroup was fully replaced by MotorController/MotorControllerGroup this year after being deprecated in 2022. Either update that yourself or use a newer swerve library/template like @tecnicraze mentioned.

What about democat’s SDS version? Is that one good to use or is it worth making a NEO version of 364’s code?

The problem is we are using the MK4i with Neos, and how would we find a reliable template for our swerve drive?

It shouldn’t be too difficult to change to neos, you do have to modify some things, but it forces you to read through and figure out what the code is doing, which is a really important thing.

Here is how we did it, GitHub - teamblitz/TeamBlitzSwerve2022 at 2023 (that code has a few bugs, but it works.)

Do you have a link for democat’s SDS version? We just got our swerve kit a week ago and our last neo arrived today. Our order got delayed and we are scrambling to get swerve up and running. Its not ideal but we were under the impression that SDS would keep their code updated and could get it up in running after a bit of debugging.

SpeedController was replaced by MotorController to answer your question. You should look into democrats library though.

Here ya go

Thank you for the help! How would we go about taking this repository and implementing into our own code? Do we want to clone and build our project from there?

If you haven’t gotten it to work just yet, your configuration is similar to my test configuration. I just updated my library and it may be easier for you to use this. Yet Another Generic Swerve Library (YAGSL) Beta - #41 by nstrike

I finished implementing democat’s library and everything seems right. Planning on deploying to our swerve tomorrow.

1 Like

I have an update. Our code is properly deploying to the RoboRio but then the robot code is displaying red on the Driver Station. I took a look at the Rio log and it looks like it has something to do with posting to network tables. Our team hasn’t worked with network tables before and I don’t understand what we need to do. Here is the error

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

  • NT: could not open persistent file ‘/home/lvuser/networktables.json’: No such file or directory

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

  • NT: Got a NT4 connection from 10.35.46.226 port 57944

  • NT: CONNECTED NT4 client ‘shuffleboard’ (from 10.35.46.226:57944)

  • java.lang.UnsatisfiedLinkError: /usr/local/frc/third-party/lib/libCTRE_PhoenixCCI.so: libFRC_NetworkCommunication.so.20: cannot open shared object file: No such file or directory

  • at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)

  • at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(Unknown Source)

  • at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)

  • at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)

  • at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(Unknown Source)

  • at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)

  • at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)

  • at java.base/java.lang.Runtime.loadLibrary0(Unknown Source)

  • at java.base/java.lang.System.loadLibrary(Unknown Source)

  • at com.ctre.phoenix.CTREJNIWrapper.(CTREJNIWrapper.java:10)

  • at com.ctre.phoenix.motorcontrol.can.BaseMotorController.(BaseMotorController.java:63)

  • at com.ctre.phoenix.motorcontrol.can.BaseTalon.(BaseTalon.java:36)

  • at com.ctre.phoenix.motorcontrol.can.TalonSRX.(TalonSRX.java:32)

  • at frc.robot.subsystems.DeliveryArmSubsystem.(DeliveryArmSubsystem.java:27)

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

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

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

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

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

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

Has anyone had experience integrating democat’s swerve before? If so please let me know how to set up the network tables or any other configuring you had to do.

Thanks!

The version of CTRE’s Phoenix library you’re using is from 2020. You need to update it to the 2023 version, along with any other vendor libraries.

I downloaded the latest version at the beginning of the season but I deleted my phoenix tuner and I am redownloading it right now.

I got the latest version of the phoenix tuner and updated all of our can devices. All of our spark maxes are up to date and I am still getting the same error.

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

  • NT: could not open persistent file ‘/home/lvuser/networktables.json’: No such file or directory

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

  • NT: Got a NT4 connection from 10.35.46.226 port 61993

  • NT: CONNECTED NT4 client ‘shuffleboard’ (from 10.35.46.226:61993)

  • java.lang.UnsatisfiedLinkError: /usr/local/frc/third-party/lib/libCTRE_PhoenixCCI.so: libFRC_NetworkCommunication.so.20: cannot open shared object file: No such file or directory

  • at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)

  • at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(Unknown Source)

  • at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)

  • at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)

  • at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(Unknown Source)

  • at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(Unknown Source)

  • at java.base/java.lang.ClassLoader.loadLibrary(Unknown Source)

  • at java.base/java.lang.Runtime.loadLibrary0(Unknown Source)

  • at java.base/java.lang.System.loadLibrary(Unknown Source)

  • at com.ctre.phoenix.CTREJNIWrapper.(CTREJNIWrapper.java:10)

  • at com.ctre.phoenix.motorcontrol.can.BaseMotorController.(BaseMotorController.java:63)

  • at com.ctre.phoenix.motorcontrol.can.BaseTalon.(BaseTalon.java:36)

  • at com.ctre.phoenix.motorcontrol.can.TalonSRX.(TalonSRX.java:32)

  • at frc.robot.subsystems.DeliveryArmSubsystem.(DeliveryArmSubsystem.java:27)

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

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

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

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

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

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

Please post the output of WPLib: Open Project Information in VS Code

I’m sorry, but I’m not familiar how to do that.

Found it.

WPILib Information:
Project Version: 2023.1.1
VS Code Version: 1.74.2
WPILib Extension Version: 2023.1.1
C++ Extension Version: 1.13.8
Java Extension Version: 1.13.0
Java Debug Extension Version: 0.47.0
Java Dependencies Extension Version 0.21.1
Java Version: 17
Java Location: C:\Users\Public\wpilib\2023\jdk
Vendor Libraries:
KauaiLabs_navX_FRC (2023.0.3)
CTRE-Phoenix (5.19.4)
REVLib (2022.1.1)
swerve-lib (2023.1.2.2)
WPILib-New-Commands (1.0.0)

Its not your issue, but youll want to update your REVLib version as well since you currently have 2022