aerpaw gps csv reader
This commit is contained in:
9
.gitignore
vendored
9
.gitignore
vendored
@@ -55,3 +55,12 @@ aerpaw/venv/*
|
||||
|
||||
# Pycache
|
||||
__pycache__
|
||||
|
||||
# aerpaw stuff
|
||||
aerpaw/build/
|
||||
aerpaw/build/*
|
||||
aerpaw/client/__pycache__/
|
||||
aerpaw/client/__pycache__/*
|
||||
aerpaw/codegen/
|
||||
aerpaw/codegen/*
|
||||
|
||||
|
||||
Binary file not shown.
0
aerpaw/results/playback.m
Normal file
0
aerpaw/results/playback.m
Normal file
33
aerpaw/results/readGpsCsv.m
Normal file
33
aerpaw/results/readGpsCsv.m
Normal file
@@ -0,0 +1,33 @@
|
||||
function [G] = readGpsCsv(csvPath)
|
||||
arguments (Input)
|
||||
csvPath (1, 1) string {isfile(csvPath)};
|
||||
end
|
||||
|
||||
arguments (Output)
|
||||
G (:, 10) table;
|
||||
end
|
||||
|
||||
G = readtable(csvPath, "ReadVariableNames", false);
|
||||
|
||||
% first column is just index, meaningless, toss it
|
||||
G = G(:, 2:end);
|
||||
|
||||
% switch to the correct LLA convention (lat, lon, alt)
|
||||
tmp = G(:, 2);
|
||||
G(:, 2) = G(:, 1);
|
||||
G(:, 1) = tmp;
|
||||
|
||||
% Split pitch, yaw, roll data read in as one string per timestep into separate columns
|
||||
PYR = cell2mat(cellfun(@(x) str2num(strip(strip(x, "left", "("), "right", ")")), table2cell(G(:, 5)), "UniformOutput", false)); %#ok<ST2NM>
|
||||
% Reinsert to original table
|
||||
G = [G(:, 1:3), table(PYR(:, 1), VariableNames="Pitch"), table(PYR(:, 2), VariableNames="Yaw"), table(PYR(:, 3), VariableNames="Roll"), G(:, 6:end)];
|
||||
|
||||
% Clean up datetime entry
|
||||
G = [table(datetime(G{:,8}, "InputFormat","yyyy-MM-dd HH:mm:ss.SSS", "TimeZone","America/New_York")), G(:, [1:7, 9:10])];
|
||||
|
||||
% Fix variable names
|
||||
G.Properties.VariableNames = ["Timestamp", "Latitude", "Longitude", "Altitude", "Pitch", "Yaw", "Roll", "Voltage", "GPS Status", "Satellites"];
|
||||
G.Properties.VariableTypes = ["datetime", "double", "double", "double", "double", "double", "double", "double", "double", "double"];
|
||||
G.Properties.VariableUnits = ["yyyy-MM-dd HH:mm:ss.SSS (UTC+5)", "deg", "deg", "m", "deg", "deg", "deg", "Volts", "", ""];
|
||||
|
||||
end
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info Ref="aerpaw/results" Type="Relative"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="7be3d3d4-60d2-4116-ab44-6e7ddde78304" type="Reference"/>
|
||||
@@ -1,2 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="build" type="File"/>
|
||||
<Info location="results" type="File"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="controller_app" type="File"/>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="playback.m" type="File"/>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info>
|
||||
<Category UUID="FileClassCategory">
|
||||
<Label UUID="design"/>
|
||||
</Category>
|
||||
</Info>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="readGpsCsv.m" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="server.yaml" type="File"/>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="config.yaml" type="File"/>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Info location="client.yaml" type="File"/>
|
||||
Reference in New Issue
Block a user