View Single Post
  #7   Spotlight this post!  
Unread 16-02-2012, 12:46
derekwhite's Avatar
derekwhite derekwhite is offline
Java Virtual Machine Hacker
no team (FIRST@Oracle)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2009
Location: Burlington, MA
Posts: 127
derekwhite is on a distinguished road
Re: Robots don't quit error message prevents robot from driving

I'll just handle this part:

Quote:
Originally Posted by joelg236 View Post
Figuring as I have not tested this out, I am curious about this :
Maybe I'm just brain-dead, but I don't quite understand why that is true. I was not aware that WPILib created all of the objects. It seems to me that if that were at all true, EVERY object would be initialized twice (because of the robotInit() method)
I was wrong here. WPILib doesn't create the objects automatically. Java ME creates a MIDlet object to start your application - this is different than in desktop Java, which calls the "main()" method of your application class.

The MIDLet created for your robot is is your MainRobotFunctions class (because MainRobotFunctions is a SimpleRobot is a RobotBase is a MIDlet).

Java ME knows to create "MainRobotFunctions" becuase the class name is stored in your manifest.mf file.
Reply With Quote