Go to Post Improve yourself. Try not to tear others down. - Tom Line [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
  #1   Spotlight this post!  
Unread 06-01-2007, 12:56
razer razer is offline
Registered User
FRC #1690
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 24
razer is an unknown quantity at this point
I have a quistion about stopping the autonomous mode...

Hello

At the beggining of every round we have 15 seconds of autonomous code, and it need to be stopped somehow... Right?
This is my question: How to stop it? should I write at the end of the autonomous code in the "user_routines_fast.c" under
"User_Autonomous_Code()" the next line:

autonomous_mode=0;

thanks a lot,
Nir.
  #2   Spotlight this post!  
Unread 06-01-2007, 13:24
teh_pwnerer795 teh_pwnerer795 is offline
Registered User
AKA: !!Mitch!!
FRC #1392
Team Role: Programmer
 
Join Date: Nov 2006
Rookie Year: 2006
Location: Ajax, Canada
Posts: 142
teh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really niceteh_pwnerer795 is just really nice
Send a message via MSN to teh_pwnerer795 Send a message via Yahoo to teh_pwnerer795
Re: I have a quistion about stopping the autonomous mode...

you dont need to stop the auto mode... when u are at the competition.. ur I/O controller is hooked up to their computer...and they'll switch it on... .. if the switch is on... then User_Autonomous_Code(void) will be running... if the switch is off... then the User_Autonomous_Code(void) will not be running...

on the I/O u can trigger auto mode by connecting pins 5 and 8, i believe, on the port called "competition"

let me noe if that helps u
__________________
Great Art is Created; Master Pieces are Stolen

[n00b]Teh_Foxdonut teh_pwnerer795 - CounterStrike:Source
  #3   Spotlight this post!  
Unread 06-01-2007, 13:25
Davx's Avatar
Davx Davx is offline
Davux
AKA: Dave Amenta
FRC #0195 (Cyber Knights)
Team Role: Alumni
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Southington, Connecticut
Posts: 16
Davx will become famous soon enoughDavx will become famous soon enough
Send a message via AIM to Davx Send a message via MSN to Davx
Re: I have a quistion about stopping the autonomous mode...

User_Autonomouse_Code() gets called every loop until the flag set by the Master Proc is unset. You don't need to worry about ending your mode, it is done for you by the function no longer being executed. Get_Data_From_Master_uP() in User_Routines.c will be called once autonomous mode is over.
__________________
--David Amenta - Dave Amenta .com - Person Meets Profession
  #4   Spotlight this post!  
Unread 06-01-2007, 13:43
razer razer is offline
Registered User
FRC #1690
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Israel
Posts: 24
razer is an unknown quantity at this point
Re: I have a quistion about stopping the autonomous mode...

ok thanks... so i just need to write my code, and it will be ended automaticly? i wont have to end it? ok... that really helps.

thanks again, Nir.
  #5   Spotlight this post!  
Unread 06-01-2007, 14:13
Alexa Stott's Avatar
Alexa Stott Alexa Stott is offline
All I do is twin.
AKA: elixir
FRC #0025 (Raider Robotix)
Team Role: College Student
 
Join Date: Oct 2005
Rookie Year: 2006
Location: No. Bruns., NJ/College Park, MD
Posts: 781
Alexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond repute
Send a message via AIM to Alexa Stott
Re: I have a quistion about stopping the autonomous mode...

For testing, you can just get a dongle to plug into the competition port on your Operator Interface to turn the autonomous mode on and off.
__________________
|Email:alexastott[at]gmail.com|Facebook|@zelixir|Google+|
[University of Maryland Computer Science, Psychology]
[Brunswick Eruption]
  #6   Spotlight this post!  
Unread 06-01-2007, 15:04
Davx's Avatar
Davx Davx is offline
Davux
AKA: Dave Amenta
FRC #0195 (Cyber Knights)
Team Role: Alumni
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Southington, Connecticut
Posts: 16
Davx will become famous soon enoughDavx will become famous soon enough
Send a message via AIM to Davx Send a message via MSN to Davx
Re: I have a quistion about stopping the autonomous mode...

IFI has the pinout for the competition port available Here (PDF), if you'd like to construct a dongle. We used a dongle on 195, but I've heard it's just as easy (in a pinch anyway) to stick a wire between the pins to access disable or autonomous mode.

razer: Are you familiar with how programming for the FRC works? it's loop-based, not like any entry-level desktop programming (Visual Basic, .Net, PHP) you might have done. The loop is called every 23.6ms (is about, it's been a while). so your code is executed every loop, and when autonomous mode is over, the loop is no longer called.
__________________
--David Amenta - Dave Amenta .com - Person Meets Profession
  #7   Spotlight this post!  
