Go to Post While grandmothers are pretty cool, I would be hesitant in letting them determine what is and is not a robot. - Kellen Hill [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-01-2013, 18:21
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,561
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: SimpleRobot versus IterativeRobot

I'm assuming you're coming from LabVIEW.

IterativeRobot is set up like telop and disabled were in LabVIEW. Each time a new packet is received from the driver station, it calls the appropriate method (telopPeriodic, etc). Each of the Periodic methods must return quickly, or else you will miss processing driver station packets. Initialization should go in the init methods, as those only get called once per transition to each mode.

SimpleRobot does not have any built in looping structure, you need to add it. It generates less code, which might be why it's called Simple, but since you need to add loops to it, it might not really be simpler.

RobotBuilder extends IterativeRobot with what they call the Command based model. The Scheduler calls you notice call Commands that you define that run based on triggers you define (such as pressing a button). This is described in much more detail in the RobotBuilder documentation. http://wpilib.screenstepslive.com/s/3120/m/7882
Reply With Quote
  #2   Spotlight this post!  
Unread 11-01-2013, 23:10
jfitz0807 jfitz0807 is offline
Registered User
FRC #2877 (Ligerbots)
Team Role: Parent
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Newton, MA
Posts: 67
jfitz0807 is an unknown quantity at this point
Re: SimpleRobot versus IterativeRobot

So what exactly does Scheduler.getInstance().run() do?

Do we add any code to autonomousPeriodic() and teleopPeriodic() or can we just leave it with the call to Scheduler.getInstance().run()?
Reply With Quote
  #3   Spotlight this post!  
Unread 11-01-2013, 23:30
Johnbot's Avatar
Johnbot Johnbot is offline
Es Brokein!
AKA: John Westhoff
FRC #4791 (Pandroids)
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2010
Location: Horsham, PA
Posts: 92
Johnbot is just really niceJohnbot is just really niceJohnbot is just really niceJohnbot is just really niceJohnbot is just really nice
Re: SimpleRobot versus IterativeRobot

As Joe Ross said, the Robot Builder gives you a Command based model code. These commands are first defined in the Robot Builder. Scheduler.getInstance().run() just controls the top-level commands.

The command model might be a bit confusing to begin with, and you can always just put your teleop and auton code in their respective methods. You may also want a teleopInit method and a autonInit method, both of which are executed when switching from disabled to auton or teleop.

If you want to continue using the CommandBased Robot template, then the link Joe Ross is very helpful in getting started.

Also, you don't need to use the RobotBuilder to start. If you are using netbeans, you can rightclick the Projects area, click New Project, click FRC Java, and then choose the RobotTemplate that you want to use.

SimpleRobot requires you to do your loops yourself, so IterativeRobot may be the way to go.
If you see a SimpleRobot example, you can change it into an IterativeRobot by finding the operatorControl method, copying it to your teleopPeriodic method, and then removing the first line of that code that says something like "while (.....)"
__________________

2011-2014 - FRC 2607 - Student
2012-2012 - FLL 2249 - Coach
2015- ???? - FRC 4791 - Mentor
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:47.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi