Teleop Twist Keyboard Node
- Subscribes to:
/scan
- Publishes to:
/cmd_vel
it can implement two behaviours on robot:
- 1: moving without obstacle avoidance:
user can move the robot using keys it publishes the desired movements to cmd_vel topic
- 2: moveing with obstacle avoidance:
subscribes scan topic and uses it to detect obstacles. user can move the robot using keys and it also avoids the robot from colliding the obstacles
Here is the instruction for controlling the robot with keyboard:
Moving around
u
i
o
j
k
l
m
,
.
Holonomic mode(strafing)
U
I
O
J
K
L
M
<
>
t : up (+z)
b : down (-z)
anything else : stop
q/z : increase/decrease max speeds by 10%
w/x : increase/decrease only linear speed by 10%
e/c : increase/decrease only angular speed by 10%
CTRL-C to change robot behaviour
- class scripts.teleop_twist_keyboard.PublishThread(rate)[source]
A class which is used for synchronization and publishing robot’s twist into cmd_vel topic
Attributes:
- x, y, z, th, speed, turnfloat
Robot’s Position Information
- donebool
Robot State
Methods:
- scripts.teleop_twist_keyboard.clbk_laser(msg)[source]
Callback function for subscring laser scan topic
- Parameters
msg (float) – rangefinder sensor data
- scripts.teleop_twist_keyboard.getKey(key_timeout)[source]
Gets commands from user
- Parameters
key_timeout (float) – timeout for input key
- Returns
user input key
- Return type
key(str)