Quote:
Originally Posted by jee7s
Ah, now that looks like you are stepping on your own code. Does the RobotDrive class declare and instantiate the joysticks and talons? If it does, then you are trying to set values from two different places. That might be causing your complication.
From the other poster's comment, I think all you need is that first line where you instantiate a new RobotDrive.
|
First 3. RobotDrive instantiates the motors on its own but does not instantiate the Joysticks. (though stop to think of it, I'm not sure what it instantiates them as... Talon, Jaguar, and Victor all extend the SpeedController class...)
EDIT: Looking at the WPIlib reference, they're instantiated as Victors. you can also pass SpeedController objects to the RobotDrive constructor if you want something other than Victors.
In this case, they could go:
Code:
Talon leftDrive = new Talon(1);
Talon rightDrive = new Talon(2);
RobotDrive chassis = new RobotDrive(leftDrive, rightDrive);