Thread: disabledInit()
View Single Post
  #9   Spotlight this post!  
Unread 15-03-2014, 23:14
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 : 15-03-2014 at 23:18.