0
$\begingroup$

Rosanswers logo

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/Tutorials/indigo/Make%20a%20map%20and%20navigate%20with%20it

But get stuck on Step 2, which is really just getting this http://wiki.ros.org/turtlebot_simulator/Tutorials/hydro/Explore%20the%20Gazebo%20world 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').


Originally posted by ahumay on ROS Answers with karma: 3 on 2019-02-07

Post score: 0


Original comments

Comment by mali on 2019-02-08:
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?

Comment by ahumay on 2019-02-11:
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.

Comment by ahumay on 2019-02-11:
Delb's solution actually has it moving now. Thank you anyways though

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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

Originally posted by Delb with karma: 3907 on 2019-02-08

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by ahumay on 2019-02-11:
That worked! Thank you so much.

Comment by Delb on 2019-02-12:
Glad it worked, have you modified the script or just used the kobuki_keyop package ?

Comment by ahumay on 2019-02-12:
Just the kobuki_keyop package, which is odd because I swore I tried it before. Obviously not though

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.