|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Multi-Choice Autonomous
You're going to have to.
|
|
#2
|
||||
|
||||
|
Re: Multi-Choice Autonomous
If you take a look above, AGPapa shows a way where I don't have to.
|
|
#3
|
||||
|
||||
|
Re: Multi-Choice Autonomous
For me it is cleaner to use the boolean array conversion, instead having multiple case structures. AGPapa's examples are still valid. It's up to you to what you want to use.
|
|
#4
|
||||
|
||||
|
Re: Multi-Choice Autonomous
OK, thanks!
|
|
#5
|
|||
|
|||
|
Re: Multi-Choice Autonomous
You can use the Boolean bits however you like. Note that you can also name the switches on the DS so that the drive team knows what they are selecting. Just click on the field and give them a short name.
In the auto, you may want to account for unusual settings, illegal values, etc. In those cases, be sure to run something. A few things you may want to consider. Searching for the first True Boolean in the array gives you eight valid values (0 - 7) with good labels on the DS. Converting the Boolean array to a number is in the Numeric>>Conversion palette and it gives you 256 valid values (0-255). The encoding will be in binary and the DS will not read as well. You can use the sliders too, so if some of your programs vary only be a speed or a steering angle, you may want to use a slider instead. They can also be named on the DS. Greg McKaskle |
|
#6
|
||||
|
||||
|
Re: Multi-Choice Autonomous
Quote:
|
|
#7
|
|||
|
|||
|
Re: Multi-Choice Autonomous
Yes, each button has a text field to the right of it. It should store and retrieve those when you next launch the DS. They are stored in the ini file. The names are not sent to the robot, only the Boolean values.
Greg McKaskle |
|
#8
|
||||
|
||||
|
Re: Multi-Choice Autonomous
About how much text do you think I could put in each text field?
|
|
#9
|
|||
|
|||
|
Re: Multi-Choice Autonomous
If you have the DS, give it a try. In the first Button, I typed "About this much". It wrapped on the 'h'.
Greg McKaskle |
|
#10
|
||||
|
||||
|
Re: Multi-Choice Autonomous
No, sorry, I don't have the DS in front of me, but I get the picture: I only have space for 2 or 3 keywords.
|
|
#11
|
||||
|
||||
|
Re: Multi-Choice Autonomous
We are using another method based on the SD. We have a record and replay system that stores the driver & manipulator input to a file on the cRIO. Autonomous reads the selected file and populates the variables that control the robot. The drive team chooses the autonomous to run from our custom dashboard app before the start of the match.
In Begin.vi we populate the array of autonomous choices (custom file extension *.auto) and write it to the SD. In Dashboard Main.vi we read the array of choices and populate an enum ring's String Property with the file names. Autonomous then sends back the values it received so we know it got the correct values. |
|
#12
|
||||
|
||||
|
Re: Multi-Choice Autonomous
Here's yet another method if you don't like the DS buttons:
Set up a Enum text box on your dashboard and give each number value a corresponding label, showing your driver which program to use. ![]() Write the integer value to a SD variable and then in your autonomous mode, read the value and have a case structure select the correct program to run based simply on the integer value. ![]() When you set up your player station, select the correct program then leave the variable alone. As the match starts, it will read the variable from your dashboard once at the beginning of the Autonomous Period, then execute the correct program. Our team has used this method for two years and never had an issue. It's reliable and versatile, allowing for many different modes and configurations, as long as your drivers remember to check and make sure it's correct before the match starts XD. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|