Compass vs GPS for actual heading?
Hi all,
I have been collecting and analyzing BS2 programs for an autonomous rover.
I have looked at Chris Anderson's BS2p UAV program and found that he used the GPS for actual heading and desired heading.
Another person on the Parallax Robotic Forum used the Hitachi HM55B compass to determine the actual heading and the GPS for the desired heading.
Does anyone know the pros and cons of using either the compass or the GPs for the actual heading?
Regards,
TCIII
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
I have been collecting and analyzing BS2 programs for an autonomous rover.
I have looked at Chris Anderson's BS2p UAV program and found that he used the GPS for actual heading and desired heading.
Another person on the Parallax Robotic Forum used the Hitachi HM55B compass to determine the actual heading and the GPS for the desired heading.
Does anyone know the pros and cons of using either the compass or the GPs for the actual heading?
Regards,
TCIII
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
Comments
The difference is that the GPS calculates heading based on current coordinates vs previous coordinates. From that information it determines which way it is moving and thus it must be in motion to get an accurate heading. A compass module can give you a static heading and is therefore used on most higher-end GPS systems for accuracy. Bear in mind that due to slight errors in the GPS signal, while static a GPS module can sometimes think it is moving a bit and therefore give you an inaccurate static heading. I hope this helps. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
At first (when I was naive) I thought that the GPS would be good for everything. Boy was I wrong. It's good for telling you where you are on a grid about a four-sqaure court size. For my first project, the movement speed was about an inch a second (BOE-BOT). So now I'm on to version two.
I use the compass to tell me which dirrection the robot (a new, more capable one) is pointed. N, S, NE, etc. Then the BS2 reads from a datalogger what the destination coordinate is. It gets the current coordinate via the GPS, and fromt the two uses the Pythagorean theorem to construct a mathematical tiangle, and figure out in which dirrection the robot should go. Note that, with the BS2, some contortions are needed, since numbers cannot be larger than 65535. When you start to square things, numbers get big really fast. Also note that the global coordinate system is not set up the same way as the traditional mathematical models go. (For the western hemisphere) the x axis (longitude) increases from the right to the left (when looking at a map), so you'll have to compensate for that. Also, 0 degrees north is at the top of the axis, parallel to the y. For most mathematical operations (including those of the BS2) 0 degrees starts on the x axis on the right. You'll need to offset for that too.
Okay, so once the GPS desired heading is calculated (note that it's calculated, not measured with the heading command), it's compared to the actual heading and a desired heading. This desired heading is passed to the sensors (ping and bumper), where if figures out which way it can go, with a bias towards the desired heading.
Well, that's pretty much it. It took me about 10 or 12 hours to think about, design, write, and debug the heading calculation code, so it's not a light step.
GPS is not intended for such a small area as even in lieu of resolution there is an inherent error that can throw these readings off by several yards. GPS is more useful on a larger scale.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering