Ask Your Question
0

How to get turtlebot to move in gazebo?

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

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: http://wiki.ros.org/turtlebot_gazebo/...

But get stuck on Step 2, which is really just getting this http://wiki.ros.org/turtlebot_simulat... to work.

I run

roscore
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

Comments

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 imagemali ( 2019-02-08 03:04:06 -0500 )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 imageahumay ( 2019-02-11 20:24:50 -0500 )edit

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

ahumay gravatar imageahumay ( 2019-02-11 20:30:36 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

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

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).

Try:

roslaunch kobuki_keyop keyop.launch
edit flag offensive delete link more

Comments

1

That worked! Thank you so much.

ahumay gravatar imageahumay ( 2019-02-11 20:30:09 -0500 )edit

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

Delb gravatar imageDelb ( 2019-02-12 00:55:43 -0500 )edit

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

ahumay gravatar imageahumay ( 2019-02-12 01:16:11 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 397 times

Last updated: Feb 08