Tuesday, June 19, 2018

Geotagging Nikon DSLR with Vectornav VN-200 GPS (Lattitude & Longitude) + IMU (Compass Heading)


GPS (Global Positioning System) refers to a system of satellites in earth orbit, which transmit signals to devices on the ground. GPS devices detect these signals and use them to triangulate their position, heading, speed, altitude and other information. This location information can be embedded in an image to show the photographer where the camera was when the photo was taken.

Recording GPS data can be useful for the travel photographer who is always shooting on location, to be able to go into the image metadata and see exactly where an image was captured. Some photographers like to keep track of their travels on a world map; and some websites and programs incorporate maps that let you view or categorize your photos by GPS location. This is known as geotagging.

Geotagging is great for photographers who like to share with fellow photographic enthusiasts exactly where they captured a specific image, so others can find that spot and make their own images of the same subject. We also know a few photographers who like to keep their favorite shooting spots a secret and won't divulge the GPS coordinates of these locations!

Nikon DSLR Camera are commonly deliver with a 10-pin remote terminal, are capable of automatically writting geo-refferential meta-data into image headers (Exif), known as "geo-tagging".

GPS module communicate using the NMEA 0813 standard (National Marine Electronics Association).  That standard allows one-way communication from a single  talker  (the GPS module)  to several  listeners  (making it possible to connect  in parallel  devices like cameras, display units, computers or microcontrollers).

Balanced lines are recommended but the standard also allows the simple RS232-level signals which Nikon uses.  Asynchronous serial communications is performed with no handshake at 4800 bauds, 8 data bits  (bit 7 being 0)  no parity and one stop bit.

This picture below show Icon "GPS" indicating that the GPS is connected. (top screen of the Nikon D800).


In the "Setup Menu" - "GPS" - "Position" of the camera, the last position, Altitude, Heading, and the current UTC from the GPS satellites time are displayed. You can choose to automatically sync the camera to the GPS time in the menu.




Vectornav VN-200 have an internal 3-axis Compass, so the heading information is provided into display. The 3-axis Compass provides accurate data even when tilted to various angles of all 3-axis.


Nikon would be able to display and record Heading information to the EXIF header if they receive NMEA data with a "$HCHDG" prefix sentences.

HCHDG - Compass output is used on Garmin etrex summit, vista , and 76S receivers to output the value of the internal flux-gate compass. Only the magnetic heading and magnetic variation is shown in the message.
  $HCHDG,101.1,,,7.1,W*3C

where:
     HCHDG    Magnetic heading, deviation, variation
     101.1    heading
     ,,       deviation (no data)
     7.1,W    variation

HDG Heading–Deviation and Variation
        1   2  3  4  5 6
        |   |  |  |  | |
$--HDG,x.x,x.x,a,x.x,a*hh
1) Magnetic Sensor heading in degrees
2) Magnetic Deviation, degrees
3) Magnetic Deviation direction, E = Easterly, W = Westerly
4) Magnetic Variation degrees
5) Magnetic Variation direction, E = Easterly, W = Westerly
6) checksum


User can also adding heading, pitch and roll (HPR) information to the EXIF header, but these information were not displayed into the Camera. User can read this information using software EXIF reader. This could be done if NIKON Camera receive NMEA data with a "$PTNTHPR"  prefix sentences.

HPR Transducer Measurements (proprietary data)

          1  2  3  4  5  6 7
          |  |  |  |  |  | |
$PTNTHPR,x.x,a,x.x,a,x.x,a*hh
1)Heading
2)N for Number
3)Pitch in degrees
4)N for Number
5)Roll in degrees
6)N for Number
7)checksum


To display and record Lattitude, Longitude, Altitude, and the current UTC from the GPS satellites time information to the EXIF header if NIKON Camera receive NMEA data with a "$GPRMC" and "$GPGGA" prefix sentences.

GGA - essential fix data which provide 3D location and accuracy data.
 $GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47

Where:
     GGA          Global Positioning System Fix Data
     123519       Fix taken at 12:35:19 UTC
     4807.038,N   Latitude 48 deg 07.038' N
     01131.000,E  Longitude 11 deg 31.000' E
     1            Fix quality: 0 = invalid
                               1 = GPS fix (SPS)
                               2 = DGPS fix
                               3 = PPS fix
                               4 = Real Time Kinematic
                               5 = Float RTK
                               6 = estimated (dead reckoning) (2.3 feature)
                               7 = Manual input mode
                               8 = Simulation mode
     08           Number of satellites being tracked
     0.9          Horizontal dilution of position
     545.4,M      Altitude, Meters, above mean sea level
     46.9,M       Height of geoid (mean sea level) above WGS84
                      ellipsoid
     (empty field) time in seconds since last DGPS update
     (empty field) DGPS station ID number
     *47          the checksum data, always begins with *


If the height of geoid is missing then the altitude should be suspect. Some non-standard implementations report altitude with respect to the ellipsoid rather than geoid altitude. Some units do not report negative altitudes at all. This is the only sentence that reports altitude.

RMC - NMEA has its own version of essential gps pvt (position, velocity, time) data. It is called RMC, The Recommended Minimum, which will look similar to:
$GPRMC,123519,A,4807.038,N,01131.000,E,022.4,084.4,230394,003.1,W*6A

Where:
     RMC          Recommended Minimum sentence C
     123519       Fix taken at 12:35:19 UTC
     A            Status A=active or V=Void.
     4807.038,N   Latitude 48 deg 07.038' N
     01131.000,E  Longitude 11 deg 31.000' E
     022.4        Speed over the ground in knots
     084.4        Track angle in degrees True
     230394       Date - 23rd of March 1994
     003.1,W      Magnetic Variation
     *6A          The checksum data, always begins with *


At least NIKON Camera receive NMEA data with 3 prefix sentences, $GPGGA, $GPRMC, "$HCHDG" for geotagging images. Below the examples of streaming NMEA data from GPS to NIKON Camera.








Keywords: Geotagging, geo-tagging, Nikon, DSLR, D800, D810, Heading, NMEA, $GPGGA, $GPRMC, $HCHDG, $PTNTHPR, Exif header, VN-200, Vectornav.