Unread 06-01-2007, 15:05
Alexa Stott's Avatar
Alexa Stott Alexa Stott is offline
All I do is twin.
AKA: elixir
FRC #0025 (Raider Robotix)
Team Role: College Student
 
Join Date: Oct 2005
Rookie Year: 2006
Location: No. Bruns., NJ/College Park, MD
Posts: 781
Alexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond reputeAlexa Stott has a reputation beyond repute
Send a message via AIM to Alexa Stott
Re: I have a quistion about stopping the autonomous mode...

Quote:
Originally Posted by Davx View Post
razer: Are you familiar with how programming for the FRC works? it's loop-based, not like any entry-level desktop programming (Visual Basic, .Net, PHP) you might have done. The loop is called every 23.6ms (is about, it's been a while). so your code is executed every loop, and when autonomous mode is over, the loop is no longer called.
So basically, refrain from using loops within your code. You will not get the intended results.
__________________
|Email:alexastott[at]gmail.com|Facebook|@zelixir|Google+|
[University of Maryland Computer Science, Psychology]
[Brunswick Eruption]
  #8   Spotlight this post!  
Unread 06-01-2007, 15:08
Davx's Avatar
Davx Davx is offline
Davux
AKA: Dave Amenta
FRC #0195 (Cyber Knights)
Team Role: Alumni
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Southington, Connecticut
Posts: 16
Davx will become famous soon enoughDavx will become famous soon enough
Send a message via AIM to Davx Send a message via MSN to Davx
Re: I have a quistion about stopping the autonomous mode...

Correct, you (almost) never want to use a while loop in your code, since that's not how the logic is setup. The program is based on each loop getting new data from the OI at the beginning, and setting the outputs at the END, and ONLY at the end. (Yes you could call putdata yourself, but lets not go there) A while loop will do nothing but lock up your program and eventually the watchdog timer will shut off the User proc and you'll get a code error indicator.
__________________
--David Amenta - Dave Amenta .com - Person Meets Profession
  #9   Spotlight this post!  
Unread 06-01-2007, 15:15
Davx's Avatar
Davx Davx is offline
Davux
AKA: Dave Amenta
FRC #0195 (Cyber Knights)
Team Role: Alumni
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Southington, Connecticut
Posts: 16
Davx will become famous soon enoughDavx will become famous soon enough
Send a message via AIM to Davx Send a message via MSN to Davx
Re: I have a quistion about stopping the autonomous mode...

razer et al: These programming PowerPoints explain some of the basic concepts of programming for the FRC. They are somewhat outdated as they seem to apply to the 2004 controller mostly, but the only real difference between the 2006/7 is a memory upgrade. These PowerPoints go through how the programming structure works, and some important things to know about.
__________________
--David Amenta - Dave Amenta .com - Person Meets Profession
  #10   Spotlight this post!  
Unread 07-01-2007, 16:57
charrisTTI charrisTTI is offline
Ramblin' Wreck
AKA: Charles Harris
FRC #0623
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Vienna, VA
Posts: 106
charrisTTI has a spectacular aura aboutcharrisTTI has a spectacular aura about
Send a message via AIM to charrisTTI
Re: I have a quistion about stopping the autonomous mode...

