# teleop_twist_keyboard
Generic Keyboard Teleop for ROS
# Launch
Run.
```
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
```
With custom values.
```
rosrun teleop_twist_keyboard teleop_twist_keyboard.py _speed:=0.9 _turn:=0.8
```
Publishing to a different topic (in this case `my_cmd_vel`).
```
rosrun teleop_twist_keyboard teleop_twist_keyboard.py cmd_vel:=my_cmd_vel
```
# Usage
```
Reading from the keyboard and Publishing to Twist!
---------------------------
Moving around:
u i o
j k l
m , .
For Holonomic mode (strafing), hold down the shift key:
---------------------------
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 quit
```
# Repeat Rate
If your mobile base requires constant updates on the cmd\_vel topic, teleop\_twist\_keyboard can be configured to repeat the last command at a fixed interval, using the `repeat_rate` private parameter.
For example, to repeat the last command at 10Hz:
```
rosrun teleop_twist_keyboard teleop_twist_keyboard.py _repeat_rate:=10.0
```
It is _highly_ recommened that the repeat rate be used in conjunction with the key timeout, to prevent runaway robots.
# Key Timeout
Teleop\_twist\_keyboard can be configured to stop your robot if it does not receive any key presses in a configured time period, using the `key_timeout` private parameter.
For example, to stop your robot if a keypress has not been received in 0.6 seconds:
```
rosrun teleop_twist_keyboard teleop_twist_keyboard.py _key_timeout:=0.6
```
It is recommended that you set `key_timeout` higher than the initial key repeat delay on your system (This delay is 0.5 seconds by default on Ubuntu, but can be adjusted).
# Twist with header
Publishing a `TwistStamped` message instead of `Twist` can be enabled with the `stamped` private parameter. Additionally the `frame_id` of the `TwistStamped` message can be set with the `frame_id` private parameter.
```
rosrun teleop_twist_keyboard teleop_twist_keyboard.py _stamped:=True _frame_id:=base_link
```
没有合适的资源?快使用搜索试试~ 我知道了~
github开源键盘控制代码
共5个文件
py:1个
xml:1个
md:1个
需积分: 0 4 下载量 101 浏览量
2022-08-01
11:13:34
上传
评论
收藏 5KB ZIP 举报
温馨提示
github开源键盘控制代码
资源详情
资源评论
资源推荐
收起资源包目录
teleop_twist_keyboard-master.zip (5个子文件)
teleop_twist_keyboard-master
teleop_twist_keyboard.py 7KB
CMakeLists.txt 347B
CHANGELOG.rst 2KB
README.md 2KB
package.xml 505B
共 5 条
- 1
干物妹喵了个咪
- 粉丝: 7
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0