Go to Post After all, bitterness takes all the fun out of wiring. - Venkatesh [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 07-02-2015, 13:18
Discord2974 Discord2974 is offline
Registered User
FRC #2974
 
Join Date: Feb 2015
Location: Georgia
Posts: 1
Discord2974 is an unknown quantity at this point
Disable robot from controller?

Hi! I'm a third year programmer for team 2974 and I've got one question. Is there a way to remotely disable/enable a robot from a controller? This is for a past year's robot and and is still using the 2014 code if that clarifies anything.
Reply With Quote
  #2   Spotlight this post!  
Unread 15-02-2015, 17:49
dc74089's Avatar
dc74089 dc74089 is offline
Control Systems Lead
AKA: Dominic
FRC #1902 (Exploding Bacon)
Team Role: Programmer
 
Join Date: Dec 2013
Rookie Year: 2011
Location: Orlando
Posts: 25
dc74089 will become famous soon enough
Re: Disable robot from controller?

How creative are you looking to get? You can map one of the controller's buttons to be f1 and one to be enter, but I'm not sure if the driver station is smart enough to catch on to the fact that that input wouldn't be from a physical keyboard. The other option would be to do something crazy ala modifying OpenFMS to recognize a controller button as an enable command.

It's not exactly what you're looking for, but would modifying that robot's code to have an "enable" and "disable" button work? That way you could leave your robot enabled via the DS (you still need a DS connected), but "disable" all robot functions (write all outputs as zero and ignore almost all inputs) until you "enable" the majority of your code via a button on your controller. Especially if you're using simple or iterative templates, that method wouldn't require more than an extra boolean, and an if/else statement.
__________________
-Dominic
Think big. Think smart. Think different.

FLL - Nerdvana (2011-12)
FTC - Nerdvana/Clockwork Mania 6379 (2012-13), Team HazMat 9277 (2014-?)
FRC - Clockwork Mania 4013 (2014), Exploding Bacon 1902 (2015-?)
Reply With Quote
  #3   Spotlight this post!  
Unread 15-02-2015, 21:10
Ozuru's Avatar
Ozuru Ozuru is offline
It's always the programmer's fault.
no team
 
Join Date: May 2013
Rookie Year: 2010
Location: Earth
Posts: 268
Ozuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to behold
Re: Disable robot from controller?

If you want to be really, really ghetto you could map a button to a boolean (isDisabled) and just surround everything in teleop and autonomous with

Code:
if(!isDisabled) {

}
Now that I think about it, if you surround the scheduler parts with that it might actually work...although there won't be an easy way to re-enable it -- in that case, just put something in teleopPeriodic that's a toggle.
Reply With Quote
  #4   Spotlight this post!  
Unread 15-02-2015, 21:38
JacobD's Avatar
JacobD JacobD is offline
Registered User
AKA: Jacob
FRC #1672 (Mahwah Robo T-Birds)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2013
Location: New Jersey
Posts: 93
JacobD is an unknown quantity at this point
Re: Disable robot from controller?

Quote:
Originally Posted by Ozuru View Post
If you want to be really, really ghetto you could map a button to a boolean (isDisabled) and just surround everything in teleop and autonomous with

Code:
if(!isDisabled) {

}
Now that I think about it, if you surround the scheduler parts with that it might actually work...although there won't be an easy way to re-enable it -- in that case, just put something in teleopPeriodic that's a toggle.
Before you try something like this, you might want to be careful because FIRST might give you problems when they see that. They have the enable/disable functionality for safety reasons. I understand that you might want to enable/disable from a wireless remote, but consider safety first.
Reply With Quote
  #5   Spotlight this post!  
Unread 16-02-2015, 07:01
matthewdenny's Avatar
matthewdenny matthewdenny is offline
Registered User
FRC #6054 (Dukes)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: United States
Posts: 311
matthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant futurematthewdenny has a brilliant future
Anything that interferes with the fields ability to disable a robot would be a bin no no.
Reply With Quote
  #6   Spotlight this post!  
Unread 16-02-2015, 10:45
dc74089's Avatar
dc74089 dc74089 is offline
Control Systems Lead
AKA: Dominic
FRC #1902 (Exploding Bacon)
Team Role: Programmer
 
Join Date: Dec 2013
Rookie Year: 2011
Location: Orlando
Posts: 25
dc74089 will become famous soon enough
Re: Disable robot from controller?

Quote:
Originally Posted by JacobD View Post
Before you try something like this, you might want to be careful because FIRST might give you problems when they see that. They have the enable/disable functionality for safety reasons. I understand that you might want to enable/disable from a wireless remote, but consider safety first.
Quote:
Originally Posted by matthewdenny View Post
Anything that interferes with the fields ability to disable a robot would be a bin no no.
This wouldn't interfere with the enabling and disabling of the FMS. The robot still has to be connected to and initially enabled from a driver station, and it still can be disabled (it can always be disabled if everything is working as it should, FIRST makes sure of this). Enabling starts the user code on the cRIO, and surrounding your code with this if/else doesn't let your actual code start once the bot is enabled from the DS until your Boolean is flipped. It interferes with the FMS's ability to get your robot to move, but so would putting a robot on the code without any code or just not touching your controls, which is legal. You'd have to go deep into WPILib to let your bot actually do stuff while it was disabled by the DS, and I'm not even sure if it's possible at all with FIRST's firmware.

And plus, OP said this was for a demo bot, so while safety is definitely more of a concern than at competition, if safety is preserved FIRST legality is close to irrelevant.
__________________
-Dominic
Think big. Think smart. Think different.

FLL - Nerdvana (2011-12)
FTC - Nerdvana/Clockwork Mania 6379 (2012-13), Team HazMat 9277 (2014-?)
FRC - Clockwork Mania 4013 (2014), Exploding Bacon 1902 (2015-?)
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 18:03.

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