Quote:
Originally Posted by correnos
With most Java programs, creating an object from a class is the advisable path. However, I am unaware of how to accomplish this from the setup used by wpilibj. It is configured on the JVM of the cRIO to run the main class, and if there is a way to tell it to work with an instance of said class instead of the class itself I have not found it yet.
|
I think you may be misinterpreting what is happening. When you create a class from SimpleRobot (for instance), you also create (generally) a constructor for it. Your class is instantiated, its constructor is called, and at some point the autonomous() and operatorControl() methods are called.
Unlike a normal desktop app, you are not running the show, the overarching layer is instantiating your robot class and running specific methods at appropriate times.