weixin_39717367
weixin_39717367
2020-12-08 19:21

Turtlebot_teleop points to wrong topic for turtlebot2

Hard coded 'cmd_vel' here: https://github.com/turtlebot/turtlebot_apps/blob/master/turtlebot_teleop/src/turtlebot_key.cpp

instead of the new '/cmd_vel_mux/input/teleop'. Took me ages to figure out why my turtlebot2 wasn't spinning :-)

I know this can be fixed by putting it in a launch file and remapping, but teleop is something that users are likely to start and stop at runtime, so still being able to 'rosrun' it is very useful. Perhaps have a 'turtlebot_key' and a 'turtlebot2_key' as a quick and dirty fix?

该提问来源于开源项目:turtlebot/turtlebot

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

4条回答

  • weixin_39926588 weixin_39926588 5月前

    Actually, I prefer having it work in roslaunchers. There will always be nodes that do remapping, so the rosrun rule for anything but the simplest tests will break down at some point so roslaunch is a good habit.

    On top of that....if we wanted it to point to /cmd_vel_mux/input/teleop, we'd have to hard code an absolute path into the system which kind of breaks best practice - that is putting topic names in relative namespaces so they can be pushed down by some other user if they wish.

    Is rosrun www xxx actually much harder than roslaunch yyy zzz?

    点赞 评论 复制链接分享
  • weixin_39717367 weixin_39717367 5月前

    Oh, sorry, I meant users could make their own launch file & remap, but having a readymade one was more useful. I don't have a preference for rosrun over roslaunch or anything. Just that the teleop stuff only worked out of the box with a turtlebot1, not a turtlebot2.

    点赞 评论 复制链接分享
  • weixin_39926588 weixin_39926588 5月前

    Ah, I see where the confusion stems from now. The c++ teleop was depracated a long time ago, but never removed (pre turtlebot2 in fact). They use the python teleop now. I should probably remove that c++ source, it's not even getting built.

    Does roslaunch turtlebot_teleop keyboard_teleop.launch work for you? That's the officially supported keyboard teleop that should work out of the box.

    点赞 评论 复制链接分享
  • weixin_39717367 weixin_39717367 5月前

    That works, thanks Daniel!

    点赞 评论 复制链接分享