Quite tired so I ca't give you another full sweep, but a few things
Code:
public AutonManager autonManager; //PUBLIC OR DOES IT MATTER?
doesn't matter. Same issue in the following poing
Code:
Robot robot
public AutonManager(Robot r){
this.robot = r;
}
(first of all, bad indenting)
By not specifying a return type, you are making a
constructor, which must have the same name of your class [in this case, "Auto"]. I called it "AutonManager" because I couldn't remember what you called it and chose the name I would've used. In this case, "AutonManager" would be "Auto" since the name of the class is "Auto" (as seen by: "Auto auto = new Auto();" (long story short: this should be public Auto(){))
Now, you chose the constructor, which was the proper choice since it followed wpi-standards. However, you left everything else static
Code:
public static void run(AUTOS autoMode) {
The static method means that it doesn't need a constructor and thusly cannot access non-static variables, such as
(since there is no "static" keyword, it is defaulted to "instanceable" so static methods cannot access it)
I have some homework to do so I'll have to cut the rest of this short. Please do some independent study on the "static" keyword, constructors, and other fundamentals of Java. I don't know your level of talent with Java and I code it professionally so I may be telling you what to write and not how to write it, which is a mistake that should never be made.
On a side note, what is your mentor situation?
Yes, you misunderstood me. Let's break it down right fast. in Robot.java
Code:
public class Robot{
public RobotDrive chassis;
public Joystick stick;
By being in the class "Robot", the class robot must be accessed in some way in order for "chassis" and "stick" to be accessed, since nothing in Java is global.
The "public" keyword means that other stuff can access these variables, if you didn't want them to be changed than you can change them to private but you want these public in this case.
"RobotDrive" and "Joystick" are the classes. Somewhere in WPI code there is a
Code:
public class Joystick{
//code code code
}
and likewise for robotdrive. Calling Joystick.staticMethod() is only possible if staticMethod is indeed static, since no enclosing instance of Joystick is given. Calling stick.nonStaticMethod() is possible since the "Joystick" object "stick" is given.
Anyway, you're not specifying what you want to get "chassis", "gyro", "encoder", etc. You have to call "robot.chassis. ..." since you need to specify what instance of "Robot" you want to draw a variable called "chassis" from.
Not 100% but that shouldn't be an issue now since all of your while(true) loops are isolated.
long story short: remove "static" keyword, fix indenting, gotta have "robot.chassis" and etc.
I'd also recommend not pushing to the github so much as it's not necessary / might cause a
detached head (had a couple of those fun little puppies) (I apologize in advance if the link is too technical)