Go to Post To me, every robot is a moving mechanical art form, a sculpture made of aluminum, motors and gears, and I think that soon we will be seeing those art forms involved in some of the most fantastic robotic "dances" that any of us have ever seen - DougHogg [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 27-03-2005, 11:45
dm0ney's Avatar
dm0ney dm0ney is offline
Will Code For Food (Food Optional)
AKA: Deepak Mishra
None #0217 (The ThunderChickens)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Shelby Twp., MI
Posts: 48
dm0ney will become famous soon enough
Send a message via AIM to dm0ney
Re: Setting Autonomous Settings from OI

We use a selector switch on the OI to choose from 8 different modes (2^3).

Because the OI button states arent gotten until AFTER the initialization, we could not populate our autonomous queueing system with different modes.

I solved that problem by going into main.c (the file you should never have to touch) and after the Process_Data_From_Master_uP(); call, inserting this code below:

Code:
...
Process_Data_From_Master_uP(); /* You edit this in user_routines.c */

if(flag)
{
//printf("AUTO FLAG");
tcr_autonomous_fill_queue();
flag = 0;
}

if(autonomous_mode)
{
...
The variable flag is an int that is declared and initialized to 1 at the start.
The flag = 0; means it will only run once.

I believe the same code could be inserted into Process_Data_From_Master_uP however, I did not try it and cannot verify that it works.

The best implementation of that in my mind would be to have a function called in that if statement that reads which mode it is from OI buttons and stores it into memory. Extern that variable over to user_routines_fast and use it with your current code. A switch statement or if statements?

Our autonomous code is a scripting / queue style so the only thing that ever changes is the list of commands in the queue as governed by tcr_autonomous_fill_queue(), enabling us to never have to touch our user_routines_fast.
__________________

Alumni
Team #217, The ThunderChickens



Student, Class of 2009
California Institute of Technology



Last edited by dm0ney : 27-03-2005 at 11:49.
Closed Thread


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 Warning to Human Players During Autonomous The Lucas General Forum 21 07-04-2005 02:29
Despite what IFI says, you can configure autonomous from OI... TedP Programming 19 31-03-2004 10:09
setting autonomous mode Allison Programming 10 08-03-2004 20:37
autonomous mode problem on field Chris_C Programming 17 26-03-2003 19:11


All times are GMT -5. The time now is 00:17.

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