When conducting UAV flights in complex mountainous terrain, RTK capabilities may be insufficient when creating models based on the imagery collected. This is because satellite ephemeris errors change from day to day, and these errors are further exaggerated when you already have fewer observed satellites and unequal sky coverage due the influence of steep slopes. For this reason, it can become necessary to post-process your UAV imagery before further processing. This code can be used to achieve that.
The steps of this code are as follows:
- Import the RTKLIB corrected RINEX drone data
- Import the Timestamp.MRK file created from the UAV
- Create a calculation dataframe to correct imagery locations based on the corrected RTKLIB file
- Create a new export file with updated Lat, Lon, and elevation and associated errors
- Read the original exif data from the images and append that to your export file
- Subtract the observed snow depth at the RTK site from each elevation observation
- Export a final .csv with the updated lat, long, elevation and pitch, roll, yaw
When carrying out this code, it is important to have a specific file structure in place. You can tweak the code for your own needs, but this structure has worked well for me.
- Within your holding folder, mine is titled "HG_PPK", have multiple folders for each day of flights with their date in the form "20210624".
- In this folder, have a folder for your images titled "Imagery", and a folder for your GPS files titled "Raw_files".
- Within the imagery folder, have folders for each flight done on that day
- Within the raw_files folder, have all your RTKLIB corrected RINEX files saved as .csv and all timestamp files saved as .MRK
Optional Folders
- RTK Base heights in a .csv file
If done correctly, the end of the code should export an updated .csv file titled "Date of flight"+Corrected_Imagery_Locs.csv