Go to Post We can't be afraid to critique the existing system. If we don't, how will it ever get better? - Jaine Perotti [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 17-06-2016, 13:23
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 296
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Disable Robot in Code

Edit: DriverStation has a function called InDisabled(boolean)

Try calling that with true; it might work.

---

You can override isDisabled() in your robot class like this:

Code:
public boolean isDisabled() {
    return super.isDisabled() || myDisableFlag;
}
This should work whether you extend RobotBase or IterativeRobot

Two things:
- The Driver Station won't recognize that you are disabled when you set the flag
- You'll need to make sure to clear the flag yourself when you want to enable again

Last edited by euhlmann : 17-06-2016 at 13:28.
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 09:37.

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