Go to Post Ship day is a sweet and sour day. You're happy to see your robot ship, but then you start going through robot withdrawl - Schneidie [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, 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
  #2   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]
  #3   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
  #4   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
  #5   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
  #6   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

_
  #7   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
  #8   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.
  #9   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
  #10   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.
  #11   Spotlight this post!  
Unread 08-01-2007, 17:31
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
Re: I have a quistion about stopping the autonomous mode...

Quote:
Originally Posted by jgannon View Post
...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.
That, and a dongle is a good safety mechanism to have handy. We've had more than a few "runaway bots" during autonomous testing, especially when someone disconnected the shaft encoders while adjusting wiring.

Heck, I'm tempted to make a "deadman's switch" dongle for some of our tests.
  #12   Spotlight this post!  
Unread 08-01-2007, 22:01
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 kaszeta View Post
That, and a dongle is a good safety mechanism to have handy. We've had more than a few "runaway bots" during autonomous testing, especially when someone disconnected the shaft encoders while adjusting wiring.

Heck, I'm tempted to make a "deadman's switch" dongle for some of our tests.
Need I mention When Robots Attack?
  #13   Spotlight this post!  
Unread 08-01-2007, 22:42
bobmonkey836's Avatar
bobmonkey836 bobmonkey836 is offline
BobMonkey07
AKA: Jeff Powers
FRC #0836 (Robobees)
Team Role: Mentor
 
Join Date: Dec 2005
Rookie Year: 2005
Location: maryland
Posts: 39
bobmonkey836 is on a distinguished road
Re: I have a quistion about stopping the autonomous mode...

assume the worst. include a deadmans switch on the controller, just in case. that way, if the program works, you smile!
__________________
Solution to life's problems: "CTRL", "ALT", "DELETE".
"CTRL"+"Z" Saved my life.
Approximately Normal
2007 Annapolis Regional at USNA!!

Management is doing things right; leadership is doing the right things.
- Peter Drucker
  #14   Spotlight this post!  
Unread 08-01-2007, 22:59
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
Re: I have a quistion about stopping the autonomous mode...

I made it a general rule that loops are NOT allowed in our code. If a loop is messed up then you have big problems on your hand. Besides why have a loop inside a loop to do the same functions a state machine can do or a timer variable
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 13:20.

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