Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   FRC Control System (http://www.chiefdelphi.com/forums/forumdisplay.php?f=176)
-   -   How to determine which alliance you are on? (http://www.chiefdelphi.com/forums/showthread.php?t=73015)

aeasson 26-01-2009 22:44

How to determine which alliance you are on?
 
Will there be a way that the autonomous mode software can use some information from the tournament control system to determine which alliance a robot is on? In other words how can we find out which target our camera should track without a downloading a new program at the start of each game?

Thanks

Jared Russell 26-01-2009 22:46

Re: How to determine which alliance you are on?
 
I too am interested in the answer to this question. It would eliminate the possibility of flipping the autonomous mode switch the wrong way...

IndySam 26-01-2009 22:48

Re: How to determine which alliance you are on?
 
You will get a match schedule that will list which alliance color you are on for each match. That's how you will know.

whytheheckme 26-01-2009 22:52

Re: How to determine which alliance you are on?
 
The typical way that this is done is through a switch mounted on your robot, which you set based on the alliance that you are on during that match. Your autonomous program then reads in the value of that switch at the start, and determines what camera code to load (or whatever it is that you're doing.)

I am however, interested in finding out if there is a way to get the alliance information from packets available to users from the field. I know this would take a lot of thought and picking through information, but I wonder if it's possible.

But the short answer is to simply use a switch.

Jacob

MattD 26-01-2009 23:00

Re: How to determine which alliance you are on?
 
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.

PhilBot 26-01-2009 23:10

Re: How to determine which alliance you are on?
 
There is a simmilar vi in the pending update . It gives alliance color and team position ( which I assume means the driver position)

aeasson 26-01-2009 23:13

Re: How to determine which alliance you are on?
 
Thanks
The C++ code is the type of information I am looking for.
Can I get to similar data within Labview?

MattD 27-01-2009 00:33

Re: How to determine which alliance you are on?
 
1 Attachment(s)
Quote:

Originally Posted by PhilBot (Post 808672)
There is a simmilar vi in the pending update . It gives alliance color and team position ( which I assume means the driver position)

Quote:

Originally Posted by aeasson (Post 808673)
Thanks
The C++ code is the type of information I am looking for.
Can I get to similar data within Labview?

I just installed Update 3 and I see there is now WPI Robotics Library > DriverStation > GetAlliance.vi.

rsisk 27-01-2009 00:48

Re: How to determine which alliance you are on?
 
We are using USER1 switch on the cRIO to switch the alliance. See the picture for an example


Jared Russell 27-01-2009 07:19

Re: How to determine which alliance you are on?
 
Quote:

Originally Posted by MattD (Post 808656)
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.

Nice! Thanks for the info.

aeasson 27-01-2009 20:35

Re: How to determine which alliance you are on?
 
Thanks for the help
I am downloading update #3 and will try the Get Alliance vi on Thursday.

billbo911 28-01-2009 00:56

Re: How to determine which alliance you are on?
 
1 Attachment(s)
Quote:

Originally Posted by MattD (Post 808717)
I just installed Update 3 and I see there is now WPI Robotics Library > DriverStation > GetAlliance.vi.

With the new vi you should be able to just replace the "Friend colors" enum with case structure and the "Get Alliance" vi. For testing, just use a switch on the console.
Below is the mod we will try.

AlexD744 29-01-2009 16:30

Re: How to determine which alliance you are on?
 
Just something I noticed is that a switch is still helpful if you have several different types of autonomous programming depending on how you want to work with your alliance. I know that at Tempest N' Tampa, it would have been a mess if we and Pink only had a start position in the middle. But thankfully, Pink had 7 different autonnomous modes while we had 4. They were all lot more diverse in their modes, but we try.


All times are GMT -5. The time now is 05:20.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi