SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By UnforgiveNX
#74931
Hi all,

I need to track a path which is drawn on a map by gps device. But my problem is, how can my robot determine its orientation?

Say that I have drown a path going north. What if my robot is heading south? It should make a U-turn first than follow the path.

How would you determine that orientation of robot?
By Cannibal
#74933
Methods to consider:

Compass - your robot will know its orientation.

GPS - your robot will know its position. By observing your movement epoch to epoch you can determine your velocity (most receivers output velocity also, but it is without meaning when you're still)


Methods not to consider:
Inertial navigation with MEMS sensors - without GPS aiding mems inertial sensors are too drifty/noisy to be used on their own for dead reckoning.


Good luck! I'm sure there are other ways to do this, but these ones spring to mind.
By UnforgiveNX
#74934
Thank you Cannibal.

I have no compass right now. Maybe only option I have is to navigate a bit and find my orientation according to position change on GPS. This brings me some extra movement and error at the first initialization but I think I have no other option as a pratical solution for now.
By jesrandall
#75001
You could use two GPS receivers mounted on your device... some of the better receivers (military grade, commercially available) can differentiate distances of about an inch or so... so as long as the frame of your robot is bigger than an inch you could get stationary orientation.
User avatar
By FartingMonkey92
#75012
A lot of GPS receivers will give you it's current heading in it's NMEA messages based on previously collected coordinates...
By Cannibal
#75015
A lot of GPS receivers will give you it's current heading in it's NMEA messages based on previously collected coordinates...
And if one is stationary, it tends to turn random directions. I think the OP is after an initialization source for heading, less a dynamic one.
User avatar
By FartingMonkey92
#75018
Well it would probably only work well after it'd moved a few feet as the OP said but, would that matter to a robot that didn't have hazard avoidence sensors anyway?
(OP, does you're robot have any?)

Then it should know when it's about to stop and expect odd readings...
So if it had any sense, it could work out how many degrees it'd need to rotate before it stopped.
Cannible wrote:"And if one is stationary, it tends to turn random directions."
Come to think of it, commercial GPS recievers (personnel ones) don't tend to have that problem, and the ones i've seen don't have external, onboard compasses.
By Cannibal
#75029
Come to think of it, commercial GPS recievers (personnel ones) don't tend to have that problem, and the ones i've seen don't have external, onboard compasses.
Personal gps receivers based on sirf, ublox, nemerix, etc. chipsets fudge a heading using time difference of position, or velocity from doppler measurements, but all of them tend to 'fudge' your heading using some sort of navigation state filter. You can see this by plotting the output of a GPS receiver, as it will wander around in a 2-5m circle over time, you're not actually moving but your receiver will have velocity noise around 10cm/second, and therefore it will think you are drunkenly stumbling around the maypole :)

Some of them that cost a little more include both barometers and magnetometers (https://buy.garmin.com/shop/shop.do?cID=145&pID=310) so you can actually get an accurate altitude over time and heading. (In satnav your vertical component is wost because you never have satellites below you to help resolve the vertical position error - while you do have them on either side - and as discussed above heading is a state that is unresolved when stationary)

Professional products that need a heading that is accurate while they are stationary often integrate inertial sensors, or multiple antennae (as jersandall mentioned) http://www.hemispheregps.com/Products/P ... fault.aspx

The farther apart you can get them, the better* (in most situations).

If you have any questions about the theory of GPS let me know, I've been studying it in a navigation lab for the last few years, and am fairly comfortable with it :D

Bottom line is you shouldn't rely on GPS to give you a heading at very low speeds, or to hold onto an accurate one when you're stationary.