Thread: disabledInit()
View Single Post
  #5   Spotlight this post!  
Unread 15-03-2014, 09:35
Daniel_LaFleur's Avatar
Daniel_LaFleur Daniel_LaFleur is online now
Mad Scientist
AKA: Me
FRC #2040 (DERT)
Team Role: Engineer
 
Join Date: Apr 2005
Rookie Year: 2003
Location: Peoria, IL
Posts: 1,967
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