GPS - Replaced 3D fix with lat/lon

This commit is contained in:
Gaston Gonzalez
2024-10-11 12:38:04 -07:00
parent 8c69772dfb
commit 1ec5672e6a
+5 -2
View File
@@ -66,8 +66,9 @@ case $1 in
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
# 3. Obtain the current GPS mode # 3. Obtain the current GPS mode
GPS_MODE=$(gpspipe -w -n 10 | grep -m 1 TPV | jq --exit-status -r .mode) GPS_JSON=$(gpspipe -w -n 10 | grep -m 1 TPV)
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
GPS_MODE=$(echo $GPS_JSON | jq --exit-status -r .mode)
case $GPS_MODE in case $GPS_MODE in
1) 1)
@@ -77,7 +78,9 @@ case $1 in
echo "2D fix" echo "2D fix"
;; ;;
3) 3)
echo "3D fix" LAT=$(echo $GPS_JSON | jq -r .lat)
LON=$(echo $GPS_JSON | jq -r .lon)
printf "%.5f,%.5f\n" $LAT $LON
;; ;;
*) *)
echo "Unknown mode" echo "Unknown mode"