12.3-ros遥操作teleop
Posted lizhensheng
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了12.3-ros遥操作teleop相关的知识,希望对你有一定的参考价值。
ROS使用XBOX ONE 手柄
前言
- 基础知识
参考
ros wiki
Tutorial
Msg Remapper
Linux Configuration
JoyStick_drivers
Configuring a Multiple Joystick System
How to Write a Generic Teleoperation Node
teleop_twist_joy
xbone BT wireless controller issue with ubuntu
学习记录
安装相关包
sudo apt install ros-kinetic-joy-teleop ros-kinetic-teleop-tools ros-kinetic-teleop-twist-joy ros-kinetic-teleop-twist-keyboard
配置Linux
ls /dev/input/
# 手柄被标识为js2,js1居然是笔记本的加速度计!
sudo jstest /dev/input/js2
# 可以看到数据在变化
Driver version is 2.1.0.
Joystick (Microsoft X-Box One pad) has 8 axes (X, Y, Z, Rx, Ry, Rz, Hat0X, Hat0Y)
and 11 buttons (BtnX, BtnY, BtnTL, BtnTR, BtnTR2, BtnSelect, BtnThumbL, BtnThumbR, ?, ?, ?).
Testing ... (interrupt to exit)
Axes: 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:off 7:off 8:off 9
# 查看此设备的访问权限,为ROS程序(用户域)添加权限
ls -l /dev/input/js2
sudo chmod a+rw /dev/input/js2
ROS包使用
- 使用joy和teleop_twist_joy包
手柄控制P3AT的roslaunch文件
<launch>
<node pkg = "joy" type = "joy_node" name = "joy_node" output="screen">
<param name="dev" value="/dev/input/js2" type="string"/>
<param name="deadzone" value="0.05"/>
<param name="autorepeat_rate" value="0.0"/>
<param name="coalesce_interval" value="0.001"/>
</node>
<node pkg = "teleop_twist_joy" type = "teleop_node" name = "teleop_node" output="screen">
<param name="enable_button" value="0"/>
<param name="enable_turbo_button" value="-1"/>
<param name="axis_linear" value="1"/>
<param name="scale_linear_turbo" value="1.0"/>
<param name="axis_angular" value="0"/>
<param name="scale_angular" value="1.0"/>
<remap from="cmd_vel" to="RosAria/cmd_vel" />
</node>
</launch>
- 使用方法
- 按住A按钮,控制左轴,移动平台就可以动了
自定义使用
- 请查看参考页面,编程实现JOY消息处理和多手柄遥操作
关于xbone BT wireless controller
- Linux内核还没有更新与手柄连接的驱动程序,所以蓝牙不能正常连接
ros wiki
Tutorial
Msg Remapper
Linux Configuration
JoyStick_drivers
Configuring a Multiple Joystick System
How to Write a Generic Teleoperation Node
teleop_twist_joy
xbone BT wireless controller issue with ubuntu
sudo apt install ros-kinetic-joy-teleop ros-kinetic-teleop-tools ros-kinetic-teleop-twist-joy ros-kinetic-teleop-twist-keyboard
ls /dev/input/
# 手柄被标识为js2,js1居然是笔记本的加速度计!
sudo jstest /dev/input/js2
# 可以看到数据在变化
Driver version is 2.1.0.
Joystick (Microsoft X-Box One pad) has 8 axes (X, Y, Z, Rx, Ry, Rz, Hat0X, Hat0Y)
and 11 buttons (BtnX, BtnY, BtnTL, BtnTR, BtnTR2, BtnSelect, BtnThumbL, BtnThumbR, ?, ?, ?).
Testing ... (interrupt to exit)
Axes: 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:off 7:off 8:off 9
# 查看此设备的访问权限,为ROS程序(用户域)添加权限
ls -l /dev/input/js2
sudo chmod a+rw /dev/input/js2
<launch>
<node pkg = "joy" type = "joy_node" name = "joy_node" output="screen">
<param name="dev" value="/dev/input/js2" type="string"/>
<param name="deadzone" value="0.05"/>
<param name="autorepeat_rate" value="0.0"/>
<param name="coalesce_interval" value="0.001"/>
</node>
<node pkg = "teleop_twist_joy" type = "teleop_node" name = "teleop_node" output="screen">
<param name="enable_button" value="0"/>
<param name="enable_turbo_button" value="-1"/>
<param name="axis_linear" value="1"/>
<param name="scale_linear_turbo" value="1.0"/>
<param name="axis_angular" value="0"/>
<param name="scale_angular" value="1.0"/>
<remap from="cmd_vel" to="RosAria/cmd_vel" />
</node>
</launch>
以上是关于12.3-ros遥操作teleop的主要内容,如果未能解决你的问题,请参考以下文章