Go to Post If your robot can't play at least two matches on one battery, your mechanical design and/or driver strategy needs some rethinking. - Al Skierkiewicz [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 15-03-2012, 20:05
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
GetLocation() or GetAlliance()

Hello,

I am wondering how to use either of the two functions (GetLocation() or GetAlliance()) whic gets the location or alliance off of the Driver Station.

I want to make it so that I can have 2 or more different autonomous'. How would I fully implement this?

Thanks,
Davis
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present
Reply With Quote
  #2   Spotlight this post!  
Unread 16-03-2012, 10:16
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: GetLocation() or GetAlliance()

You can actually read the joysticks during disabled. I setup a snippet of code this week to read the driver joystick and check if the trigger is held for 3 seconds, and switch to a different autonomous routine.
For reference, here's that chunk out of my code
Code:
static Timer button_combo_timer;
if (BUTTON_COMBO_SWITCH_AUTONOMOUS() == true)
{
    button_combo_timer.Start();
}
else
{
    button_combo_timer.Reset();
    button_combo_timer.Stop();
}

if (button_combo_timer.Get() > 3.00)
{
    button_combo_timer.Reset();
    switch (autonomousMode)
    {
    case AUTONOMOUS_MODE_1:
        autonomousMode = AUTONOMOUS_MODE_2;
    break;
    case AUTONOMOUS_MODE_2:
        autonomousMode = AUTONOMOUS_MODE_3;
    break;
    case AUTONOMOUS_MODE_3:
        autonomousMode = AUTONOMOUS_MODE_1;
    break;
    }
}
switch (autonomousMode)
{
    default:
    case AUTONOMOUS_MODE_1:
    driverStationLCD->PrintfLine((DriverStationLCD::Line) 3, "Using 1");
    break;
    case AUTONOMOUS_MODE_2:
    driverStationLCD->PrintfLine((DriverStationLCD::Line) 3, "Using 2");
    break;
    case AUTONOMOUS_MODE_3:
    driverStationLCD->PrintfLine((DriverStationLCD::Line) 3, "Using 3");
    break;
}
driverStationLCD->UpdateLCD();
Reply With Quote
  #3   Spotlight this post!  
Unread 16-03-2012, 20:28
DavisC DavisC is offline
Registered User
FRC #0539 (Titans)
Team Role: College Student
 
Join Date: Jul 2011
Rookie Year: 2010
Location: Virginia
Posts: 200
DavisC is just really niceDavisC is just really niceDavisC is just really niceDavisC is just really nice
Re: GetLocation() or GetAlliance()

Interesting, where would I place that to read it before a match?

Thanks
__________________
FRC Team 539
Student Member: 2010 Breakaway - 2014 Aerial Assist
Mentor: 2015 Recycle Rush - present
Reply With Quote
  #4   Spotlight this post!  
Unread 22-03-2012, 11:39
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: GetLocation() or GetAlliance()

If your using iterative robot, in
Code:
void DisabledPeriodic(void){
}
I'm not sure if your using simple robot though
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:50.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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