Teleoperating ROS Turtle using a keyboard
This section is for beginners who haven't worked with teleoperation in ROS yet. In this section, we will see how to teleoperate a robot manually using a keyboard. Using a keyboard, we can translate and rotate the robot. One of the basic example to demonstrate keyboard teleoperation is ROS turtlesim
.
The following commands launch turtlesim
with keyboard teleoperation. You can run each command on separate Terminals.
Run roscore
:
$ roscore
Run a turtlesim
node using the following command. This command will launch the turtlesim
window:
$ rosrun turtlesim turtlesim_node
Run the keyboard teleoperation node. We can change the turtle's position by pressing arrow keys on the keyboard:
$ rosrun turtlesim turtle_teleop_key
The screenshot of the moving turtle using arrow keys is shown here:
Figure 1: Turtlesim keyboard teleoperation
In ROS, most of the robot packages are bundled with a teleop node for manual control of the robot. This control can either be through...