Log in

View Full Version : Determining Team Color


larwilliams
28-03-2005, 12:43
Hi,

I tried searching for this in the forums so please excuse me if I simply missed it...

Is there any way to determine programmatically which team color you are assigned? This is for autonomous mode programming...mirrored on opposite side of playing field.

Thanks. Larry

kevin.li.rit
28-03-2005, 12:58
Not sure about that but another way you can get around this is to wire up a switch to the Robot Controller to correspond to which side your robot is on.

Mark McLeod
28-03-2005, 13:15
Is there any way to determine programmatically which team color you are assigned? No. The team/alliance color is not accessable from your program.
We too use a red/blue switch of our own that the coach or driver sets before the start of the match.

Tom Bottiglieri
28-03-2005, 13:47
An easy way to set team color without adding any switches to your bot is to use the wheel on the older flight stick joysticks if you are using those. The wheel isnt used for any normal robot control, so you can say turn it all the way forward for blue, and all the way backward for red. Then, in your code say:

if(p1_wheel > 210) color = blue;
else color=red;
In this the color would default to red, unless the wheel was turned towards the front.

larwilliams
30-03-2005, 07:41
Thanks to all that have responded.

It seems that a simple toggle switch is the way to go to set team color for programming purposes. We already have a 3 position switch that we are using to specify left, center, right starting position for autonomous mode...

Larry