Go to Post I walk through the door, and suddenly the field breaks down. It must be my magnetic personality. - Swan217 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 04-22-2012, 08:29 PM
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
 


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 10:23 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