Created
September 10, 2017 04:03
-
-
Save houmei/b9c9dc6d120f7243fffd5ad400c3d69d to your computer and use it in GitHub Desktop.
GPS drift check -> $GPRMCより時刻/緯度/経度を抽出 あとはExcelなどで
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
gawk -f GPS.awk gps.log | sort > result.txt |
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
BEGIN{ | |
FS="," | |
Noffset = 設置場所の緯度 | |
Eoffset = 設置場所の経度 | |
# $GPRMC,時刻,ステータス{V|A},緯度,{N|S},経度,{E|W},地表における移動速度knot,地表における移動の真方位,日付ddmmyy,磁北と真北の角度差,角度差の方向{E|W},モード{N|A|D|E}*CSUN | |
# $GPGGA,時刻,緯度,{N|S},経度,{E|W},位置特定品質{0|1|2},使用衛星数,水平精度低下率,アンテナ海抜高,M,ジオイド高,M,DGPS時間,作動基準点ID*CSUM | |
# $GPGSA,{A|M},特定タイプ{1|2|3},位置精度低下率,垂直精度低下率*CSUM | |
} | |
$1 == "$GPRMC" { | |
d = $10 | |
# yymmdd = substr(d,5,2) substr(d,3,2) substr(d,1,2) | |
yymmdd = substr(d,1,2) | |
t = yymmdd substr($2,1,6) | |
if ($3=="A") { | |
Ido[t]=$4-Noffset | |
Keido[t]=$6-Eoffset | |
} | |
} | |
END { | |
for (i in Ido) { | |
print i,Ido[i],Keido[i] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment