Introduction and Prerequisites
This article covers a basic and practical way to implement the precision of RTK GPS into your data gathering workflow. The GNSS modules used as examples in this guide are the Emlid Reach M2 and M+.
Though the Emlid Reach is featured, it should be noted that other RTK systems are compatible with our sensors and the larger take away from this article should be the general way in which our sensors can be used with an RTK GPS system. However, it is important to note that not all RTK systems are created equal, and thus not all RTK systems are compatible with MicaSense sensors at this time.
NOTE: DJI’s RTK protocol is not supported at this time. If this changes, we'll update this article.
This article covers the following:
- Enabling the Top of Frame output
- Connecting to the Emlid Reach
- Data Collection
- Post Processing
Please familiarize yourself with the Emlid Reach RTK GPS if you have not done so already. Documentation can be found at Emlid’s knowledge base. Additionally, basic familiarity with the command line and/or python is helpful for the post-processing workflow.
Top of Frame Output
MicaSense cameras are capable of precisely communicating capture time to an external device through the use of the 'Top of Frame' pulse at the time a capture is taken. When connected this way, the Reach module will save each top of frame output in its log files for later use in associating its precise coordinate positions with each capture.
To enable Top of Frame, connect to the camera's web interface, and navigate to the Advanced Configuration page. Scroll down until you see the Pin Configuration section. The Top of Frame setting on the camera should be set to “Pulse low, rest high”. Our cameras provide several options as to which pin can be configured to a Top of Frame output. Below is an example of the settings page on a RedEdge-MX, with the default pin settings:
Pin settings may differ between camera models
Connecting to the Emlid Reach
Which pin you decide to use for Top of Frame depends on your camera and integration requirements. For example: If you have a RedEdge-MX, and are using our automatic triggering modes, then you are best suited to assign Pin 1 in the PWR/TRG connector port. This will make things easier because no cable modifications will be required to the 6-pin DLS cable where the other configurable pins (GPS Pin 4 + 5) are found.
Whatever your chosen pin for Top of Frame, this must be connected directly to the Emlid Reach's "Time Mark" pin (Pin 2), found on the Emlid Reach's connectors labeled C1 or C2. These connectors are interchangeable, so you can use whichever one you prefer. See pinout below.
You can either provide a 5V line to the same connector's 5V pin (Pin 5), OR power the module via the USB port. NOTE: Do not plug two power supplies at the same time as it may damage the device.
Below is a screenshot of the Emlid Reach M2's connector pinout (Reach M+ has the same pinout):
NOTE: If you are using an Altum, there is an additional consideration. Pin 8 on the Altum's host connector is an isolated ground (ISO GND) pin. We recommend connecting this directly to the Emlid Reach's GND pin (Pin 1), on the same connector that is receiving the Altum's Top of Frame output. For more information on the Altum's host connector, please see the Altum Integration Guide.
Gathering the Data
The Emlid Reach modules do not output Ublox GPS packets at this time, so GPS coordinates will not be written to the image metadata directly. A python script is provided below to assist in creating a geolocation file to use with Pix4Dmapper, to associate image number with GPS coordinates.
Ensure that your base station is set up correctly with the selected coordinate gathering mode set up to use the method most suitable for you (see Emlid's Quick Start setup), and allow the base station to achieve a position fix.
Afterwards, proceed to fly your mission using the Emlid module attached to your drone and your MicaSense camera with proper Top of Frame output set (as discussed in the previous section of this guide).
Once the flight is done, download both sets of raw logs (the .ubx files) and proceed to process them, following the steps in Emlid's GPS Post-Processing tutorial.
Once this is complete, you should end up with a .pos file including the name “_event” at the end, which you can view with a text editor such as Notepad++; this will contain GPS locations from each time the camera took a capture.
The last step is to parse this file into a format suitable to upload to Pix4D as a geolocation file.
This can be done with the python script below, which will take in the “_events” file as an input, and create an output file at the provided location, containing each capture and its proper GPS coordinates in Pix4D’s LLH (Latitude, Longitude, Height) format. You may need to alter the script slightly depending on your use case.
You must have python and the click library installed. A typical usage of this script involves opening up the command line, navigating to the directory the script is saved to, and typing the following:
python gps_img_insert.py create_image_location_file --input_path C:\\Users\\Username\\raw_201712052221_events.pos --output_path C:\\Users\\Username\\pix4d_geolocation_format.csv
Input and output file paths tailored to your specific file locations of course. (Double slashes are needed on Windows to properly input the file path). You may need to modify this script depending on your use case (e.g. multiple flights).
CAUTION: The script is blind to which captures you are intending to stitch, so it is highly recommended that the GPS log files used to create the final "_events" file contain only camera time marks from the actual flight (i.e, not including panel images). Also, unless an additional uBlox compatible GPS is used, since the Reach is unable to send messages in a format that the camera is compatible with, this restricts flying to less precise modes (such as Timer Mode).
However, using an additional GPS (such as the one you received with your camera kit), will allow you to fly with the camera in Overlap Mode to avoid excessive captures. This may require some cable modification depending on your integration requirements.
More information about Pix4D’s geolocation file format can be found here: Image Geolocation File
You will now be ready to process your imagery with RTK GPS precision. More information about using Pix4D to process your MicaSense data can be found in our How to Process MicaSense Sensor Data in Pix4D guide.