Telling drivers station your alliance

You can ask the drivers station which alliance you are on (kRed, kBlue) but how do you tell the drivers station? Is it a wire on the competition port? I’d like to use this information to control which trailer to track with the camera but I’m reluctant to do it if I can’t test it. I’d hate to gamble that this function works and find out at the regionals that it doesn’t.

The simple thing for the field controller to know which alliance is which is the side to which it is wired. However, you will know which alliance you are on. A simple switch read by a digital or analog input can easily trigger your code to search for one color goal or the other.

Without further information being released by FIRST to the contrary, I’m guessing this signal is provided through the ethernet connection to the Field Management System(FMS). Because of this, there is no easy way to simulate this outside of an official FRC field. What I would recommend as an alternative is designing two sets of code, one with the alliance detection and one without, and run tests during practice day to see what the outcome is. However, on the positive side, if it is in the C++ libraries, I’m guessing it’s already been tested by the developers and working…

When in doubt,you could always ask on Q&A…

Yes, adding a switch to the robot or the driver’s station is easy enough but it is also easy to forget to set the switch in the heat of the competition and then your tracking is worse than useless. If you put the switch on the robot you lose the ability to correct is for the whole match. If lyou put it on the driver’s station, then the information doesn’t get to the robot during autonomous mode. Hopefully, the new field management system will allow driver station inputs during disabled mode.

That is why I’d like to use the built in alliance function.

It does get to the robot before autonomous mode, however. The joysticks and switches can be read while the robot is disabled, before the match begins.

(This assumes that the field control will work approximately the way it has for at least the past five years, with the state changing directly from teleoperated/disabled to autonomous/enabled, with no autonomous/disabled in between. If things have changed to be autonomous/disabled on powerup before the match starts, then a switch on the operator console won’t work.)

Also, don’t forget there is a User Swith on the cRIO that can be read from the code. That is how we are planning to set which alliance we are on.