A few years ago a client suggested we look at using the Qstarz GPS modules to record location information as part of our experiments. This proved useful, however the workflow was typically something along the lines of:
- Capture the positions with the GPS logger
- Connect the GPS logger to a PC using USB
- Use their Windows application (running in a VM) to export the log into a CSV file
- Copy the CSV file to the Linux server where the rest of our data is captured and the analysis is performed
- Load the CSV file into Julia (using CSV.jl) and perform the analysis
Due to the hassle of having to fire up my Windows VM to run the extraction utility, I started wondering if it wouldn’t be possible to trim these steps and do it more directly. I reached out to Qstarz with the suggestion of making an open source implementation available to read their log files. They graciously
provided me with some information which allowed me to implement the reader. Since my ultimate step was to get the data from the log format into Julia, I decided to skip intermediate steps and implement it to directly load the data into a Julia vector object.
The data is stored as an array of structures, but I also implemented helper functions to be able to easily extract the individual fields of the structure into vectors (see the Extended Example on https://github.com/lwabeke/QstarzGPS.jl/.
julia> using QstarzGPS
julia> filename = "230502_120613.BIN"
julia> gpsLog = readQstarzLog(filename)
5325-element Vector{GpsLogEntry}:
GpsLogEntry(0x03, 0x54, 0x0258, -25.75720058333333, 28.27944851666667, 0x6450fcb5, 6.7598f0, 1423.27f0, 178.39f0, 0.26171875f0, -0.28515625f0, 0.87109375f0, 0x0031, 1.97f0, 1.0f0, 15, 5, 0x01, 90, 0x00000000, 0x00000000)
GpsLogEntry(0x03, 0x54, 0x02bc, -25.75720188333333, 28.279449366666668, 0x6450fcb5, 7.5006f0, 1423.351f0, 179.87f0, 0.26171875f0, -0.546875f0, 1.2070312f0, 0x0031, 1.97f0, 1.0f0, 15, 5, 0x01, 90, 0x00000000, 0x00000000)
...
julia> using Dates
julia> unix2datetime.(gpsLog.time[1:3])
3-element Vector{DateTime}:
2023-05-02T12:06:13.600
2023-05-02T12:06:13.700
2023-05-02T12:06:13.800
By using Leaflet this can be easily visualised (for details see the Extended Example on https://github.com/lwabeke/QstarzGPS.jl/):