Hello everybody,
I would like to be able to have an enumerated constant on the dashboard to switch between the different autonomous codes that I have. I am using a case structure to flip between codes. I can hook an enumerated constant directly to the case structure, but I would like to make it a global variable so as to reference it from the dashboard. Is it even possible to reference autonomous independent vi to the dashboard in the basic framework?
Through the basics I learned through our programers, the only effect the control box has on autonomous is the disable. We just use switches on the robot because they work and there’s a lot less hassle for the robot to identify the code you want it to use and it is faster to install on the robot and the code writing seems to be easier. If you really want to try keep people updated because our team had a mentor that tried to but couldn’t figure it out and just reverted back to the switches on the robot.
I may be wrong, but I thought that you couldn’t use a computer for input during competition? Wouldn’t a control on the dashboard be useless if you can’t use it? Am I missing something?
Why not use a switch wired to the DIO pins of the DS? That’s what I plan on doing for autonomous mode selection. I would rather have switches on the control board than on the robot. That way I can check right before the match and be absolutely sure, plus I plan on putting a bunch of other stuff with it, LEDS and the like. Maybe a 7seg if I get really bored between now an Mar 26.
While 1675 was messing around with more autonomous routines at Midwest this weekend, we found out that (at least the way we were doing it) when you try to read the digital IO pins in autonomous, it takes them from the state they were at driver station boot.
If you go this route, make sure you thoroughly test your system and that drivers know of any special procedures they need to follow to choose the mode they want.
(We ended up not putting it in yet because we only used one autonomous routine.)
Well, if input isn’t allowed, that does make it slightly easier. Now I just need to find out how to wire a boolean to an actual switch or potentiometer on the DIO of the DS. btw, I am not only the programmer this year, but I am also the electrician and driver. Keeping myself up to date should be easy.
We implemented a similar select auto program from OI method as we’ve used in past years, except we didn’t use the Driver Station’s digital IO - instead, we used the left and right stick push buttons on our Logitech gamepad to select start position and program number, respectively:
(This is obviously Wind River code. The code resides in the “Disabled Periodic” routine.)
[LEFT][size=2]/*[/size]
[size=2]* Determine the autonomous start position and program number.
1 = NEAR, 2 = CENTER, 3 = FAR
Use left stick push for start pos cycle; right stick push for program cycle.
*/[/LEFT]
[/size]**[size=2]#define [/size]**MAXPOS 3[LEFT]
[LEFT]**[size=2]#define [/size]**MAXPROG 8 [/LEFT]
[LEFT][size=2]//starting position[/size]
**[size=2]if[/size]** (**[size=2]not[/size]** autopos_sw) autostartlock = 0;
**[size=2][/size]**
**[size=2]if[/size]** ( ([size=2]autopos_sw[/size]) && ([size=2]autostartlock[/size] == 0) )
{
**[size=2][/size]**
**[size=2] if[/size]** ([size=2]autostartpos[/size] < MAXPOS)
{
[size=2] autostartpos[/size]++;
}
**[size=2] else[/size]**
{
[size=2] autostartpos[/size] = 1;
}[/LEFT]
[LEFT][size=2] autostartlock[/size] = 1;
}[/LEFT]
[LEFT][size=2]//autonomous program number [/size]
**[size=2]if[/size]** (**[size=2]not[/size]** autoprog_sw) autoproglock = 0;[/LEFT]
[LEFT]**[size=2]if[/size]** ( ([size=2]autoprog_sw[/size]) && ([size=2]autoproglock[/size] == 0) )
{[/LEFT]
[LEFT]**[size=2] if[/size]** ([size=2]autoprognum[/size] < MAXPROG)
{
[size=2] autoprognum[/size]++;
}
**[size=2] else[/size]**
{
[size=2] autoprognum[/size] = 1;
}[/LEFT]
[LEFT][size=2] autoproglock[/size] = 1;[/LEFT]
[LEFT]}[/LEFT]
[LEFT][size=2]//Update the LCD Display[/size][/LEFT]
Write2LCD();
Write2LCD contains code which updates the nifty new user-writeable DS LCD display screen with robot info, including text descriptions of each auto program we run. Who needs a PC dashboard, anyway?
[/LEFT]
Now THAT is really cool! If I could assign a button on the left most joystick to toggle between autonomous codes, that would be !@#$ hot! How would you go about using the LCD of the DS in LabView?
Wow, that is really useful! Thank you so much!
The protocol for the dashboard allows only communication from the cRIO to the DS.
We attached to switches to the digital input on the DS. These are read in disabled mode and set a global variable in Labview. We use 2 switches to select driver mode (2 switches, 4 choices, switched between Arcade, Tank, Tank Drive on a Gamepad and two stick arcade). We have three switches for auto mode selection which gives us 8 possible auto modes. The selected switches are displayed on the driver station, driver selection is on the front page, and auto mode is on the second page of display.