turtlebot2--修改操纵杆控制的速度(记录)

博客介绍了使用XBOX360操纵杆控制turtlebot2的相关设置。包括launch文件地址、源码,以及修改后的launch文件内容,如修改scale_angular保证旋转平稳、修改scale_linear保证线性速度平稳,还提及解锁键、方向键和前后键的对应设置且部分不作修改。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

操纵杆使用的是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,此处不作修改

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值