Go to Post AND... ...GET OFF MY LAWN! You young whippersnappers. dang nabit... - Joe Johnson [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 15-01-2006, 11:06
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 747
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
While Loop Require in OperatorControl?

I've seen now two videos of a couple of engineers from Intellitek that are teaching a seminar on EasyC and both of them show creating a WHILE (1) LOOP in the operatorcontrol function and putting your code inside the loop.

Is this required? I've got my code to excute just fine without putting a while (1) loop inside the OperatorControl function. Doesn't it loop anyway?

I know the autonmous mode does not excute in a loop, once it completes to the end it's done, unless you put a while loop in there.

One thing that would be handy to see is a generic FLOW CHART on your "Competion Template". Like the one we get when we download default code from innovation first.

I am wondering if this loop is required and part of my problem of timing my standard CPU "Scan time". In another post.
Attached Thumbnails
Click image for larger version

Name:	flow.jpg
Views:	62
Size:	14.4 KB
ID:	3822  
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
  #2   Spotlight this post!  
Unread 15-01-2006, 13:58
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 747
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: While Loop Require in OperatorControl?

I think this was answered by BradMiller in this post:

Here

Post #7, thank you Brad.

It still would be nice to see a FLOW CHART on the EasyC excution of the PIC controller, if it is any different than the default FRC code from IFIRobotics.
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
  #3   Spotlight this post!  
Unread 15-01-2006, 14:29
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: While Loop Require in OperatorControl?

Quote:
Originally Posted by chakorules
I think this was answered by BradMiller in this post:

Here

Post #7, thank you Brad.

It still would be nice to see a FLOW CHART on the EasyC excution of the PIC controller, if it is any different than the default FRC code from IFIRobotics.
OK - here you go - the runtime code in EasyC and in WPILib does this:

Code:
Initialize();
while (!IsEnabled());
while (1) {
    if (IsAutonomous())
    {
        Autonomous();
        while (IsAutonomous());
    }
    OperatorControl();
}
Notice that Initialize() is always run first - whenever the controller is turned on or reset.

Then it waits for the robot to be enabled.

Then it continuously runs either Autonomous() or OperatorControl() depending on the field condition. If you exit from Autonomous() it waits until
OperatorControl starts.

If you reset the robot during the match, it runs Initialize(), then either Autonomous() or OperatorControl() depending on the field setting.

One thing you can't see in this code is some magic stuff that happens behind the scenes that will cause the program to exit from Autonomous() or OperatorControl() if the field condition changes once either of those functions starts running.

Hope this helps...
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop time for OperatorControl function? Debug blows... Chris_Elston Programming 10 13-02-2006 14:42
arm-limitting gyro PD loop producing some strange results ZZII 527 Programming 8 16-02-2005 02:30
Loop execution time for Autonomous code Transporter08 Programming 2 13-02-2005 16:17
Rewriting main loop Max Lobovsky Programming 4 04-01-2005 18:35
Rules for hanging, using a loop over the end of the bar caffel Rules/Strategy 10 04-06-2004 15:04


All times are GMT -5. The time now is 04:34.

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