ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How can I control my gazebo model using keyboard ?

asked 2015-04-02 03:55:11 -0500

akshay5059 gravatar image

Hi eveyone !

I have built a small model of a small cart having 4 tyres. I have applied revolute joints for all the tyres. Now I can control this cart in gazebo by giving values of force to these joints. But I want to control this cart using my keyboard. Can anyone tell me how to do that ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-04-02 16:12:41 -0500

l0g1x gravatar image

Assuming you are using ROS alongside gazebo, you will want to add a drivetrain plugin to your URDF or SDF model. If you look at this link scroll down and you will see either Differential Drive or Skid Steering Drive. You can just copy and paste the code into your URDF (if its SDF then dont include the <gazebo> tags) and specify the respective joints of your robot.

This ROS-Gazebo plugin will then basically act as a node that subscribes to a "/cmd_vel" topic, and you can install the package "ros-indigo-key-teleop" (assuming your on indigo) to be able to use your keyboard to send a command velocity.

edit flag offensive delete link more

Question Tools



Asked: 2015-04-02 03:55:11 -0500

Seen: 2,994 times

Last updated: Apr 02 '15