Go to Post Don't take things too seriously; It's supposed to be fun. :) - ScoutingNerd175 [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 20-04-2013, 17:49
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: Iterative Project

I have a question about simple project. I was messing around with it and how do you start stuff when the robot is initialized. Kind of like how iterative has RobotInit, TeleopInit, and AutonomousInit. Does the simple robot project have something like this?
__________________
Reply With Quote
  #2   Spotlight this post!  
Unread 20-04-2013, 18:24
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: Iterative Project

Quote:
Originally Posted by Zer0 View Post
I have a question about simple project. I was messing around with it and how do you start stuff when the robot is initialized. Kind of like how iterative has RobotInit, TeleopInit, and AutonomousInit. Does the simple robot project have something like this?
SimpleRobot leaves it up to the programmer to determine how to structure things. The most common way is to put your own while loop in operatorControl. Anything before the while loop is run at the beginning, just like TeleopInit. See https://wpilib.screenstepslive.com/s...ot-programming
Reply With Quote
  #3   Spotlight this post!  
Unread 20-04-2013, 20:32
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: Iterative Project

Do I just put the Drive system in the while loop to update it or everything.
__________________
Reply With Quote
  #4   Spotlight this post!  
Unread 21-04-2013, 21:07
Peragore's Avatar
Peragore Peragore is offline
CEO of Black Magic
AKA: Philip Mulford
FRC #3373 (Team Robohawk)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: US
Posts: 50
Peragore is an unknown quantity at this point
Re: Iterative Project

Quote:
Originally Posted by Zer0 View Post
Do I just put the Drive system in the while loop to update it or everything.
Yes.

The standard usage of Simple Robot is something like this:

Code:
public OperatorControl(){
   while (isOperatorControl() and isEnabled()){
    try {
         Thread.sleep(10L);
    } catch (Exception e){
       e.printStackTrace();
    }
   //insert code here, to be called every time through the while loop
   }
}
__________________


Code:
 
while (life){
  frcObsession = true;
  obs.ProgramAndObsess();
}
if (!life) life = true;
Reply With Quote
  #5   Spotlight this post!  
Unread 21-04-2013, 22:00
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: Iterative Project

Ok thanks i will start working on this more
__________________
Reply With Quote
  #6   Spotlight this post!  
Unread 28-04-2013, 22:13
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Iterative Project

Quote:
Originally Posted by Peragore View Post
Yes.

The standard usage of Simple Robot is something like this:

Code:
public OperatorControl(){
   while (isOperatorControl() and isEnabled()){
    try {
         Thread.sleep(10L);
    } catch (Exception e){
       e.printStackTrace();
    }
   //insert code here, to be called every time through the while loop
   }
}
IterativeRobot should be used because of its usage data reporting and management. Using SimpleRobot for anything else than custom robot structures really shouldn't be used. Using thread sleeps shouldn't really be needed because IterativeRobot waits for new data from the robot which is the only time data should really need to be processed.

I'd also recommend looking into Command-based, it may look hard at first but once you get the hang of it its so much neater and easier to write.
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:59.

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