Take a look at DriverStation::GetAlliance.
From DriverStation.cpp:
Code:
DriverStation::Alliance DriverStation::GetAlliance()
{
if (m_controlData->dsID_Alliance == 'R') return kRed;
if (m_controlData->dsID_Alliance == 'B') return kBlue;
wpi_assert(false);
return kInvalid;
}
If you look in NetworkCommunication/FRCComm.h, it seems that both alliance and position information is available in the control data packets.
Code:
struct FRCControlData{
...
char dsID_Alliance;
char dsID_Position;
...
};
Assuming this works properly, you should be able to use this on the field to determine your alliance color without a physical switch.