|
Re: detecting your own alliance(C++)
Quote:
Originally Posted by nathanww
This is something I was wondering about the other day--is there a way for robots to determine what alliance they are on from the field control? This seems like it would be rather necessary if you wanted to hunt down opposing robots during the autonomous period.
|
This is written from memory but you should get the idea.
Code:
switch (DriverStation::GetInstance()->GetAlliance()) {
case DriverStation::kRed:
// red
break;
case DriverStation::kBlue:
// blue
break;
case DriverStation::kInvalid:
default:
// unknown
break;
}
__________________
John Downey
Lead Robot Inspector - Purdue IndianaFIRST District
Whitney Young Magnet High School/Robophins (FRC 4302) - Mentor (2013-current)
Midwest Regional Planning Committee - Member (2012-current)
Boilermaker Regional Planning Committee - Member (2011-2014)
Robot Inspector (2008-current)
Purdue FIRST Programs - Staff Advisor (2008-2011)
Lafayette-Jefferson High School/Precision Guessworks (FRC 1646) - Mentor (2006-2011)
|