Look in main.c to see how the switch from autonomous to operator control is performed.
__________________
FRC 623 2003,2004,2005,2006,2007,2008, 2009, 2010, 2011
FRC 1900 2007
FVC 60 and 193 2006
FVC 3271 2007
FTC 226 and 369 2008, 2009, 2010, 2011
FTC 3806 2010
  #11   Spotlight this post!  
Unread 07-01-2007, 17:05
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Re: I have a quistion about stopping the autonomous mode...

Quote:
Originally Posted by Davx View Post
We used a dongle on 195, but I've heard it's just as easy (in a pinch anyway) to stick a wire between the pins to access disable or autonomous mode.
...but don't make a habit of doing it that way. Get a dongle. Build one yourself, or order Andymark's. The competition port is not fused, and some pins are connected directly to the processor in the OI. If you touch the wrong two pins together, you may damage the OI.
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_
  #12   Spotlight this post!  
Unread 07-01-2007, 19:35
Davx's Avatar
Davx Davx is offline
Davux
AKA: Dave Amenta
FRC #0195 (Cyber Knights)
Team Role: Alumni
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Southington, Connecticut
Posts: 16
Davx will become famous soon enoughDavx will become famous soon enough
Send a message via AIM to Davx Send a message via MSN to Davx
Re: I have a quistion about stopping the autonomous mode...

Hence 'in a pinch.'
__________________
--David Amenta - Dave Amenta .com - Person Meets Profession
  #13   Spotlight this post!  
Unread 07-01-2007, 21:53
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: I have a quistion about stopping the autonomous mode...

main.c determines how the autonomous code and the user code is called.

The autonomous routine actually has it's own internal loop (at least it did previously). The key is that the loop calls getdata() and putdata().

If you're new to this, just stick with this: never use a for() or a while().

If you've done this before: use only very short (eg, to iterate through an array of 5) for() and while()'s.

If you know what you're doing: just ignore me and do your thing.
  #14   Spotlight this post!  
Unread 08-01-2007, 15:30
Davx's Avatar
Davx Davx is offline
Davux
AKA: Dave Amenta
FRC #0195 (Cyber Knights)
Team Role: Alumni
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Southington, Connecticut
Posts: 16
Davx will become famous soon enoughDavx will become famous soon enough
Send a message via AIM to Davx Send a message via MSN to Davx
Re: I have a quistion about stopping the autonomous mode...

Astronouth7303: You can use for() and while() loops much longer than 5 executions. The watchdog timer doesn't seem to fire for a good 10ms or so. You can loop through more than 300 elements and write strings for each of them before the RC will reset itself. I'd be interested in knowing what the actual timeout is, but I don't have access to an RC this year.
__________________
--David Amenta - Dave Amenta .com - Person Meets Profession
  #15   Spotlight this post!  
Unread 08-01-2007, 16:44
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: I have a quistion about stopping the autonomous mode...

Quote:
Originally Posted by Davx View Post
Astronouth7303: You can use for() and while() loops much longer than 5 executions. The watchdog timer doesn't seem to fire for a good 10ms or so. You can loop through more than 300 elements and write strings for each of them before the RC will reset itself. I'd be interested in knowing what the actual timeout is, but I don't have access to an RC this year.
Yes, I'm quite aware of that. See the third item.
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
Autonomous mode... to the max Total Meltdown Programming 16 18-01-2006 22:19
How do I enter the Autonomous mode? CompMaster Programming 5 17-02-2005 19:12
A little question about the autonomous mode Anton Programming 4 18-01-2005 14:08
Anybody have a code for an autonomous mode to go to the 50 point bar???? and... chaoticprout Programming 9 06-11-2004 12:22
counting in seconds for the autonomous mode?? Pattyta Programming 22 31-03-2004 12:55


All times are GMT -5. The time now is 08:37.

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