With the addition of the Phoenix Framwork, I’ve encountered issues with the TalonSRX object (formerly CANTalon) seemingly not being a subclass of any sort of SpeedController.
When attempting to use them in the SpeedControllerGroup object to be used in the DifferentialDrive object (formerly RobotDrive) I get an error stating:
The constructor SpeedControllerGroup(TalonSRX, TalonSRX) is undefined
Here’s my code:
package org.usfirst.frc.team4308.robot.subsystems;
import org.usfirst.frc.team4308.robot.RobotMap;
import org.usfirst.frc.team4308.robot.util.MultiSpeedController;
import com.ctre.CANTalon;
import com.ctre.phoenix.motorcontrol.can.TalonSRX;
import edu.wpi.first.wpilibj.Spark;
import edu.wpi.first.wpilibj.SpeedController;
import edu.wpi.first.wpilibj.SpeedControllerGroup;
import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
public class DriveTrain extends Subsystem {
TalonSRX frontLeft,frontRight,rearLeft,rearRight;
SpeedControllerGroup leftDrive,rightDrive;
public static DifferentialDrive drive;
public DriveTrain() {
// TODO Auto-generated constructor stub
frontLeft = new TalonSRX(RobotMap.Drive.leftFront);
frontRight = new TalonSRX(RobotMap.Drive.rightFront);
rearLeft = new TalonSRX(RobotMap.Drive.leftBack);
rearRight = new TalonSRX(RobotMap.Drive.rightBack);
leftDrive = new SpeedControllerGroup(frontLeft,rearLeft);
rightDrive = new SpeedControllerGroup(frontRight,rearRight);
drive = new DifferentialDrive(leftDrive, rightDrive);
}