Gazebo | Ignition | Community
Ask Your Question

Teleop in Gazebo through ROS

asked 2014-08-14 09:35:04 -0500

K. Zeng gravatar image

I already have a 4 wheeled vehicle model as well as several environments I can put the vehicle in. I am using ROS Indigo along with Gazebo 2.22 in Ubuntu Trusty. Right now, I'm trying to create a keyboard teleop program for the vehicle in question through ROS. Can some one provide some pointers on how to do so? Thank you very much. If the anyone believe that this question is more appropriate for the ROS answers page, please comment. I will gladly delete this question.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-08-20 05:13:04 -0500

Most of the teleop apps in ROS just send geometry_msgs/Twist messages. This means a message containing a a rotation and a translation vector. On gazebo side you can implement a plugin(or use one of the existing ones) to react on that message. There seems to be a convention to use the topic name vel_cmd for this purpose.

For examples look at the movement plugins here(skid_steering, planar_move etc...):


It should be possible to use one of the existing teleop scripts to control the robot(for example from turtlesim or pr2)

edit flag offensive delete link more


Ah, ok. I think I get it. The issue now is what is the code for logging keypress like (i.e. the directional keys for turning and moving the robot)?

K. Zeng gravatar imageK. Zeng ( 2014-08-21 12:35:05 -0500 )edit

Right now, I have a temporary solution using if statements, WASD key input, as well as the gazebo/setmodelstate rosservice call. It works for the most part, except for the fact that the model resets to orientation (0, 0, 0) and then turn to the position I want it to when I input commands to turn the robot.

K. Zeng gravatar imageK. Zeng ( 2014-08-25 10:03:23 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2014-08-14 09:35:04 -0500

Seen: 2,906 times

Last updated: Aug 20 '14