Robotics StackExchange | Archived questions

Teleop in Gazebo through ROS

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.

Asked by K. Zeng on 2014-08-14 09:35:04 UTC

Comments

Answers

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

ros_gzplugins

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

Asked by evilBiber on 2014-08-20 05:13:04 UTC

Comments

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

Asked by K. Zeng on 2014-08-21 12:35:05 UTC

Right now, I have a temporary solution using if statements, WASD key input, as well as the gazebo/set_model_state 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.

Asked by K. Zeng on 2014-08-25 10:03:23 UTC