0

I need to develop a compass for a device we are using. This device is directionally unaware (no gyroscope), but has a GPS module. How can I make a compass, with a needle, that leads from a start coordinate (likely their current position) to an end coordinate?

My current thoughts are:

  1. Poll coordinates on the GPS sensor as quickly as appropriate.
  2. Record coordinates where the PDOP is within a respectable range (maybe less than 2.0).
  3. Determine the direction they are facing based on the coordinate changes of them walking.

I have a few issues with this though:

  1. Firstly, the unit has to be moved around to get a sense of where they are.
  2. Doesn't seem like it would be the most accurate, i.e. how many past points do you use to determine direction change?
  3. I'm not really sure if this is a feasible solution. Is there some implementation theory I can read on this?

Is there a better way to solve my problem? The scope of the project involves going from a 'current location' to some geo-tagged item in an oil field.

Using a Windows Mobile 6.5 device - C# on VS2008.

test
  • 2,589
  • 2
  • 24
  • 52
  • The answers to your question depend on your problem domain/design decisions; For instance, if this was for a car navigation system, polling every second is liable to give reasonable accuracy. For getting a walker safely off a mountain in fog, hire a good laywer, as the GPS will generally be in the direction of travel, but may randomly jump off actual course... – Rowland Shaw Sep 10 '13 at 16:14
  • @RowlandShaw I will edit this into the post, but this will be for oil field work. So if I want to go from where I am to some pipe that has a geo coordinate - what direction should I go? – test Sep 10 '13 at 16:19
  • The larger problem is the wobble in GPS. The accuracy of GPS is dependent upon the quality of the clock in the device. I haven't encountered a smartphone with better than 30m accuracy based on the hardware and drivers. You can fake a higher accuracy by repeated polling and a nifty algorithm to smooth out the jitters and come up with a good average position. IMO your best bet is to get a device with a gyro, because the amount of code that we're talking about would cost $1000x the cost of new hardware. – Keith Payne Sep 10 '13 at 16:19
  • @KeithPayne Not sure where you are getting these numbers from - this device has a 2-meter module, which as the name implies gives a peak accuracy of 2 meters. This has been tested on the device. I can't change the hardware. There must be a solution to this that won't cost $2 millon dollars (using your multiplier). – test Sep 10 '13 at 16:23
  • Get a post-it note with an arrow on it that says "Point To North", then stick it on the device. –  Sep 10 '13 at 18:39

3 Answers3

1

I think the issue you have is that the way people use a compass doesn't fit with what you are achieving with a 'getting closer' technique. When you look at a compass you tend to spin to get a sense of direction, which is going to fail in your case, no matter how clever you get with distances. In fact the direction of the phone is going to be irrelevant, because it doesn't know which way up it is to be able to adjust any compass.

I think you'd be better dropping the compass idea and developing an interface that works with the 'getting closer' method you suggest. Maybe a simple distance to target display would be better? I think showing something that doesn't do what it should do is likely to be counter productive. If it was sat nav, within a moving vehicle then maybe it might work, as you can't spin that easily on the spot and it's likely to update itself before you've spun around.

Giving it some further thgouht I think using a map and showing your last movements on that with some sort of line (although the map may display upside down in relation to the users direction) would be better locating a target, if you showed a vector of your current location towards your target. At least if the vector and your movement line were aligned you'd know you were travelling in the right direction.

Darren Crabb
  • 570
  • 2
  • 10
  • I would also go for the 'getting' closer solution. BTW: a gyro would not help, as it only detects the force relative to the earth. A gyro does not give you a 'compass'. For a compass you need a magnetic sensor that is able to detect the magnetic field changes. Possibly you have choosen the wrong hardware for this challenge. – josef Sep 11 '13 at 16:51
0

If I were in your shoes, I would display a notice on the screen that tells the user to always keep the top of the device pointed in the direction of travel. While they are moving, calculate the direction they're going using their current position and their last known position. Then calculate the direction they should be moving based off of their current position and the target's position. Then calculate the difference between their direction of travel and the direction they should be traveling, and use that difference to point an arrow on the screen that shows which direction they should be going relative to their current direction.

Here's an example: Let D represent Direction of travel. Let's say that's 100 degrees in this example. Let T represent the direction they should be traveling to reach the target. Let's say that's 90 degrees in this example. T - D = -10, so draw an arrow on the screen pointing -10 degrees from straight up. Remember straight up is the same as D if they're following the instructions I mentioned earlier. This means that the arrow is pointing at D-10, which is 90 degrees, which is the way they should be going.

Now you have another problem: if they stop moving, you no longer have any way to tell which way the device is pointing. In that case, hide the arrow and let the user know that it will return once the GPS starts moving again.

The last thing to keep in mind is that a 1 degree change in latitude represents more distance than a 1 degree change in longitude, so determining your headings isn't as straightforward as you might think. Here's a link to an article that tells you how to calculate headings based on 2 GPS points: http://www.movable-type.co.uk/scripts/latlong.html

Good luck!

Edit: Most GPS devices give you the direction of travel, but unless you're using the same algorithm the GPS uses when you calculate the direction they should be going, there could be a discrepancy that would cause your arrow to be a little off.

Scott Reece
  • 395
  • 1
  • 3
  • 13
0

In your case you only can create an instrument which shows the geographical direction you are moving. This is equal (or better) then a compass when the user points the device in the direction he is moving.

This is not equal to a compass, but in some cases even more usefull: e.g inside a vehilce where a compass using the magnet field would not work well.

GPS has a "course" atribute. Just use that, and you are ready.

AlexWien
  • 28,470
  • 6
  • 53
  • 83