SDS compilation error

Using the sds library to get swerve drive working and getting the error:

Cansparkmax.Speedcontroller is not available but we are not using that anywhere in our code we are just trying to get this repo up and running the only thing we’ve changed are constants.

We have already tried downloading the entire library into our project

Uninstalling and reinstalling all vendor dependencies any help much appreciated

The easy and quick fix is to install the rev libraries. https://github.com/HoyaRobotics/InfiniteRecharge2020/blob/master/src/main/java/frc/robot/commands/DriveForTime.java

The more time consuming solution is to work through the SDS code and remove the variables and methods that refer to it. The SDS library is structured so you select which type of motor you are using. If you haven’t installed the 3rd party libraries for that motor you get that error.

Tried both solutions to no avail

Does the error code give you the file and line number where the error occurred?

Originally it did not it only pointed to the sds library then I imported the entire library

Now we get this
Error

2022-Commandbase-template\src\main\java\frc\robot\com\swervedrivespecialties\swervelib\rev\NeoDriveControllerFactoryBuilder.java:41: error: cannot access SpeedController
        CANSparkMax motor = new CANSparkMax(id, CANSparkMaxLowLevel.MotorType.kBrushless);
                                                                   ^

class file for edu.wpi.first.wpilibj.SpeedController not found
1 error
Compilation Error!
GradleRIO detected this build failed due to a Compile Error (compileJava).
Check that all your files are saved, then scroll up in this log for more information.

FAILURE: Build failed with an exception.

I remember when we used to use sds I resolved the issue by just cloning their repo and putting it into the robot code folder somewhere instead of importing.

That’s what we did to get the above error

Can you post the output of WPILib: Open Project Information

I suspect you have mismatched WPILib and Rev library versions.

1 Like

WPILib Information:
Project Version: 2023.0.0-alpha-1
VS Code Version: 1.63.2
WPILib Extension Version: 2022.2.1
C++ Extension Version: 1.7.1
Java Extension Version: 1.1.0
Java Debug Extension Version: 0.37.0
Java Dependencies Extension Version 0.18.8
Java Version: 11
Java Location: /Users/palomino/wpilib/2022/jdk
Vendor Libraries:
CTRE-Phoenix (5.21.3)
REVLib (2022.1.1)
swerve-lib (1.1.0)
WPILib-New-Commands (2020.0.0)
KauaiLabs_navX_FRC (4.0.447)

Why is your project using 2023 alpha 1 of WPILib? I’m not aware of Rev releasing a library compatible with it. You’ll need to downgrade to 2022 version of WPILib.

Something something bleeding edge?

Honestly I don’t know :thinking: we built on a new laptop and pulled most recent lib, could that be causing the deprecated Speecontroller error?

1 Like

Yes

this is what we had when it worked

Yes, SpeedController was deprecated in 2022 and removed in 2023 WPILib.

So do we need to rollback to 2021?? How would we get this working in a competition?

Change to using 2022.4.1. Deprecated items still work, they just emit a warning that they’ll go away at some future point in time.

Getting a Java runtime error after changing that number

Please post the error message.

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