I’m trying to figure out how a VEX V5 robot determines which team (red or blue) it is on during the autonomous period. I know the field control system manages when autonomous starts, but does it also send information about the alliance color?
If not, how do teams typically handle this? Do most teams use a pre-match selection on the V5 Brain, the controller, or something else? I’d love to hear what methods work best in competitions and example codes.
User code cannot determine what alliance side it is on when on match control. All that a robot brain knows is competition mode (driver vs. autonomous), whether or not it is disabled, and what type of field control it is connected to (whether that be competition switch or otherwise). Teams will usually either download different autonomous routes to multiple slots or have something in place for selecting a different route at runtime manually.
Smart field control does know which connected controllers belong to which alliance, because field controllers have dedicated ports for specific alliance colors. The field control brains also collect other statistics such as match time and firmware version through serial communication with the controller, but the actual robot brain likely never ends up getting this data. Even if it did, accessing it from user code wouldn’t be possible.
I guess you ccould use a Vision Sensor to examine the license plate color and then use that data and subtract it ( if VisionSensor1 sees Red) via a logic line of code it can detect that (in this case) it’s on the Blue alliance because the Vision Sensor sees Red. I hoped this helped your question!