Go to Post Sometimes I think all the Game Hint does to us is make us terrible listeners. - Chris is me [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 20-02-2004, 21:10
actorindp actorindp is offline
Registered User
#0270
 
Join Date: Jan 2004
Location: Long Island, New York
Posts: 11
actorindp is on a distinguished road
Lightbulb Answers for Dead Reckoning... FOR BEGINNERS

Figured I'd throw in my 2 cents.
I don't know C, I'm just flying by the seat of my pants manipulating code. So hopefully this post will help out others like me, the ones that are just trying to get by.

First start by creating the interrupt timer. Use the Innovation First White Paper to do this. http://www.innovationfirst.com/FIRST...004-Jan-14.pdf

The only thing i didnt use was the t25msdelay, theres no need to. I also just changed the printf statement to show the value of secondCount , nothing more.

If everything works you should now just have a basic second timer, however you might see it moves a lot quicker than 1 second. At least mine does... (hopefully this occurs across the board or the rest of this post means crap)

It actually moves in quarter second intervals. So every tick is .25 of a second.

Then just start creating if statements to drive yourself around.

Your last if statement should read something like this;

if (secondCount > 60) since the timer goes at quartersecond intervals, theres your 15 seconds. You might want to bring it down to say 56 or what have you just to play it on the safe side. at that statement you can turn off the timer and continue the rest of your program.

Once I get back to the bot on monday I'm gonna start some trial and error on our replica field. I'm gonna use a joystick button to start and stop the timer and movement so I can plug those values in the code.


Like I said before, I don't know what I'm doing. This is a very basic approach, heck I'm not even sure if It'll work , but I'd figure I'd put in my two cents, so other teams in my position can have a starting point for dead reckoning.

Enjoy!!

-Nick

Be glad to try and help, gimme a shout!
AIM: Actorindp

Please, if you have anything to add don't hesitate to post!!
  #2   Spotlight this post!  
Unread 20-02-2004, 21:30
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Answers for Dead Reckoning... FOR BEGINNERS

Im not sure a quarter second is fine enough resolution for doing dead recogning code - when you are turning a quarter second is a long time

its very easy to have a variable that you increment everytime you loop through your auton code, and use that as a rough timer - if it increments in the main loop it will have a 26mS period - If you increment it in the user_fast code it will be even smaller (I forget the period off the top of my head)

and you dont have to mess with interrupts that way.
  #3   Spotlight this post!  
Unread 20-02-2004, 21:33
actorindp actorindp is offline
Registered User
#0270
 
Join Date: Jan 2004
Location: Long Island, New York
Posts: 11
actorindp is on a distinguished road
Re: Answers for Dead Reckoning... FOR BEGINNERS

Well, remember I don't know what I'm doing. hehehehe
It seems simple enough, and seems to work.

But you also dont have to put ur drive motors at full (255 or 0 depending on direction) for that quarter of a second.

It's all about tweaking.

-Nick

Last edited by actorindp : 20-02-2004 at 21:36.
  #4   Spotlight this post!  
Unread 20-02-2004, 21:46
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: Answers for Dead Reckoning... FOR BEGINNERS

if you want to use the HW timers thats great - my only point is you might want finer resolution on the interval period

remember that there will be a bot coming towards the center of the field from the other direction - you should try to get their first, so it doesnt get in your way and prevent you from reaching your release ball

and if you are running your motors at low speeds and something is in your path, you wont have any chance of pushing it out of your way
  #5   Spotlight this post!  
Unread 20-02-2004, 21:47
actorindp actorindp is offline
Registered User
#0270
 
Join Date: Jan 2004
Location: Long Island, New York
Posts: 11
actorindp is on a distinguished road
Re: Answers for Dead Reckoning... FOR BEGINNERS

All great points.
Something I'll def. try to keep in mind when I'm trying to code it on monday!
  #6   Spotlight this post!  
Unread 20-02-2004, 23:23
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Answers for Dead Reckoning... FOR BEGINNERS

Quote:
Originally Posted by KenWittlief
its very easy to have a variable that you increment everytime you loop through your auton code, and use that as a rough timer - if it increments in the main loop it will have a 26mS period
I'm doing something even simpler -- I'm simply zeroing a specific variable every time through the 26ms loop. The fast loop code just checks to see when it becomes zero, and maintains its own timers.
Quote:
If you increment it in the user_fast code it will be even smaller (I forget the period off the top of my head)
Doesn't user_fast just go "as fast as possible"? The period will just depend on how much time it takes to execute the function.
Quote:
and you dont have to mess with interrupts that way.
Messing with interrupts is, um, messy.
  #7   Spotlight this post!  
Unread 20-02-2004, 23:56
mightywombat's Avatar
mightywombat mightywombat is offline
bins? stacking?? NOOOOO!
AKA: Bill Rosemurgy
#0857 (Superior Roboworks)
Team Role: Programmer
 
Join Date: Dec 2003
Location: Houghton, MI
Posts: 93
mightywombat is on a distinguished road
Re: Answers for Dead Reckoning... FOR BEGINNERS

I haven't read the white paper but I have found an excellent timer example at www.kevin.org/frc it rocks! Interrupts aren't really that bad and you can get an incredible timer resolution from them. Right now our dead reckoning runs by tenth seconds but it could easily go by hundreth or milli-seconds.
__________________
Bill Rosemurgy - Aspiring Programmer and Human Player (stack of 8 in <10 seconds...oh yeah... but I can't shoot for crap.)
www.team857.com
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
What to do with autonomous Rickertsen2 Programming 48 17-02-2004 16:22
FIRST message board- no answers? Jeff Waegelin General Forum 2 13-01-2003 22:40
Answers...Answers... archiver 2001 1 24-06-2002 03:58


All times are GMT -5. The time now is 03:57.

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