Skip to content

Instantly share code, notes, and snippets.

@himynamesdave
Last active November 18, 2022 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save himynamesdave/d603ac9aa42c0c43e364f1c5fd23b6e0 to your computer and use it in GitHub Desktop.
Save himynamesdave/d603ac9aa42c0c43e364f1c5fd23b6e0 to your computer and use it in GitHub Desktop.
import struct
# header
reserved = struct.pack('<H', 0)
camm_case = struct.pack('<H', 5)
header = (reserved+camm_case)
# sample 0
latitude_0 = struct.pack('<d', 51.3454334)
longitude_0 = struct.pack('<d', -1.343435)
altitude_0 = struct.pack('<d', 184.1)
sample_0 = (header+latitude_0+longitude_0+altitude_0)
# sample 1
latitude_1 = struct.pack('<d', 51.356374)
longitude_1 = struct.pack('<d', -1.35)
altitude_1 = struct.pack('<d', 180.0)
sample_1 = (header+latitude_1+longitude_1+altitude_1)
# print the samples
print("Sample 0")
print(sample_0)
print("Sample 1")
print(sample_1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment