View Single Post
  #2   Spotlight this post!  
Unread 02-12-2013, 16:35
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 429
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Help with Test Robot program (NetBeans)

Your class extends RobotBase, which isn't a problem, except for that you've written your auto and teleop code inside of methods which are never called. If you take a look at the linnked javadoc for RobotBase, you will see that it has no notion of robotInit, autonomousPeriodic, or teleopPeriodic methods.

If you wanted to continue to extend RobotBase, you need to call these methods appropriately from your startCompetition method.

However, I would suggest you take a look at the IterativeRobot class. If your TestRobot class extended IterativeRobot, then you should be able to get rid of the startCompetition method in your code. robotInit, and the auto/teleopPeriodic metyhods would be called as described in the javadoc. Currently though you have while loops inside your teleopPeriodic method. If you use the iterative robot project, the auto and teleopPeriod methods are already going to be called periodically (50 times per second per javadoc), so you want them to complete quickly. If there are loops in these methods you want to be sure they won't take longer than 20ms to complete.

Alternatively, if you want to have while loops in your teleop or auto methods, take a look at the SimpleRobot class.


Also, I would recommend not using the watchdog, at least not until you get everything up and running. It's just one more thing that could go wrong and confuse the issue. For example, it's currently not being fed inside your while loop in the teleopPeriodic method, so the robot should stop working after 0.2 sec. per your code.

Hopefully that gets you moving in the right direction. In the future use the "[code]" tags around your code so it's easier for people to read.
__________________
http://team2168.org
Reply With Quote