Last active
November 18, 2022 08:10
-
-
Save himynamesdave/d603ac9aa42c0c43e364f1c5fd23b6e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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