I'll pick you up anytime. (with a claw)
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 12-02-2017, 21:56
ollien ollien is offline
Registered User
FRC #5202
 
Join Date: Feb 2015
Location: United States
Posts: 358
ollien is just really niceollien is just really niceollien is just really niceollien is just really nice
Re: Breaking loops when switching to tele-op?

Quote:
Originally Posted by Greg McKaskle View Post
You don't mention what language you are using. LabVIEW aborts the autonomous when the period ends. It will break out of loops.

I don't believe the other language frameworks do that.

Greg McKaskle
Java does not. The "SampleRobot" base class has the following while loop in its autonomous function, which is only called once.

Code:
while(isOperatorControl() && isEnabled()) {
Once teleop starts, this while loop breaks because of the condition of the loop. I HIGHLY recommend using an iterative robot instead of SampleRobot. It handles this nonsense for you.

You can test out if your code breaks by using the "practice" mode in driver station.


As a rule of thumb: while trues are a sin 'round these parts.
Reply With Quote
 


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 15:29.

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