|
Re: Custom RobotDrive
When subclassing you need to call a super constructor with the proper arguments. This has a few impacts. First of all, in your constructor, you need to call super(cone, ctwo, cthree, cfour). You should also not need your own instance variables to keep track of those jaguars, since RobotDrive already does.
If my train of thought was a little confusing let me know. Here is how I would modify the code.
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.SimpleRobot;
public class DriveTrain extends RobotDrive {
public DriveTrainMecanum(int cone, int ctwo, int cthree, int cfour){
super(cone, ctwo, cthree, cfour);
}
}
|