Is it possible in anyway in labview to either take a switch or button on the robot itself to switch between different autos? I want to use this solely so our team will be able to adjust depending on where the obstacles are. If you know of anyway to make this happen please voice your help.
You can set it on your DS before the match starts
http://wpilib.screenstepslive.com/s/4485/m/26401/l/255419-choosing-an-autonomous-program-from-smartdashboard
I am using labview so this makes no sense to me.
Are you able to use this if i program in labview or is it only for java?
The SmartDashboard is java. However, LabVIEW has it’s own customize-able dashboard. It can be created by selecting FRC Dashboard Project under new in the initial screen when you launch LabVIEW. You can send data between the robot and dashboard by using the VIs in the Dashboard section of the WPI library.
There are couple of LabVIEW examples for a robot mounted switch here, but it just depends on what kind of electrical switch you choose.
You can also use the default LabVIEW Dashboard to choose an autonomous mode. Examples are on the Basic tab of the Dashboard and have corresponding code in the default project.
In years past, whenever I wanted to do an auto-selector for our robots, I would use a 2-way switch(Up is an increment, down is an decrement) on the DS which is read in the LV code with a DS-Read Integer with a integer case selector. That case then corresponds to a specific auto.
I also have that int selector display the auto that you will run on the DS for the driver’s convenience.
Wish I could post code snippets, but my LV is currently updating on this computer for the season.
Last year we used a RioDuino with touch screen to do just that. The screen also displayed diagnostics info.
Can you explain to me how this integrates with the RoboRIO? i have no experience with having anything other than the roborio for processing things.
I have done multiple auto modes before on a robot in C++, but I will try and generalize it for you so that you can port it over to labview. If you are wanting a physical switch (I. E. not dashboard), during your auto loop, you have an IF statement checking whether the switch is on or not. Within the IF statement, you put your autonomous code or function. You can have multiple IF statements for multiple auto modes, and you can check all switches in the IF statement (i.e. if Switch 1 is off and switch 2 is on and switch 3 is on (3 switches is just an arbitrary number) it can be a different auto than if all switches are on).
Last year I had 10 different auto modes using Labview… You can modify the dashboard to display infos about each and to send/receive data… I’m trying to get a screenshot of it…
EDIT : Got the picture :http://frci.weebly.com/uploads/5/3/4/2/53422957/3639071_orig.png
Our programming subteam discussed this issue at length Saturday. some dip switches would allow you to select one of any number of autonomous modes you wanted to run. Your first step in autonomous would be to poll the switches and then proceed to the selected mode. I know that’s over simplified, but that was the gist of our discussion.
Why wouldn’t your guys do it on the computer with a selector in the driver station? Way simpler and you can change the number of modes at any time…
I have used the driver station way of doing things, with fairly good success. If you do not have strong coders you could always hook switches to the DIO ports and “Code in” your autonomous mode. You can enter binary and have your field team carry a cheat sheet.
If someone needs help with having multiple autonomous modes on a Labview driver station, PM me We could discuss/skype about it…
I think i got it but if i run into any problems i will give you a call.
Last year we used a toggle switch which plugged into the DIO ports on the rio. we would flip the switch to run the code for that particular orientation on the field. This year we are going to work with an analog dial. However I’d love to try to incorporate this into the driver station.
There are multiple methods of doing this task. Our thinking was that with the changing field elements and changing start positions, it would be just as easy to set the switches when the robot was placed on the field. We’ve coded multiple routines in the past. It was just one of many options.
I am always concerned about game day operation with respect to the use of the driver station software. If there was a bug, or the laptop got hung up it may cause a problem with operation. On the other hand the switches always work. It all depends on your comfort level.
In my three years I’ve programmed and driven with all three methods: switches on robot, physical switches on the control panel, and a virtual dashboard selector. Personally, I like physical switches on the control panel the best because you can set it really quickly (no need to fiddle around getting the cursor to the right spot) and you can make the change after you put your robot on the field (for last minute strategy changes). I know in 2014 we made last minute changes a number of times (to run or not to run) that we otherwise wouldn’t have been able to make. But to each his own.