Utlizing the Driver Station to Assist Autonomous Mode

In the FRC Driver Station (under the Operation tab), is a Team Station drop down menu. The options in this drop down menu include the positions such as Red 1 and Blue 2. I am assuming that this enables to driver to input the position of his or her robot?

Also, in the Autonomous Independent framework, a Get Alliance vi has been provided and used. The vi can return the team alliance and field position of the robot.

Since our team is planning on writing a different code for each field position, we would like to know if there is a way to link these two? For example, is there a way to program our autonomous so that if the driver inputs ‘Red 3’ in the driver station, the code that we designate ‘Red 3’ will run?

If that is not an option, how would you reccomend handling various codes that depend on the robot’s position? Or are you all writing a general code that could work well in all positions?

Thank you! Hope I’ve made sense!

Not quite. It actually describes the position of the team’s driver station, not of the robot. During competition, it’s set by the Field Management System. You likely won’t be able to use the information for anything helpful.

Ah, I see.

So, it would be best to code one general autonomous sequence that could work for all three positions rather than attempting to create a seperate sequence for each position? Or are you aware of any other strategies that would allow us to include more than one autonomous sequence?

Thank you so much - that’s been a huge help. Our team has been wondering about its function for quite a while. (:

Switches or similar sensors either on the robot or on the driver station (value read during autonomous disabled and stored) are common ways to have multiple autonomous modes.

Before the match set the switches for the appropriate mode and you’re all set.

You will be able to have 2^(N) modes where N is the number of switches used.

You can use digital or analog inputs and a multiple-position switch to tell the robot what you want it to do. Or you can put a selector on your driver station and have the robot remember its state before the match begins so it can be used during autonomous. You could even put a configuration file on the cRIO with instructions for which routine to execute.

You can even use switches to set the number of seconds of delay you use in an autonomous with said switches. Could be useful for cooperation with alliance partners.

Looks like I beat Greg to this. You can also use the virtual I/O on the Dashboard, same functionality without all that messy hardware! (Note: I lovethe messy hardware…)

What the names of such switches or sensors? Or do you have any tutorials that would help me to better understand them?

Where would I get a multiple-position switch and how would I program that? Do you know where I could get some examples or tutorials to follow?

What are these switches called?

Thank you so much for all of the great advice, guys!

By putting the necessary code into the “Disabled” VI, you can create a small VI to use joystick buttons to increment a global variable. Use that global variable in your autonomous VI to select the routine you want to run. You can feed this back to either a custom dashboard, or use the “User Messages” VI (which feeds back to the user display in the lower left of the driverstation) so you can actively watch what you’re selecting.

In this manner you don’t need to build any switch, and can select the routine to run after your drivers hook everything up on the field and turn the robot on.

Remember: Disabled only means that outputs on the robot aren’t set. Your code in the disabled VI is still running, so you can do work there.

how could you use joystick buttons to increment a global variable?