Go to Post Weight down low is a good thing. Weight up high is not. - s_forbes [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #20   Spotlight this post!  
Unread 30-03-2004, 17:48
TedP TedP is offline
Registered User
#1014
 
Join Date: Mar 2004
Location: Dublin, OH
Posts: 19
TedP will become famous soon enough
Re: Despite what IFI says, you can configure autonomous from OI...

Quote:
Originally Posted by Phil_Lutz
If I'm hearing you right, what you are saying is I can have these switches on my OI (say port3) and read them in Disabled mode and act on then when not disabled.
You ARE hearing me right. It's important that you need to SAVE the state before going into autonomous mode. Autonomous mode DOES NOT MAINTAIN the state of the OI inputs. It clears them. That's why it's important to save.

There's a working example here:

http://www.osufirst.org/twiki/bin/vi...04RegionalCode

More specifically, in main.c, when **NOT** in autonomous mode:

Quote:
int autonomous_on = 1;

void main()
{
...
autonomous_on = ( winchPneuSwitch == 1 ) ? 0 : autonomous_on;
}
That is, in the main.c the autonomous_on is set to 1 as a default. winchPneuSwitch is set to 0 while in autonomous mode -- Getdata() does that.

So our main.c just sits and churns while disabled and waits for winchPneuSwitch to get set to 1. If it gets set to 1 even for an instant, it LATCHES that data in. The autonomous code can then basically say:

Quote:
if( autonomous_on )
{
do autonomous code
}
else
{
do something else (just sit?)
}
Additionally, we never were planning on doing anything in autonomous until competition. So we never had any switches anywhere. We show in this example we use a switch designed for a "winch pneumatic" to set our autonomous mode bit. We don't even need special hardware on the OI to set this -- we can just use switches already have.

Additionally, we don't enable immediately after autonomous mode -- we wait for the user to hit a button. So it's okay to leave these switches in a bad state because the driver can set them back before "enabling" the robot.

I hope that helps.
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
A better autonomous method.. randomperson Programming 4 24-02-2004 18:02
IFI Loader Problems BrendaB Programming 3 24-01-2004 22:45
variable? manodrum Programming 11 01-04-2003 17:20
autonomous mode problem on field Chris_C Programming 17 26-03-2003 19:11
Autonomous Kill Switch UCGL_Guy Programming 8 15-01-2003 17:39


All times are GMT -5. The time now is 15:43.

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