Go to Post Too complicated for Wildstang? Start browsing CD-media...... - AdamHeard [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
  #2   Spotlight this post!  
Unread 10-12-2007, 11:06
JesseK's Avatar
JesseK JesseK is offline
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,659
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: Help with Angles and distance

I would start with pseudo code, literally you can framework out your code either using flow charts or writing IF ... THEN. Most white papers that define software requirements do one or the other and coding from there is as easy as knowing any language's syntax.

For starters in syntax, I don't believe EasyC will like the "^" character, so multiply those variables out.

Now for some issues you'll encounter along the way (note, these are NOT answers to these issues; I'm only making you aware of them)What will boggle your mind is that unless your GPS unit is precisly on the center of rotation of your robot, when it moves to the spot you tell it to it will be off by a distance. That distance, minus all negligible mathematical components, is roughly the distance between the GPS unit and the center of rotation.

Also, you'll need to account for the possible sign errors on your arctan (inverse tangent) output. There are several ways to do this, the most intuitive (but most complex) of which is converting the bearing to the first quadrant, doing the calculation, then reversing the quandrant conversion. Do this on paper using the IF...THEN blocks as well. Doing this will also reduce the amount of arctan tables you need to store, fyi .

Finally, what should happen when Y2 == Y1 ? Do you see the problem that happens in your arctan calculation? When, in the real world for your application, does Y2 == Y1 and how will your code deal with that condition?
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub
 


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
White Paper Discuss: Measuring Distance with Analog Potentiometers Daniel Extra Discussion 4 26-11-2008 13:52
Long distance network help needed Simon Strauss IT / Communications 16 26-07-2007 10:19
Encoder Help with VEX and MPLAB qnetjoe Programming 5 11-03-2007 21:04
How do I get distance between Camera and the target? sjung9442 Programming 5 27-01-2006 09:44
Help with Autocad and Bryce 5 Keith Chester Inventor 0 25-03-2002 17:33


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

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