Go to Post Attempted to like Andrew's comment and then realized this wasn't Facebook :P - afowl [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-04-2012, 17:03
trilogy2826's Avatar
trilogy2826 trilogy2826 is offline
Mentor - 2826
AKA: Jake Fischer
FRC #2826 (Wave Robotics)
Team Role: Mentor
 
Join Date: Nov 2008
Rookie Year: 2006
Location: Oshkosh, WI
Posts: 113
trilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond repute
Update Dashboard data prior to match start

Our team is new to the usage of C++ this year and so far it has been a very pleasant switch from LV. One of the things that we never had working properly (due to low priority) was the ability to send data to the driver station while not in isAutonomous or isOperatorControl. The desire is to get feedback for data such as air pressure from a transducer on an analog channel or amount of shoot delay from a potentiometer connected to the Cypress IO board before the match begins.

Once in either of these modes, data sent to the DS using DriverStation::GetInstance() -> GetLowPriorityDashboardPacker() (as outlined in the WPI example), then adding the data to a cluster is clean and consistent.

When using LabView this was easily accomplished using the PeriodTasks vi wrapper, and I can only imagine there is a similar structure and/or capability in C++. This request is mainly due to the lack in understanding on the C++ class and call structures in FRC.

For reference, we are using the standard LabView based dashboard. Any help on where to place these calls to send data while in would be greatly appreciated.
Reply With Quote
  #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
Reply


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 13:27.

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