In the Java example you initialize the RobotDrive object at its declaration:
Quote:
public class RobotTemplate extends SimpleRobot {RobotDrive drivetrain = new RobotDrive(1,2);
|
I'm not sure that's a good way to do it. The constructor might need some resources that are initialized later in order to work properly. I would move it to the robotInit() method just to be safe.
Quote:
public class RobotTemplate extends SimpleRobot {RobotDrive drivetrain;
public void robotInit() {drivetrain = new RobotDrive(1,2); } }
|