View Single Post
  #5   Spotlight this post!  
Unread 06-17-2016, 01:23 PM
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: 298
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 : 06-17-2016 at 01:28 PM.
Reply With Quote