View Single Post
  #1   Spotlight this post!  
Unread 06-01-2012, 11:51
linuxboy linuxboy is offline
Registered User
AKA: Oliver Graff
FRC #3780
Team Role: Alumni
 
Join Date: Nov 2010
Rookie Year: 2009
Location: MI, USA
Posts: 217
linuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud oflinuxboy has much to be proud of
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);
}

}
Reply With Quote