Go to Post I hate having to wear official pants. - Cothron Theiss [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-12-2014, 12:21 AM
Merfoo's Avatar
Merfoo Merfoo is offline
Registered User
FRC #0955 (CV Robotics)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2012
Location: America
Posts: 48
Merfoo is an unknown quantity at this point
disabledInit()

After the autonomous period ends does the robot immediately switch over to teleop or does the robot get disabled then goes to teleop?
  #2   Spotlight this post!  
Unread 03-12-2014, 12:29 AM
gluxon's Avatar
gluxon gluxon is offline
\n
AKA: Brandon Cheng
FRC #0178 (The 2nd Law Enforcers)
Team Role: Leadership
 
Join Date: Apr 2012
Rookie Year: 2011
Location: Connecticut
Posts: 65
gluxon has a spectacular aura aboutgluxon has a spectacular aura aboutgluxon has a spectacular aura about
Re: disabledInit()

It should go from autonomous to teleoperated without disabling, but you could always check with the practice mode of the driver station.

In other words, have a println in disabledInit() and run practice mode to check if the line is printed.
  #3   Spotlight this post!  
Unread 03-12-2014, 12:52 AM
Cecil's Avatar
Cecil Cecil is offline
Registered User
AKA: Alex Hummel
FRC #2010 (Lightning Bots)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Champion
Posts: 343
Cecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to behold
Re: disabledInit()

The robot will be disabled during the transition from auto to teleop. The sequence will go like this:

Auto Disabled > Auto Enabled > Auto Disabled > Teleop Disabled > Teleop Enabled > Teleop Disabled
__________________
I'm right 90% of the time, so why worry about the other 3%?
  #4   Spotlight this post!  
Unread 03-12-2014, 01:06 AM
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,547
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: disabledInit()

It always goes disabled between Autonomous and Teleop. The amount of time that it is in disabled varies year to year.
  #5   Spotlight this post!  
Unread 03-14-2014, 04:20 PM
NotInControl NotInControl is offline
Controls Engineer
AKA: Kevin
FRC #2168 (Aluminum Falcons)
Team Role: Engineer
 
Join Date: Oct 2011
Rookie Year: 2004
Location: Groton, CT
Posts: 261
NotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond repute
Re: disabledInit()

Quote:
Originally Posted by Cecil View Post
The robot will be disabled during the transition from auto to teleop. The sequence will go like this:

Auto Disabled > Auto Enabled > Auto Disabled > Teleop Disabled > Teleop Enabled > Teleop Disabled
Just a clarification.

There is no difference between AutoDisabled and TeleopDisabled from the programming perspective. There are the same state.

While that is the text that is displayed in the driversation, in the codebase they are represented by the same two functions. DisabledInit() and DisabledPeriodic().

The Robot will go into disable mode when going from autonomous to teleop or anytime the robot is disabled.

Each time this happens, disabledInit() will run once, and then DisabledPeriodic() will run 50 times a second.

For further information. When the robot is first turned on it will first run RobotInit(), then DisabledInit(), then disabledPerioid().

Each time auto or teleop mode is entered, their corresponding init and periodic functions are called in the same manner as the disabled ones.

Hope this helps,
Kevin
__________________
Controls Engineer, Team 2168 - The Aluminum Falcons
[2016 Season] - World Championship Controls Award, District Controls Award, 3rd BlueBanner
-World Championship- #45 seed in Quals, World Championship Innovation in Controls Award - Curie
-NE Championship- #26 seed in Quals, winner(195,125,2168)
[2015 Season] - NE Championship Controls Award, 2nd Blue Banner
-NE Championship- #26 seed in Quals, NE Championship Innovation in Controls Award
-MA District Event- #17 seed in Quals, Winner(2168,3718,3146)
[2014 Season] - NE Championship Controls Award & Semi-finalists, District Controls Award, Creativity Award, & Finalists
-NE Championship- #36 seed in Quals, SemiFinalist(228,2168,3525), NE Championship Innovation in Controls Award
-RI District Event- #7 seed in Quals, Finalist(1519,2168,5163), Innovation in Controls Award
-Groton District Event- #9 seed in Quals, QuarterFinalist(2168, 125, 5112), Creativity Award
[2013 Season] - WPI Regional Winner - 1st Blue Banner

Last edited by NotInControl : 03-14-2014 at 04:31 PM.
  #6   Spotlight this post!  
Unread 03-14-2014, 05:43 PM
rrossbach rrossbach is offline
Registered User
AKA: Ron R
FRC #2607 (RoboVikings)
Team Role: Mentor
 
Join Date: Nov 2008
Rookie Year: 2008
Location: Warrington PA
Posts: 90
rrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to behold
Re: disabledInit()

Quote:
Originally Posted by NotInControl View Post
There is no difference between AutoDisabled and TeleopDisabled from the programming perspective. There are the same state.

While that is the text that is displayed in the driversation, in the codebase they are represented by the same two functions.
Just to be really clear , from a programming perspective they are two different states.

Even though the WPI framework calls the same disabledInit() and disabledPeriodic() functions irrespective of whether you're in Auto/Teleop/Test, in your code you can use the isAutonomous(), isOperatorControl(), and isTest() functions to distinguish what state you're in if you really need to.
  #7   Spotlight this post!  
Unread 03-15-2014, 12:22 AM
NotInControl NotInControl is offline
Controls Engineer
AKA: Kevin
FRC #2168 (Aluminum Falcons)
Team Role: Engineer
 
Join Date: Oct 2011
Rookie Year: 2004
Location: Groton, CT
Posts: 261
NotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond repute
Re: disabledInit()

Quote:
Originally Posted by rrossbach View Post
Just to be really clear , from a programming perspective they are two different states.

This is incorrect. There is only one disabled state for the robot, and there is only one interface to that state from the programming perspective.


Quote:
Originally Posted by rrossbach View Post
Even though the WPI framework calls the same disabledInit() and disabledPeriodic() functions irrespective of whether you're in Auto/Teleop/Test, in your code you can use the isAutonomous(), isOperatorControl(), and isTest() functions to distinguish what state you're in if you really need to.
While this is true in proving that the robot has 4 states (disabled, autonomous, teleop, and test, this statement does not provide evidence that Autonomous Disabled and Teleop Disabled are two difference states as your original post implied, and the first sentence of your last post tries to back up.

Your original post mentioned Autonomous Disabled, and Teleop Disables which could be interpreted that they are two different functions on the programatic side. However they are not.

I will not argue semantics, if you feel to call them two separate states by all means go ahead, but passing that information on to others is completely incorrect.

Regards,
Kevin
__________________
Controls Engineer, Team 2168 - The Aluminum Falcons
[2016 Season] - World Championship Controls Award, District Controls Award, 3rd BlueBanner
-World Championship- #45 seed in Quals, World Championship Innovation in Controls Award - Curie
-NE Championship- #26 seed in Quals, winner(195,125,2168)
[2015 Season] - NE Championship Controls Award, 2nd Blue Banner
-NE Championship- #26 seed in Quals, NE Championship Innovation in Controls Award
-MA District Event- #17 seed in Quals, Winner(2168,3718,3146)
[2014 Season] - NE Championship Controls Award & Semi-finalists, District Controls Award, Creativity Award, & Finalists
-NE Championship- #36 seed in Quals, SemiFinalist(228,2168,3525), NE Championship Innovation in Controls Award
-RI District Event- #7 seed in Quals, Finalist(1519,2168,5163), Innovation in Controls Award
-Groton District Event- #9 seed in Quals, QuarterFinalist(2168, 125, 5112), Creativity Award
[2013 Season] - WPI Regional Winner - 1st Blue Banner
  #8   Spotlight this post!  
Unread 03-15-2014, 02:04 AM
rrossbach rrossbach is offline
Registered User
AKA: Ron R
FRC #2607 (RoboVikings)
Team Role: Mentor
 
Join Date: Nov 2008
Rookie Year: 2008
Location: Warrington PA
Posts: 90
rrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to beholdrrossbach is a splendid one to behold
Re: disabledInit()

Kevin -
It's important to be clear and precise so that incorrect information isn't propagated.

Maybe I'm misunderstanding, but your posts seem to be teaching others that it is impossible in our robot code to distinguish between AutoDisabled and TeleopDisabled.

If that's what you're trying to convey, it is incorrect.

The WPI framework (at least in C/C++ and Java) provides the ability to distinguish between those "states". The following Java snippet will display different messages to the console depending on whether you're in AutoDisabled, TeleopDisabled, or TestDisabled. C/C++ is similar, just with slightly different syntax.

Code:
public void disabledPeriodic() {
if (isAutonomous()) System.out.println("AutoDisabled"); if (isOperatorControl()) System.out.println("TeleopDisabled"); if (isTest()) System.out.println("TestDisabled");
}
  #9   Spotlight this post!  
Unread 03-15-2014, 09:35 AM
Daniel_LaFleur's Avatar
Daniel_LaFleur Daniel_LaFleur is offline
Mad Scientist
AKA: Me
FRC #2040 (DERT)
Team Role: Engineer
 
Join Date: Apr 2005
Rookie Year: 2003
Location: Peoria, IL
Posts: 1,945
Daniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond repute
Send a message via MSN to Daniel_LaFleur
Re: disabledInit()

Quote:
Originally Posted by rrossbach View Post
Kevin -
It's important to be clear and precise so that incorrect information isn't propagated.

Maybe I'm misunderstanding, but your posts seem to be teaching others that it is impossible in our robot code to distinguish between AutoDisabled and TeleopDisabled.

If that's what you're trying to convey, it is incorrect.

The WPI framework (at least in C/C++ and Java) provides the ability to distinguish between those "states". The following Java snippet will display different messages to the console depending on whether you're in AutoDisabled, TeleopDisabled, or TestDisabled. C/C++ is similar, just with slightly different syntax.

Code:
public void disabledPeriodic() {
if (isAutonomous()) System.out.println("AutoDisabled"); if (isOperatorControl()) System.out.println("TeleopDisabled"); if (isTest()) System.out.println("TestDisabled");
}
I believe what NotInControl is trying to say (correct me if I'm wrong) is that there are 2 SETS of states for the robot.

The first being: Autonomous/OperatorControl/Test
and the second being: Disabled/Enabled

So if the robot is Disabled it will run disabledInit() and disabledPeriodic() regardless of the state of Autonomous/OperatorControl/Test.

TBH, I think you all are arguing semantics. But that is just mu opinion.
__________________
___________________
"We are not now that strength which in old days moved earth and heaven; that which we are, we are;
One equal temper of heroic hearts, Made weak by time and fate, but strong in will
To strive, to seek, to find, and not to yield. "
- Tennyson, Ulysses
  #10   Spotlight this post!  
Unread 03-15-2014, 11:14 PM
NotInControl NotInControl is offline
Controls Engineer
AKA: Kevin
FRC #2168 (Aluminum Falcons)
Team Role: Engineer
 
Join Date: Oct 2011
Rookie Year: 2004
Location: Groton, CT
Posts: 261
NotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond repute
Re: disabledInit()

Quote:
Originally Posted by rrossbach View Post
Kevin -
It's important to be clear and precise so that incorrect information isn't propagated.
Agreed.

Quote:
Originally Posted by rrossbach View Post
Maybe I'm misunderstanding, but your posts seem to be teaching others that it is impossible in our robot code to distinguish between AutoDisabled and TeleopDisabled.

If that's what you're trying to convey, it is incorrect.
That is exactly what I am trying to convey and it is not incorrect.There is no such thing as AutoDisable and TeleopDisable. The robot only has disabled and enabled. This is further proven by your code example. You placed all of your boolean checks in one function... disabledPeriodic(), this shows that there is only one programmatic interface to the disabled state of the robot as I mentioned previously. You are creating artifical states with conditional statements and claiming they are different states on the robot. THAT IS INCORRECT. There is only one disabled mode for the robot, the same mode is reached irregardless of if you are in Auto, Teleop, or Test.

Quote:
Originally Posted by rrossbach View Post
Code:
public void disabledPeriodic() {
if (isAutonomous()) System.out.println("AutoDisabled"); if (isOperatorControl()) System.out.println("TeleopDisabled"); if (isTest()) System.out.println("TestDisabled");
}
In order to understand why this code "works", you need to understand what isAutonomous, isOperatorControl return, in simplistic terms they return the state of the selection from the driverstation. This is not indicitive that the robot has multiple disable modes.

The crux is, the disabled mode exisits even without a driverstation as it should. If you turn the robot on and have no driverstation connected to it, it will still be in disabled mode, and run disabled periodic (the one and only disabled mode). I challenge you to see what your output is then without a driverstation. It will be nothing. Those functions you use only exist and return true if a driver station is present and reading what state the driverstation wants the robot to be in next, not that the robot changed a state.

All your code does is show that you can read from a selector on the driverstation( or FMS if that was connected) which is what all those isAuto/isOperatorControl/isTest() methods return and print out a message which says auto disabled, or teleop disabled. The mere fact that you are doing that from one function (disabledPeriodic) on the robot shows you always remained in one state of the robot state machine (disabled) while you toggle the buttons on the driverstation, not that multiple disabled states exist, or that you magically switched from an Auto Disabled state to a Teleop Disabled State or to a Test Disable state.

At the end of the day, as I said before, I will not argue semantics of what a state is or what a programmatic interface is. Please call it what you will, add as many states to the robot as desired, but if you state to others the robot state machine has any other obtainable states then these: disabled, autonomous, teleop, or test (where auto, teleop, and test each enable the robot), you would be incorrect.

I believe the original poster received their answer, and see no other reason to continue this thread.

I apologize if you felt I hijacked your statement, the information provided was unclear and felt it needed clarification, nothing beyond that.

Have a great day, Regards,
Kevin
__________________
Controls Engineer, Team 2168 - The Aluminum Falcons
[2016 Season] - World Championship Controls Award, District Controls Award, 3rd BlueBanner
-World Championship- #45 seed in Quals, World Championship Innovation in Controls Award - Curie
-NE Championship- #26 seed in Quals, winner(195,125,2168)
[2015 Season] - NE Championship Controls Award, 2nd Blue Banner
-NE Championship- #26 seed in Quals, NE Championship Innovation in Controls Award
-MA District Event- #17 seed in Quals, Winner(2168,3718,3146)
[2014 Season] - NE Championship Controls Award & Semi-finalists, District Controls Award, Creativity Award, & Finalists
-NE Championship- #36 seed in Quals, SemiFinalist(228,2168,3525), NE Championship Innovation in Controls Award
-RI District Event- #7 seed in Quals, Finalist(1519,2168,5163), Innovation in Controls Award
-Groton District Event- #9 seed in Quals, QuarterFinalist(2168, 125, 5112), Creativity Award
[2013 Season] - WPI Regional Winner - 1st Blue Banner

Last edited by NotInControl : 03-15-2014 at 11:18 PM.
Closed Thread


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 07:29 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