GPS: Calculate True Heading with the course from two GPS receivers

Hi all,

I'm using two GPS receivers : MR-350 S4
Link to the datasheet: https://www.globalsat.com.tw/ftp/download/MR-350%20S4%20Specification%20V1.2.pdf

It outputs four different NMEA sentences:
GGA, GSA, GSV, RMC.

This GPS receiver does not tell me what the True Heading is, but only provides Course Over Ground (COG).

Is there any way to determine or caclulate the True Heading by using two GPS receivers?

Thanks for reading this topic.

GPS receivers calculate the course over ground heading from individual position measurements. The receiver has no way of knowing which direction the craft is pointed.

I suppose that if you had a very large craft, and one GPS receiver at the front and another at the back, you could make some guesses. But most people use a magnetic compass for heading.

Thanks for your quick reply!

I have tried putting two GPS receivers approximately 7 meters horizontally away from each other on a moving ship. The values of COG that I received from both of the GPS receivers were very close to the COG on the ship (which was using DGPS).

I've also seen another topic where someone could calculate the True Heading with two GPS receivers, but it has no code attached to it: Heading with two GPS and Arduino Due

So I'm thinking there should be a way, without having to buy a magnetic compass...

You can estimate heading (the direction the craft is pointed) from positional fixes at any two different points on the craft. Takes a bit of algebra.

The individual fixes will be subject to typical uncertainty of +/- 3 m, so two GPS units 7 m apart will rarely produce accurate heading values.

However, a good compass module, if properly calibrated, can produce heading values accurate to 1-2 degrees, and costs less than $10. A magnetic needle compass will perform even better, so it is not worth the trouble to use two GPS units.

Thanks for the relevant tip about buying a compass module or magnetic compass. What kind of algebra is there to estimate the heading? Even though the accuracy will be inaccurate, this will help me out a lot. That's actually why I made this topic

For example, I could use a filtering technique (maybe a Kalman filter) to make measurements more accurate and then estimate the heading.

No. The GPS can only measure position and change in position. It cannot measure the direction you are facing. Having two GPS's will let you calculate course from one to the other.

To get heading, try a magnetic compass.

Look at the GPS coordinates for 2 nearby houses
42.36652109484761, -71.52760272928839
and
42.36657955582033, -71.52713334233775

for example.
Both are nearly the same in latitude (distance from equator) and only a little different in longitude (distance 0 degrees at Greenwich, England I believe).
Using simple geometry, you can find two legs of a right triangle, calculate the hypotenuse, and then calculate an angle from there. Just the two legs are sufficient tho.
SOH CAH TOA
Angle Tangent = O/A
Or maybe it's inverse tangent, been too long since 10th grade geometry.

But none of that will tell you which way the houses are facing. :slight_smile:

Yes, but treat the house coordinate as the two ends of the boat.
If the math can be figured out for that, the same can be done for the boat.
I suspect the numbers will be much closer to each other,
and if GPS readings are within 3 meters, and the coordinates are only 7 meters apart, the results may not be that satisfactory.


Depending on the size of the boat, is it possible for the reported positions +/- 3m to result in a calculation like this? Or not too likely if the GPSs are both seeing the same satellites?

It is an unworkable idea, and the OP will figure that out sooner or later.

1 Like

Thanks all for the great replies! It made a lot of clearance for my project.

clearance?

"clarity of mind" hopefully.