Need some guidance on implementing Navigation using GPS Module w/ Prop
ALIBE
Posts: 299
hello folks
I know this subject has been brought up by a few in the past - but, I could not find a trace via http://search.parallax.com/ site.
Let me state the problem:
Assuming I'm heading North from pA toward pB (pB is north of pA let's say)· I would like to understand:
or any other reading material on this navigation topic that is written in simple, easy to follow text.·
I know, I am asking for too much [noparse]:)[/noparse]
thanks in advance
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"any small object, accidentally dropped, goes and hides behind a larger object."
·
ALIBE - Artificial LIfe BEing. In search of building autonoumous land robot
I know this subject has been brought up by a few in the past - but, I could not find a trace via http://search.parallax.com/ site.
Let me state the problem:
- I have Point A pA and Point B pB and I have coordinates for both of these (lat/lon)
- I do not have a pre-recorded trail of coords btwn pA and pB - all I have is pA and pB coords
- Now, assuming there's clear line of site btwn pA and pB (no obstacles), I would like for my robot to travel from pA to pB.
Assuming I'm heading North from pA toward pB (pB is north of pA let's say)· I would like to understand:
- how to stay on track to pB.·
- that is, if i turn left/right, forward/backward, what effect will it have on current lat/lon.· I could write an app to figure this, but, wanted to ask this grp ahead.
or any other reading material on this navigation topic that is written in simple, easy to follow text.·
I know, I am asking for too much [noparse]:)[/noparse]
thanks in advance
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"any small object, accidentally dropped, goes and hides behind a larger object."
·
ALIBE - Artificial LIfe BEing. In search of building autonoumous land robot
Comments
When working with small distances (say: some miles) you can easily use flat co-ordinates (unles you live near one of the poles i.e.):
Define your point A as (0,0) (WGS : longA, latA)
Now where is B? (WGS: longB, latB)
Well the vertical distance is just (latB-latA)*111,111 m
The horizontal distance is (longB-longA) *111,111 m * cos((latB+latA)/2)
Polar co-ordinates around the actual position "C" of your robot might even be more useful...
There are thousends of pages about such transformations. It is basic stuff for every sailer...
Post Edited (Fred Hawkins) : 8/20/2007 10:13:50 PM GMT
i guess i am not asking my ?n correctly. What I am really looking to understand is using pA and pB coords, how will i steer a robo from pA to pB assuming there's no obstacles btwn the 2.
thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"any small object, accidentally dropped, goes and hides behind a larger object."
·
ALIBE - Artificial LIfe BEing. In search of building autonoumous land robot
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"any small object, accidentally dropped, goes and hides behind a larger object."
·
ALIBE - Artificial LIfe BEing. In search of building autonoumous land robot
thanks in advance
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"any small object, accidentally dropped, goes and hides behind a larger object."
·
ALIBE - Artificial LIfe BEing. In search of building autonoumous land robot
is the first one.
It is a matter or determining your "course", which is straightforward done with polar co-ordinates
and also in Cartesian co-ordinates (just a small ATAN2 call!) , where for I gave you the transformation.
I still don't understand the Question... You just have to "head" to that "course" and stop when you are there!
Post Edited (deSilva) : 8/21/2007 7:37:11 AM GMT
I think a Compass is needed, too, because when he starts up his robot the Robot needs
to know in which direction to move.
Franz
check its new position to determine the direction it has moved, and update his course!
Looks like PID
a) like deSilva posted by only using a GPS module
But note: when starting up your robot he will/can move in the wrong direction a bit
b) adding a Parallax Compass module
Note: the robot will go at startup directly to the right direction but it costs an extra module
Franz
The struggle I am facing is determining the course and how I would use the heading data (compass) and lat/lon data (GPS) to determine which way to go.
I should do some reading and experimenting before I can ask my ?s intelligently [noparse]:)[/noparse].· So, I shall go do that now and circle back w/ more info in my pocket
thanks guys - appreciate your help thus far and for patience while I wander about my clouded ?ns
Nagi
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"any small object, accidentally dropped, goes and hides behind a larger object."
·
ALIBE - Artificial LIfe BEing. In search of building autonoumous land robot
i found something nice for you.
A project for a "robot GPS/Compass Navi" at the elektor magazine.
Its written in BASCOM AVR for an ATMEGA32 but i am sure you can convert
it for the Propeller. The bad thing is that most of the sourcecode is written in german.
You have to register at this site for a free download:
http://www.elektor.com/magazines/2007/july-august/satnav-for-robots.197653.lynkx
have fun
Franz
·
To start with:
· For any autonomous object to move from point A to Point B, three things must be known:
- The current location
- The current direction
- The direction needed to go in.
·Ok, you have #1, POS A in your post.· You can calculate #3 using the formulas described above, so now all you need is the starting direction.· Others have already led to this point, but I’ll try to bring it into something somewhat “closer”.
·
- Get your current location and current heading.
- Convert the destination to a direction from current heading.
- Turn until you are facing the correct heading.
- Move a small amount in the correct heading.
- If you are NOT at your destination then go to step 1
·The GPS can be used to generate a heading.· The issue in using a GPS to generate your current heading is that you must move a distance.· And that distance HAS TO BE greater then the resolution of the GPS, and there is slew in the measurement.· Where as a simple compass can be used to return your heading immediately, with very little slew in the reading.· To keep things in line, and to compensate for slew in the heading, and any slew in the long/lat conversations, I would travel in small steps, constantly running through the above loop.
·
Ok, thanks for reading… I hope it helps…
·
KK
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller + Hardware - extra bits for the bit bucket =· 1 Coffeeless KaosKidd
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Blog: Prog | Electro | Mech
I would love to change the world, but they won't give me the source code
People say that if you play Microsoft CD's backwards, you hear satanic things, but that's nothing, because if you play them forwards, they install Windows.
I spent a minute looking at my own code by accident. I was thinking "What the heck is this guy doing?"
But this is an ABSOLUTE error only. A small displacement within some minutes can be meassured very exactly! This is the way a GPS compass works.
1) Memory contains Lat/Lon of target location
2) GPS provides actual Lat/Lon
3) Calculate DeltaLat and DeltaLon from actual to target - this is the X and Y on a unit triangle.
4) Calculate distance to target by pathagorean theorom: distance = sqrt(Lat^2 + Lon^2), but realize also that Longitude gets "compressed" the farther you are from equator, so you have to first correct DeltaLon to be same relative size as DeltaLat by multiplying DeltaLon by the cosine of actual latitude. think through this. You might think "wait a minute! you mean divide by Cos(lat), but I assure you it is multiply. Waaaay up near North pole, going East only a few miles might be quite a few degrees East of longitude. you have to chop down the highly inflated DeltaLon.
5) If distance to target WP is less than some tolerance (lets say 50 feet), then you have to update the the coordinates in RAM to the next set of targets and loop back to #2, otherwise proceed to step 6.
6)ATAN calculation to get required heading to pursue for the craft to hit target. Realize the "heading" is zero at North and increases as you go clockwise, whereas cartesion coordinate system (and ATAN) would be zero at East and increases as you go counter clockwise). To convert cartesion angle to heading do this: Heading = 90 - Angle. This inverts the sign and corrects the 90 degree difference. an assumption here is that East is positive, and North is positive. For example, if the target is North and East of you, the cartesion quadrant is I, and the required angle will be somewhere between 0 and 90, or calc'd as a required heading would be between 90 and 0. If the target is North and West of you, then that's cartesion quadrant II, and angle is between 90 and 180, required heading between 270 and 360 (well, it's actually called zero heading). Get my drift?
7) GPS provides current heading (you don't need a compass at all) as long as you are moving at least a couple km/hour (I have no problem at walking speed with the EM-406 or ETek EB-85A)
8) calculate Delta heading between actual and required. E.g. I'm on a course of 45 degree heading, but to hit target I need to be 66 degree heading, therefore I need to steer +21 degrees Clockwise, then I'll be right on course.
9) use some PID control of steering function to achieve DeltaHeading correction. (In PID the "DeltaHeading" is the error between actual and target)
10) when next GPS data becomes available, iterate the entire process by going back to step 1.
Also, DeltaLon is cartesian "X", and DeltaLat is "Y". Origin is the current position, and out on the unit circle is the target.
Just BTW: It will simplify your program when you use ATAN2 - as I said - rather than ATAN.