DifferentialDrive decleration with TalonSRX class

Our team is working on writing a c++ equivalent for all of our Labview code to eventually switch technologies.

We are having an issue with setting up arcade drive using the TalonSRX class.
The core issue is that DifferentialDrive will not accept the TalonSRX as a SpeedController

but… the TalonSRX extends BaseMotorController so i figure it should be castable. I just cant for the life of me figure out how to create a SpeedController class from the Talon

The reason we want to use DifferentialDrive is to take advantage of the ArcadeDrive class, we are currently manually setting the output via .Set but its messy

any help would be great!

I believe you’ll find you want to use the WPI_TalonSRX class for your motor controllers instead; it already inherits from SpeedController. See the CTRE docs at:


We’ll give this a shot at our next meeting! Thank you for the link!