ROS 2 robot does not move: check cmd_vel has a publisher and a subscriber

Run ros2 topic info on cmd_vel. It must show a publisher and a subscriber, with the same message type.

What the message means

Navigation and teleop nodes publish velocity commands. If the base driver listens on a different name, type or namespace, nothing moves.

Fix it in this order

  1. Run ros2 topic list and find the velocity topic your base driver uses.
  2. Run ros2 topic info for it and check counts and types.
  3. Remap the topic in the launch file so publisher and subscriber match.
  4. Echo the topic while you send a command, to see the messages.
  5. Check the base driver is running and connected to the motor controller.
  6. Use the stamped or the plain message type your ROS 2 version expects.

Why it happens

A topic connects only when the name, the message type and the quality-of-service settings are compatible. Newer ROS 2 releases use geometry_msgs/msg/TwistStamped for some velocity inputs, while older ones and many drivers expect plain Twist, so the names match and the types do not. ros2 topic info with the verbose flag shows both the types and the QoS of each side.

Namespaces matter too. A driver started under a namespace listens on a different full name from the one your teleop node publishes to, which a remap in the launch file fixes.

If you see this, do this

You seeDo this
No subscriber listedDriver not running or other name.
Messages arrive, no motionCheck the driver and the motor power.

topic list empty, Gazebo and ROS 2.

Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.

Why this happens

ROS 2 connects a publisher to a subscriber only when three things are compatible: the full topic name, the message type, and the quality-of-service settings. A teleop node can publish to /cmd_vel while the driver listens on /robot/cmd_vel, or the driver expects geometry_msgs/msg/TwistStamped while the teleop node sends geometry_msgs/msg/Twist. In every one of those cases there is no error. The nodes simply never connect.

Many base drivers also stop the motors if they do not receive a command for a short time. A single message sent once may start the wheels for a moment and then stop them, which looks like no motion. Publishing at a steady rate rules that out.

How to confirm the cause

  • Run ros2 topic list and find the exact name of the velocity topic. Compare it with the name your teleop or navigation node uses.
  • Run ros2 topic info /cmd_vel –verbose. The output lists publisher and subscriber counts, with the type and QoS of each. A count of zero on one side shows which half is missing.
  • Run ros2 node info on the driver node and read its Subscribers section for the name and type it really uses.
  • Run ros2 topic echo on the topic while you send a command. If messages appear but nothing moves, the problem is behind the topic: the driver, the motor power or the serial link.
  • Check ros2 node list for the driver. If it is not listed, it is not running or is under a different namespace.

Worked example

Test the driver without teleop by publishing a slow forward command at a steady rate. Lift the robot’s wheels first. Then, if the names differ, start the teleop node with a remap so that it publishes where the driver listens.

# publish 0.1 m/s forward, 10 times per second
ros2 topic pub -r 10 /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.1}}"

# remap the teleop output to the driver's topic
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r cmd_vel:=/robot/cmd_vel

Common mistakes

  • Checking that the topic exists, but not the message type on each side.
  • Sending one message with –once to a driver that has a command timeout.
  • Starting nodes in different ROS_DOMAIN_ID values, so they never see each other.
  • Forgetting the namespace of the driver in a launch file.
  • Reading a silent echo as a motor fault when it really means no messages reach the topic.

If this did not fix it

  • The ROS_DOMAIN_ID in every terminal, since a different value hides all topics.
  • The motor controller link and its power, if messages reach the driver but the wheels stay still.
  • A multiplexer or navigation stack in between that is blocking or re-publishing commands under another name.