Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

GAugusto, thanks for replying! I followed your instructions but still I cannot control the robot with keyboard manually, thats what I have done:

in this page http://wiki.ros.org/turtlebot_teleop

a description for the published topics of turtlebot , one of them is turtlebot_telop_keyboard/cmd_vel (<<msglink2(geometry_msgs twist)&gt;&gt;)="" <="" p="">

I changed the string name in my plugin :

from: std::string name = "gz";

to : std::string name = "turtlebot_teleop_keyboard";

subscriber :

  this->sub = this->node->subscribe<geometry_msgs::Twist>("cmd_vel",10, boost::bind(&ROSMotorControllerPlugin::ROSCallback, this , _1));

Then, I started gazebo from roslunch since I am using gazebo_ros_pckgs

roslaunch package_name file.launch

I checked the rostopic list and this what I found /gazebo/cmd_vel I managed to control it with this line command but not manually :

rostopic pub -1 /gazebo/cmd_vel geometry_msgs/Twist '{linear: { x: -0.040}}'

then I tried to change the topic name from "cmd_vel" to “turtlebot_teleop_keyboard/cmd_vel “ and keeping the string name as it is “gz” , in rostopic list I got

/gazebo/turtlebot_teleop_keyboard/cmd_vel

also, it didnt work with keyboard.

Note: I did all the above again when launching gazebo as “gazebo file.world” and also no change. So can you plz tell me what I am missing here?

Thanks a lot!