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
dartv2_nom1_nom2_nom3
Commits
56803a15
Commit
56803a15
authored
Nov 15, 2021
by
Benoit ZERR
Browse files
update manual control to have it running on Windows
parent
ba10a877
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/manual_control.py
View file @
56803a15
...
...
@@ -28,38 +28,65 @@ def turnright():
if
__name__
==
"__main__"
:
mybot
=
dartv2b
.
DartV2
()
getkey
=
getkey
.
GetKey
()
get_key
=
getkey
.
GetKey
()
my_system
=
get_key
.
system
mybot
.
sonars
.
init_4_sonars
(
dmax
=
1.5
,
mode
=
"sync"
)
while
True
:
ch
=
getkey
()
ch
=
get
_
key
()
ich
=
ord
(
ch
)
if
ch
!=
0
:
print
(
ch
,
ich
,
ch
==
b
'b'
)
#
print (ch,ich,ch==b'b')
if
ich
==
27
or
ich
==
3
:
break
if
ch
==
"g"
:
goforward
()
elif
ch
==
b
"b"
:
gobackward
()
elif
ch
==
"f"
:
turnleft
()
elif
ch
==
"h"
:
turnright
()
elif
ch
==
"1"
:
ispd
=
0
elif
ch
==
"2"
:
ispd
=
1
elif
ch
==
"3"
:
ispd
=
2
elif
ch
==
"4"
:
idur
=
0
elif
ch
==
"5"
:
idur
=
1
elif
ch
==
"6"
:
idur
=
2
elif
ch
==
"7"
:
idur
=
3
if
my_system
==
"Windows"
:
if
ch
==
b
"g"
:
goforward
()
elif
ch
==
b
"b"
:
gobackward
()
elif
ch
==
b
"f"
:
turnleft
()
elif
ch
==
b
"h"
:
turnright
()
elif
ch
==
b
"1"
:
ispd
=
0
elif
ch
==
b
"2"
:
ispd
=
1
elif
ch
==
b
"3"
:
ispd
=
2
elif
ch
==
b
"4"
:
idur
=
0
elif
ch
==
b
"5"
:
idur
=
1
elif
ch
==
b
"6"
:
idur
=
2
elif
ch
==
b
"7"
:
idur
=
3
elif
m_system
==
"Linux"
:
if
ch
==
"g"
:
goforward
()
elif
ch
==
"b"
:
gobackward
()
elif
ch
==
"f"
:
turnleft
()
elif
ch
==
"h"
:
turnright
()
elif
ch
==
"1"
:
ispd
=
0
elif
ch
==
"2"
:
ispd
=
1
elif
ch
==
"3"
:
ispd
=
2
elif
ch
==
"4"
:
idur
=
0
elif
ch
==
"5"
:
idur
=
1
elif
ch
==
"6"
:
idur
=
2
elif
ch
==
"7"
:
idur
=
3
else
:
pass
"""
print ("speed go",tspdgo[ispd],"speed turn",tspdturn[ispd],"duration",tdur[idur])
print ("cardinal sonars")
...
...
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