View Single Post
  #2   Spotlight this post!  
Unread 22-04-2012, 20:29
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: Update Dashboard data prior to match start

The method to do this is slightly different depending on if you're using SimpleRobot or IterativeRobot, but the idea is pretty much the same. In addition to the Teleop and Autonomous states, there is a Disabled state. You can put the Dashboard calls into this code.

For SimpleRobot: The template Wind River gives you will not exit from Autonomous or OperatorControl when disabled, you'll probably want to change this. Add IsEnabled() to the check for the while loop (ie while (IsOperatorControl()) becomes while (IsOperatorControl() && IsEnabled()). Now, make a new function Disabled(). It should look something like this:
Code:
...
void Disabled(void)
{
   while (IsDisabled())
   {
       // Dashboard code goes here
       Wait(0.005); // Adjust this if you'd like to
   }
}
...
IterativeRobot: Much simpler here. The system will automatically transition to DisabledPeriodic() for you. Create that function and put your dashboard code in it (it should come out looking similar to TeleopPeriodic)

Good luck to you
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"
Reply With Quote