Go to Post Good programmers always find a better way to do something, especially when it's not obvious where those improvements can be found. - Mr. Lim [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 02-08-2016, 08:09 PM
MaikeruKonare's Avatar
MaikeruKonare MaikeruKonare is offline
Programming Division Captain
AKA: Michael Conard
FRC #4237 (Team Lance-a-Bot)
Team Role: Programmer
 
Join Date: Feb 2016
Rookie Year: 2012
Location: Michigan
Posts: 15
MaikeruKonare is an unknown quantity at this point
Re: Running networking code while robot is disabled

Sorry, I should have been specific. The periodic one loops. In SampleRobot it does not.

If you want to loop in Disabled() you could try:

Code:
Robot::Disabled()
{
  while(!IsEnabled()) //or while(IsEnabled() == false)
  {
     printf("Disabled!\n");
  }
}
Regardless, I would only do this at home and not at competitions.

Edit: When I said that it loops earlier I was thinking of when print statements from OperatorControl continue printing if you're missing the "IsOperatorControl()" function in your while condition.

Last edited by MaikeruKonare : 02-08-2016 at 08:12 PM.
Reply With Quote
  #2   Spotlight this post!  
Unread 02-08-2016, 08:13 PM
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 985
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Running networking code while robot is disabled

Quote:
Originally Posted by MaikeruKonare View Post

Regardless, I would only do this at home and not at competitions.
Any reason for this? This should work perfectly fine at competition.
Reply With Quote
  #3   Spotlight this post!  
Unread 02-08-2016, 08:23 PM
MaikeruKonare's Avatar
MaikeruKonare MaikeruKonare is offline
Programming Division Captain
AKA: Michael Conard
FRC #4237 (Team Lance-a-Bot)
Team Role: Programmer
 
Join Date: Feb 2016
Rookie Year: 2012
Location: Michigan
Posts: 15
MaikeruKonare is an unknown quantity at this point
Re: Running networking code while robot is disabled

No reason in particular. I just wouldn't want to mess with it, I'm not familiar with how the field management system handles the disabled modes.

It would probably be fine, but is there a reason to do it? Once the robot disables at the end of a match it's not like it's going to be powered on much longer.
Reply With Quote
  #4   Spotlight this post!  
Unread 02-08-2016, 08:25 PM
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 985
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Running networking code while robot is disabled

Quote:
Originally Posted by MaikeruKonare View Post
It would probably be fine, but is there a reason to do it? Once the robot disables at the end of a match it's not like it's going to be powered on much longer.
For before the match not after. The code will definitely run Disabled() while Disabled before the match.
Reply With Quote
  #5   Spotlight this post!  
Unread 02-08-2016, 08:32 PM
MaikeruKonare's Avatar
MaikeruKonare MaikeruKonare is offline
Programming Division Captain
AKA: Michael Conard
FRC #4237 (Team Lance-a-Bot)
Team Role: Programmer
 
Join Date: Feb 2016
Rookie Year: 2012
Location: Michigan
Posts: 15
MaikeruKonare is an unknown quantity at this point
Re: Running networking code while robot is disabled

Quote:
Originally Posted by RufflesRidge View Post
For before the match not after. The code will definitely run Disabled() while Disabled before the match.
Ah I see. It's probably fine to do before a match.

I would just be terrified because if there was an error with the disabled loop you could brick the match! (Paranoia, after having bricked matches in the past.)
Reply With Quote
  #6   Spotlight this post!  
Unread 02-08-2016, 08:35 PM
cantdecide cantdecide is offline
Registered User
FRC #5773 (YAFL Mechatronics)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: Turkey
Posts: 31
cantdecide is an unknown quantity at this point
Re: Running networking code while robot is disabled

Quote:
Originally Posted by MaikeruKonare View Post
(Paranoia, after having bricked matches in the past.)
Story? I'd like to hear more about this since I'm very interested in the inner workings of the FMS, and how you bricked it.
Reply With Quote
  #7   Spotlight this post!  
Unread 02-08-2016, 08:40 PM
MaikeruKonare's Avatar
MaikeruKonare MaikeruKonare is offline
Programming Division Captain
AKA: Michael Conard
FRC #4237 (Team Lance-a-Bot)
Team Role: Programmer
 
Join Date: Feb 2016
Rookie Year: 2012
Location: Michigan
Posts: 15
MaikeruKonare is an unknown quantity at this point
Re: Running networking code while robot is disabled

I wasn't on the drive team the year it happened, but I think there was an issue with our loop statements for teleop/auto. Basically autonomous mode worked and then teleop never began for our robot.

That happened for two matches and we worked the magic of deploying different, but still final, code and it started working.

I think the FMS does its best to force your robot to change modes, but sometimes it can't if you did something bad enough?

I honestly don't know xD
Reply With Quote
  #8   Spotlight this post!  
Unread 02-08-2016, 09:29 PM
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 985
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: Running networking code while robot is disabled

Quote:
Originally Posted by MaikeruKonare View Post
I honestly don't know xD
Please, don't spread FUD if you don't know something. If you use the Sample Template and you don't properly exit your loop in any mode your code can be stuck in that mode. However, this is not field specific behavior, you will see the same thing in your shop if you have this problem. Especially if you use the practice match feature of the DS.
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 10:18 AM.

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