View Single Post
  #3   Spotlight this post!  
Unread 16-02-2005, 16:03
Deetman Deetman is offline
Registered User
AKA: Kevin Dieterle
no team
 
Join Date: Apr 2004
Rookie Year: 2004
Location: Philadelphia, PA
Posts: 203
Deetman has a reputation beyond reputeDeetman has a reputation beyond reputeDeetman has a reputation beyond reputeDeetman has a reputation beyond reputeDeetman has a reputation beyond reputeDeetman has a reputation beyond reputeDeetman has a reputation beyond reputeDeetman has a reputation beyond reputeDeetman has a reputation beyond reputeDeetman has a reputation beyond reputeDeetman has a reputation beyond repute
Re: Receiving info from OI to select autonomous mode

Quote:
Originally Posted by CmptrGk
ok, so if we were to put the variables for autonomus switches in the Process_data_from_local_IO section the robot would never see these numbers while autonomus is enabled. im asking this becasue this is where i have the switches now and even there they are causing trouble. the way i have it set up, is that the values are read from four swiches. they are p4_sw_trig, p4_sw_aux1, p4_sw_aux2, and p1_sw_trig(due to that whole port duplication thing).

so if i had this code in Process_data_from_local_IO

if(p4_sw_trig == 0 && p4_sw_aux==0 && p4_sw_aux2== 0 && p1_sw_trig == 0)
{
auton_state = 0;
}

would these values never acutally get to the rc?

ive already lost to much sleep working on the code, i really want to finish it before atlanta comes around.

Just a quick reply here, but...

You need to make sure you grab the state of the switches in a seperate variable BEFORE autonomous mode is enabled or else you will lose your inputs. We did this in main.c last year and we are planning on doing it again this year.

An example of this can be found at http://www.osufirst.org/twiki/pub/OS...nalCode/main.c

Specifically:
Code:
autonomous_on = ( winchPneuSwitch == 1 ) ? 0 : autonomous_on;
We expanded upon this further for nationals last year, but I don't think I have that code readily available on the web.