Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Benoit ZERR
drivers-ddboat-v2
Commits
e91bf78e
Commit
e91bf78e
authored
Sep 29, 2021
by
BenZr
Browse files
try gpx log
parent
6e6255c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
gps_driver_v2.py
View file @
e91bf78e
...
...
@@ -16,6 +16,9 @@ class GpsIO:
def
init_line
(
self
,
timeout
=
1.0
):
self
.
ser
=
serial
.
Serial
(
'/dev/ttyS0'
,
timeout
=
timeout
)
def
init_line_devname_baudrate
(
self
,
devname
,
baudrate
,
timeout
=
1.0
):
self
.
ser
=
serial
.
Serial
(
devname
,
baudrate
=
baudrate
,
timeout
=
timeout
,
xonxoff
=
False
,
rtscts
=
False
,
dsrdtr
=
False
)
def
close
(
self
):
self
.
ser
.
close
()
...
...
tst_gpx.py
0 → 100644
View file @
e91bf78e
import
time
import
sys
import
gps_driver_v2
as
gpsdrv
def
cvt_gll_ddmm_2_dd
(
st
):
sts
=
st
.
split
(
" "
)
stlat
=
sts
[
0
]
stlon
=
sts
[
2
]
stlats
=
stlat
.
split
(
"."
)
stlons
=
stlon
.
split
(
"."
)
lat
=
double
(
stlats
[
0
][
0
:
len
(
stlats
[
0
])
-
2
])
lon
=
double
(
stlons
[
0
][
0
:
len
(
stlons
[
0
])
-
2
])
print
(
lat
,
lon
)
gps
=
gpsdrv
.
GpsIO
()
# debug with USB GPS
gps
.
init_line_devname_baudrate
(
"/dev/ttyUSB0"
,
9600
)
tmax
=
25.0
t0
=
time
.
time
()
while
True
:
print
(
"---------------------------------------------------"
)
# test GPS
gps_data_string
=
gps
.
read_gll
()
print
(
"GPS:"
,
gps_data_string
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment