操纵杆使用的是XBOX360
launch文件地址
/opt/ros/kinetic/share/turtlebot_teleop/launch/xbox360_teleop.launch
源码
<launch>
<!--
Push the left frontal button labeled as 'LB' to activate cmd_vel publishing.
Move the left stick around to control the velocity.
-->
<!-- smooths inputs from cmd_vel_mux/input/teleop_raw to cmd_vel_mux/input/teleop -->
<include file="$(find turtlebot_teleop)/launch/includes/velocity_smoother.launch.xml"/>
<node pkg="turtlebot_teleop" type="turtlebot_teleop_joy" name="turtlebot_teleop_joystick">
<param name="scale_angular" value="1.5"/>
<param name="scale_linear" value="0.5"/>
<param name="axis_deadman" value="4"/>
<param name="axis_linear" value="1"/>
<param name="axis_angular" value="0"/>
<remap from="turtlebot_teleop_joystick/cmd_vel" to="teleop_velocity_smoother/raw_cmd_vel"/>
</node>
<node pkg="joy" type="joy_node" name="joystick">
<param name="dev" type="string" value="/dev/input/js0" />
</node>
</launch>
修改后的launch文件
<launch>
<!--
Push the left frontal button labeled as 'LB' to activate cmd_vel publishing.
Move the left stick around to control the velocity.
-->
<!-- smooths inputs from cmd_vel_mux/input/teleop_raw to cmd_vel_mux/input/teleop -->
<include file="$(find turtlebot_teleop)/launch/includes/velocity_smoother.launch.xml"/>
<node pkg="turtlebot_teleop" type="turtlebot_teleop_joy" name="turtlebot_teleop_joystick">
<param name="scale_angular" value="0.4"/>
<param name="scale_linear" value="0.1"/>
<param name="axis_deadman" value="4"/>
<param name="axis_linear" value="1"/>
<param name="axis_angular" value="0"/>
<remap from="turtlebot_teleop_joystick/cmd_vel" to="teleop_velocity_smoother/raw_cmd_vel"/>
</node>
<node pkg="joy" type="joy_node" name="joystick">
<param name="dev" type="string" value="/dev/input/js0" />
</node>
</launch>
修改了scale_angular确保旋转平稳
修改scale_linear确保线性速度的平稳
axis_deadman是解锁键,4对应的是LB,此处不作修改
axis_angular是方向键,0对应的是Left/Right Axis stick left,此处不作修改
axis_linear是前后键,1对应的是Up/Down Axis stick left,此处不作修改