The topic name has been remapped from turtlebot_teleop_keyboard/cmd_vel
to cmd_vel_mux/input/teleop
. See keyboard_teleop.launch. So try /cmd_vel_mux/input/teleop
instead of /cmd_vel
.
Edit:
Since you’ve asked another question- #q349325 and you've referred to this tutorial, I assume you are also referring to that link here.
Have you terminated your keyboard_teleop.launch
before running
rostopic pub /cmd_vel_mux/input/navi geometry_msgs/Twist '{linear: {x: 10, y: 0, z: 0}, angular: {x: 0, y: 0, z: 0}}'
A very possible reason that your turtlebot did not move is your teleop command (/cmd_vel_mux/input/teleop
) published by node turtlebot_teleop_keyboard
overwrote your navi stack’s command (/cmd_vel_mux/input/navi
).
Kobuki's control system uses cmd_vel_mux
to manage multiple incoming velocity commands and to determine which input is going to be prioritized according to a YAML
file- mux.yaml (in this case):
subscribers:
- name: "Safe reactive controller"
topic: "input/safety_controller"
timeout: 0.2
priority: 10
- name: "Teleoperation"
topic: "input/teleop"
timeout: 1.0
priority: 7
- name: "Switch"
topic: "input/switch"
timeout: 1.0
priority: 6
- name: "Navigation"
topic: "input/navi"
timeout: 1.0
priority: 5
As you can see, the topic input/navi
has lower priority than input/teleop
.
Therefore, you either terminate thekeyboard_teleop.launch
and then use one among these four topics, or publish velocity command only to/cmd_vel_mux/input/safety_controller
or /cmd_vel_mux/input/teleop
to control your turtlebot while running turtlebot_teleop_keyboard
node.
For more information about control system of Kobuki/Turtlebot2, please see kobuki/Tutorials/Kobuki's Control System.
In fact, if you only have velocity commands from one source, you don’t really need cmd_vel_mux
to multiplex your velocity commands. You can publish velocity-command messages directly to /mobile_base/commands/velocity
which is the topic gazebo node receives/subscribes.