How can the “bearing” in degrees be obtained from the GPRMC NMEA proposal?

I am writing a program that receives data in the form of GPRMC NMEA sentences and outputs them as indicated by GTFS-realtime.

GTFS-realtime wants to have the value "bearing" and describes it as such:

Bearing in degrees clockwise from the True North, i.e. 0 is North and 90 is East. This may be a compass bearing or direction to the next stop or an intermediate location. This should not be inferred from the sequence of previous positions that customers can calculate from previous data.

The GPRMC NMEA proposals contain three fields that I think are relevant, but my research has revealed many ideas about what they are:

  • Track angle in degrees True , Course Made Good, True , Track made good in degrees True
  • Magnetic Variation , Variation , Magnetic variation degrees (Easterly var. subtracts from true course)
  • Magnetic Variation , East/West , E or W

For completeness, here is the full GPRMC offer, with the corresponding fields in bold:

$GPRMC,123519,A,4807.038,N,01131.000,E,022.4, 084.4 ,230394, 003.1 , W *6A

How can I get real-time GTFS output from the GPRMC NMEA offer?

+4
source share
1 answer

I recently bought a GPS module to connect to my Arduino and had to find out about the structure of the GPRMC offer. Since GPS calculates the direction by drawing a vector from the previous position to the current position, the correction of the magnetic North Pole is not taken into account. The bearing in real-time GTFS should be the same as the “Track angle in degrees of truth” GPRMC. They are both in terms of the True North. Imagine that you are standing in the center of a circle and you are facing the true north. As you turn clockwise 30 degrees, you will be on the bearing 30 degrees (if you are moving forward). The data structure should be something like this, I think:

 header { gtfs_realtime_version: "1.0" } entity { id: "myPosition" vehiclePosition{ position{ position_id: "myBearing"{ bearing: 84.4 } } } } 

I understood this from the descriptions and examples on these pages: https://developers.google.com/transit/gtfs-realtime/reference#VehiclePosition https://developers.google.com/transit/gtfs-realtime/examples/trip- updates-full

Does it help?

+3
source

All Articles