Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gxiang
Mobilebot
Commits
6797fe0b
Commit
6797fe0b
authored
Aug 26, 2020
by
Demo User
Browse files
mbot_teleop_simple.py
parent
4f5f9c04
Changes
1
Hide whitespace changes
Inline
Side-by-side
python/mbot_teleop_simple.py
View file @
6797fe0b
...
...
@@ -9,8 +9,8 @@ import sys
sys
.
path
.
append
(
"lcmtypes"
)
import
lcm
from
lcmtypes
import
mbot_motor_pwm_t
FWD_PWM_CMD
=
0.
5
TURN_PWM_CMD
=
0.
25
FWD_PWM_CMD
=
0.
3
TURN_PWM_CMD
=
0.
3
lc
=
lcm
.
LCM
(
"udpm://239.255.76.67:7667?ttl=1"
)
pygame
.
init
()
...
...
@@ -47,7 +47,7 @@ for frame in camera.capture_continuous(rawCapture, format="bgr", use_video_port=
if
key_input
[
pygame
.
K_DOWN
]:
fwd
-=
1.0
command
=
mbot_motor_pwm_t
()
command
.
left_motor_pwm
=
-
(
fwd
*
FWD_PWM_CMD
-
turn
*
TURN_PWM_CMD
)
command
.
left_motor_pwm
=
fwd
*
FWD_PWM_CMD
-
turn
*
TURN_PWM_CMD
command
.
right_motor_pwm
=
fwd
*
FWD_PWM_CMD
+
turn
*
TURN_PWM_CMD
lc
.
publish
(
"MBOT_MOTOR_PWM"
,
command
.
encode
())
rawCapture
.
truncate
(
0
)
Write
Preview
Supports
Markdown
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