Thread: Autonomous Help
View Single Post
  #88   Spotlight this post!  
Unread 23-01-2015, 18:38
mmaunu's Avatar
mmaunu mmaunu is offline
Registered User
FRC #2485 (W.A.R. Lords)
Team Role: Mentor
 
Join Date: Mar 2013
Rookie Year: 2010
Location: San Diego, CA
Posts: 89
mmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the rough
Re: Autonomous Help

Quote:
Originally Posted by curtis0gj View Post
Thanks for the feed back! I have been receiving so much positive feed back it's wonderful. Any who, the reason I switch from SampleRobot to IterativeRobot is because I made a new project later on just to try different autonomous programs so I did not muck up my original project (Also because when I made a new project I did not know what the difference was between the two...). However, now that I have a good idea of what my autonomous is going to be should I switch back to SampleRobot? I would like to keep the loops so I am guessing I need to switch, let me know what you think. Also thanks for the setDistanceperPulse tuning I will do that on Monday to get it nice and tuned.
As for which template to use (Sample or Iterative), that is up to you. The SampleRobot template gets complicated quickly if you add any complexity to your code. If you like the loops, then you will need to use SampleRobot.

If the code above makes sense, though, I would encourage you to explore the IterativeRobot template. The teleop code works in a similar fashion: teleopInit() gets called once when teleop is enabled and teleopPeriodic() gets called every 20 ms for you (so avoid loops that don't exit quickly and do not use Timer.delay() to pause your code). Also, the 20 ms is just a great approximation...the loop timing is reallllly close to every 20 ms (certainly close enough for what we're doing).

If you do switch back to SampleRobot, then you will need the loops and the calls to Timer.delay().

Keep plugging away at it and keep asking questions. ChiefDelphi is full of people that want to help
__________________
2014 Las Vegas (Winners with 987, 2478; Excellence in Engineering)
2014 San Diego (Finalists with 987, 3250; Quality Award)
2013 Inland Empire (Winners with 1538, 968; Excellence in Engineering Award)
2013 San Diego (Finalists with 2984, 4322; Creativity Award)
2012 Las Vegas (Finalists with 2034, 3187; Quality Award)
Reply With Quote