ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

cmd vel - control robot

asked 2022-06-02 04:01:19 -0600

NickRos gravatar image

updated 2022-07-10 12:10:12 -0600

lucasw gravatar image

Hello. I have a problem using ROS. I'm a beginner. I want to move this robot in the Gazebo simulation.

What I'm doing is the following: I open a terminal and type:


Then I open a new tab and I type:

cd catkin_ws

roslaunch p3dx_gazebo p3dx_empty_world.launch

So Gazebo opens with the robot inside.

Now I want to move the robot (send command via cmd_vel topic). What I'm doing here is this:

rostopic pub /cmd_vel geometry_msgs/Twist -r 10 -- '[2.0, 0.0, 0.0]' '[0.0, 0.0, 0.0]'

But the robot doesn't move.

What should I do?

Thanks in advance.

edit retag flag offensive close merge delete


Check if Simulation is not paused.

CroCo gravatar image CroCo  ( 2022-06-02 07:14:27 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-06-02 04:40:28 -0600

Joe28965 gravatar image

updated 2022-06-02 05:53:54 -0600

ljaniec gravatar image

Check your topics using rostopic list. By default your robot launches with the namespace pioneer according to this line. I'm guessing your cmd_vel topic is actually called /pioneer/cmd_vel in that case publishing to cmd_vel isn't going to do anything.

If you do not want to use a namespace, you need to launch roslaunch p3dx_gazebo p3dx_empty_world_no_ns.launch.

edit flag offensive delete link more


nice catch!

CroCo gravatar image CroCo  ( 2022-06-02 07:18:40 -0600 )edit

Question Tools


Asked: 2022-06-02 04:01:19 -0600

Seen: 687 times

Last updated: Jun 02 '22