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

How to get turtlebot to move in gazebo?

asked 2019-02-07 15:29:40 -0600

ahumay gravatar image

Hi, I am brand new to ROS and have had issues setting up my turtlebot_gazebo to just have the simulated turtlebot move around.

I am just trying to follow this tutorial:

But get stuck on Step 2, which is really just getting this to work.

I run

roslaunch turtlebot_gazebo turtlebot_world.launch
roslaunch turtlebot_rviz_launchers view_robot.launch

Which both work fine.

Then I do

roslaunch turtlebot_teleop keyboard_teleop.launch

However, while my key presses to move the robot appear in the keyboard_teleop.launch terminal window, the robot doesn't move in Rviz.

How do I get my robot to listen to the turtlebot_telop_keyboard/cmd_vel topic if my robot only exists in simulation? Which node is the actual turtlebot?

Do I need to have

roslaunch turtlebot_stage turtlebot_in_stage.launch

be running? Because that gives me an error (Invalid roslaunch XML syntax: [Errno 2] No such file or directory: u'/opt/ros/kinetic/share/turtlebot_navigation/launch/includes/amcl.launch.xml').

edit retag flag offensive close merge delete


Hi, To figure out why the robot does not move, make sure that you are publishing on the correct topic. so start with rostopic list and check if keyboard_teleop publishes on the correct topic. could you tell which version of ros you are using indigo or kinetic?

mali gravatar image mali  ( 2019-02-08 03:04:06 -0600 )edit

Thank you for your prompt response! When I run

rosnode info /turtlebot_teleop_keyboard

I get Node [/turtlebot_teleop_keyboard] Publications: * /cmd_vel_mux/input/teleop [geometry_msgs/Twist] * /rosout [rosgraph_msgs/Log]

So it looks right

I am running Ubuntu 15.10 and my ROS is Kinetic.

ahumay gravatar image ahumay  ( 2019-02-11 20:24:50 -0600 )edit

Delb's solution actually has it moving now. Thank you anyways though

ahumay gravatar image ahumay  ( 2019-02-11 20:30:36 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-02-08 03:00:54 -0600

Delb gravatar image

There seems to be a bug in the script responsible to set the speed of the robot because you do have the topic /mobile_base/commands/velocitypublishing data (this is the topic that moves the robot) but this data is always only 0 eventhough you press some keys and the script prints different speeds. So you can either investigate the script turtlebot_teleop_key or instead you can use another launch file that is working fine that use the mobile_base of the turtlebot directly (i.e. kobuki).


roslaunch kobuki_keyop keyop.launch
edit flag offensive delete link more



That worked! Thank you so much.

ahumay gravatar image ahumay  ( 2019-02-11 20:30:09 -0600 )edit

Glad it worked, have you modified the script or just used the kobuki_keyop package ?

Delb gravatar image Delb  ( 2019-02-12 00:55:43 -0600 )edit

Just the kobuki_keyop package, which is odd because I swore I tried it before. Obviously not though

ahumay gravatar image ahumay  ( 2019-02-12 01:16:11 -0600 )edit

Question Tools

1 follower


Asked: 2019-02-07 15:29:40 -0600

Seen: 4,214 times

Last updated: Feb 08 '19