|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Team Color Identification
Hello all,
As far as I understand, we should receive an indicator of what team we're on from the competition port on the Driver's Station. Does anyone know how to access this in our programming code or if this is even possible? (we're using c++) Thanks, Sarah Edit: I found it, but I will leave this posted as a refference for other teams. The Driver Station class contains an enumerated variable called "Alliance" with the values kRed, kBlue, and kInvalid. Last edited by legotech25 : 31-01-2009 at 13:19. |
|
#2
|
|||
|
|||
|
Re: Team Color Identification
You can get your team color by using the DriverStation class:
Code:
DriverStation ds; if(ds.GetAlliance() == DriverStation::kRed) // do something else if(ds.GetAlliance() == DriverStation::kBlue) // do something else else // WPI lib is broken as usual |
|
#3
|
||||
|
||||
|
Re: Team Color Identification
Anyone know a way to trick the robot into thinking it is on red or blue for testing purposes?
~DtD |
|
#4
|
||||
|
||||
|
Re: Team Color Identification
I wouldn't play with the competition port at all, I would just say use a switch, and see if receiving it from the DS actually works at competition
![]() |
|
#5
|
||||
|
||||
|
Re: Team Color Identification
if you know about classes, create a simple class
(this probably has bugs in it, but illustrates the point) Code:
class FakeDriverStation :private DriverStation
{
Alliance GetAlliance(){return DriverStation::kRed;}
};
//Code
//more code
//DriverStation DS;//make sure to uncomment this
FakeDriverStation DS;//and comment this before competition
switch(DS.GetAlliance())
{
...
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Does the Trackball Color Match your team Color??? | ZInventor | Kit & Additional Hardware | 14 | 07-03-2008 20:09 |
| Team Identification on Robot | 1337pcgamer | Rules/Strategy | 1 | 27-01-2006 17:59 |
| Determining Team Color | larwilliams | Programming | 4 | 30-03-2005 07:41 |
| Team Color | DrWorm | Control System | 1 | 02-02-2004 19:02 |
| Team Color LED's | Phil_Lutz | Technical Discussion | 4 | 18-01-2004 19:56 |