Data Acquisition (Stage 1)¶
The Data Acquisiton module contains tools to help users through the process of flying a UAV, as well as organizing and filtering the pre-requisite data necessary to generate a point cloud
Utilities¶
- acquire.utilities.telemetry_to_gps_positions(log_file, msl_float, gps_file=None, format='ardu', coord_sys='utm')¶
Filters GPS positions from an Arudpilot log file into a text file NOTE: Mikro Currently Not Implemented
Parameters: - log_file (file) – Telemetry Flight Log File (Comma-delimited etc.)
- msl_float (float) – lauch altitude (meters above mean sea level)
- GPS Positions File (file) – (Optional) Clean file to write GPS positions (UTM coordinates, meters, space-delimited, etc)
- format (string) – Telemetry log file format
- coord_sys (string) – GPS file output coordinate system
Returns: gps_array
Return type: np.array
Example>>> log_file = open(“path/to/log”, ‘r’)>>> gps_file = open(“path/to/output/directory/GPS_positions.txt”, ‘w’)>>> msl = 50.6>>> acquire.utilities.telemetry_to_gps_txt(log_file, msl, gps_file=gps_file)Input File (log_file):CTUN, 643, 0, 9787, 9800, 0, 0, 5, 422, 0ATT, 0, 23, 0, 2, 0, 183, 0NTUN, 29907, 0, 3, 26866, 0, 0, 230, -10GPS, 232733000, 12, 38.8882963, -76.5585533, 98.0000, 99.8500, 244, 9388CMD, 100, 85, 16, 1, 0, 14200, 388882720, -765593408...Output File (GPS_positions.txt):364754.663 4305831.507 137.744364754.771 4305831.238 137.753364754.827 4305830.938 137.707...
- acquire.utilities.filter_ardu_log(log_file, filt_log_file, types='CMD GPS')¶
Filteres data from log file
Parameters: - logfile (file) – Original LOG File (FMT headers must be included)
- filt_log_file (file) – Clean file to write Filtered LOG File
- types (string) – (Optional) Space-delimited datalog types to include
Example>>> log_file = open(filepath1, ‘r’)>>> filt_log_file = open(filepath2, ‘w’)>>> acquire.utilities.filter_ardu_log(log_file, filt_log_file)Input File (flight.log):CTUN, 643, 0, 9787, 9800, 0, 0, 5, 422, 0ATT, 0, 23, 0, 2, 0, 183, 0NTUN, 29907, 0, 3, 26866, 0, 0, 230, -10GPS, 232733000, 12, 38.8882963, -76.5585533, 98.0000, 99.8500, 244, 9388CMD, 100, 85, 16, 1, 0, 14200, 388882720, -765593408...* Output File (filtered.log):*GPS, 232733000, 12, 38.8882963, -76.5585533, 98.0000, 99.8500, 244, 9388CMD, 100, 85, 16, 1, 0, 14200, 388882720, -765593408...
- acquire.utilities.filtered_telemetry_to_gps_positions(filt_log_file, msl_float, gps_file=None, coord_sys='utm', debug=False)¶
Converts filtered gps positions from telemetry into three-dimensional gps array
UTM: <easting> <northing> <altitude> expressed in meters WGS84: Support not yet added
Parameters: - filt_log_file (file) – Filtered LOG File
- msl_float (float) – lauch altitude (meters above mean sea level)
- gps_file (file) – (Optional) Clean file to write GPS coordinates
- coord_sys (string) – (Future capability of WGS84)
Returns: gps_array
Return type: np.array
NotesDefault CMD Column Format:CMD, CTot, CNum, CId, COpt, Prm1, Alt, Lat, LngDefault GPS Column Format:GPS, Status, Time, NSats, HDop, Lat, Lng, RelAlt, Alt, Spd, GCrsSee here for information on Arducopter datalogging:Find out meaning of these values: CMD: 16, 22