View Single Post
  #6   Spotlight this post!  
Unread 01-03-2009, 22:00
Travis Hoffman's Avatar Unsung FIRST Hero
Travis Hoffman Travis Hoffman is offline
O-H
FRC #0048 (Delphi E.L.I.T.E.)
Team Role: Engineer
 
Join Date: Sep 2001
Rookie Year: 2001
Location: Warren, Ohio USA
Posts: 4,047
Travis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond reputeTravis Hoffman has a reputation beyond repute
Re: Autonomous selection from dashboard

Quote:
Originally Posted by BigJ View Post
While 1675 was messing around with more autonomous routines at Midwest this weekend, we found out that (at least the way we were doing it) when you try to read the digital IO pins in autonomous, it takes them from the state they were at driver station boot.

If you go this route, make sure you thoroughly test your system and that drivers know of any special procedures they need to follow to choose the mode they want.

(We ended up not putting it in yet because we only used one autonomous routine.)

We implemented a similar select auto program from OI method as we've used in past years, except we didn't use the Driver Station's digital IO - instead, we used the left and right stick push buttons on our Logitech gamepad to select start position and program number, respectively:

(This is obviously Wind River code. The code resides in the "Disabled Periodic" routine.)

Code:
/* * Determine the autonomous start position and program number. 1 = NEAR, 2 = CENTER, 3 = FAR Use left stick push for start pos cycle; right stick push for program cycle. */
#define MAXPOS 3
#define MAXPROG 8
//starting position if (not autopos_sw) autostartlock = 0; if ( (autopos_sw) && (autostartlock == 0) ) { if (autostartpos < MAXPOS) { autostartpos++; } else { autostartpos = 1; }
autostartlock = 1; }
//autonomous program number if (not autoprog_sw) autoproglock = 0;
if ( (autoprog_sw) && (autoproglock == 0) ) {
if (autoprognum < MAXPROG) { autoprognum++; } else { autoprognum = 1; }
autoproglock = 1;
}
//Update the LCD Display
Write2LCD();



Write2LCD contains code which updates the nifty new user-writeable DS LCD display screen with robot info, including text descriptions of each auto program we run. Who needs a PC dashboard, anyway?
__________________

Travis Hoffman, Enginerd, FRC Team 48 Delphi E.L.I.T.E.
Encouraging Learning in Technology and Engineering - www.delphielite.com
NEOFRA - Northeast Ohio FIRST Robotics Alliance - www.neofra.com
NEOFRA / Delphi E.L.I.T.E. FLL Regional Partner