Whenever we try to enable the electrical board (roboRIO) using the driver station, we get the following error from the driver station console:
Code:
ERROR Unhandled exception: java.lang.NullPointerException at
[org.discobots.stronghold.subsystems.DriveTrainSubsystem.tankDriveUnramped(DriveTrainSubsystem.java:133),
org.discobots.stronghold.subsystems.DriveTrainSubsystem.tankDriveRamp(DriveTrainSubsystem.java:76),
org.discobots.stronghold.commands.drive.TankDriveCommand.execute(TankDriveCommand.java:24),
edu.wpi.first.wpilibj.command.Command.run(Command.java:240),
edu.wpi.first.wpilibj.command.Scheduler.run(Scheduler.java:222),
org.discobots.stronghold.Robot.teleopPeriodic(Robot.java:139),
edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:143),
edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:241)]
WARNING: Robots don't quit!
I have tried it with CAN and using the CANTalon class with TalonSRX motor controllers and the code works like a charm and it stays enabled. I am now trying to use the same code, but changing the ports to PWM ports and we are now using TalonSR motor controllers (Which do not have a class in the 2016 libraries). I have changed the motor controller types in the code to Jaguars, Victor, Talon, TalonSRX, and Victor SP, but I am still getting the same error as soon as I enable using the driver station. We also get the same error when there's not anything physically attached to the ports, but they are still referred to in the code.
When I comment out anything referring to the PWM motor controllers, I do not get an error.
Any suggestions on what the problem might be?
Thanks!