Let's Make Robots!

Do I need a compass for autonomous car navigation?

I'm working on building an autonomous car using a 1/10 scale RC car as my platform.  Right now I've got a GPS and 3 axis gyro scope for navigation.  

I'm wondering if I need to add a compass too? 

The way I have the code set up right now is that I calculate the heading to the next waypoint.  Store the car's current heading and angular rate from the gyro.  I'm assuming that the heading I get from the GPS is a bit old so I correct the heading up to the current time by keeping track of the gyro rate inbetween GPS updates.  Kind of difficult to explain.. Maybe I need to draw a diagram for this?

It seems to be working somewhat.  I store all the data from the sensors on a microSD car to view later.  I can see that the car will get a new heading and inbetween GPS updates will correct it's self so that it is driving toward the waypoint.  The problem seems to be from the GPS though.  Often the car will correct it's heading properly but the next GPS update says that the car is way off.  It seems like the there is just too much error in the calculated heading from the GPS.  Should I get a compass to try and corrrect it or it there a bigger problem in the code somewhere. 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I was going to say debugging, but, that might send the wrong message. If you don't know the data that your vehicle is relying on, you won't have any luck figuring out what is going on.

One guess I have is your GPS is losing a satellite connection and therefore losing accuracy.

I've noticed the GPS drop out a few times before but it's pretty rare.  When it did drop out it was for several seconds so it was very ovbious that it happened.  The data I have now shows that the GPS is still updating at the rate I set it to so I'm guessing it's good.  Is there a chance it could be losing it's connection but regain a connection quickly enough to keep updating?  The way I did the navigation depends a lot on there being a very accurate GPS heading.  So I could see a connection problem causing this. 

I've got lots of data but I think I really need a better way to visualize it.  Maybe it's time to learn how to use matlab or octave.

I am talking about losing a satellite causing diminished accuracy.

Maybe you could take multiple readings and average them to cover for any possible outliers that appear?

Oh ok, thanks.  I didn't think about the diminished accuracy.  I'm not actually logging any data on the satellites.  I'll do a few more runs and see if I can see a correlation between the heading jumping around and the satellites.  If that's the case I could easily increase the rate on the GPS and average several readings.