Skip to main content
Teleoperation allows you to manually control the TurtleBot3 robot using keyboard commands. This is essential for testing, exploring environments during SLAM, and verifying robot functionality.

Starting teleoperation

Using the alias

The simplest way to start keyboard teleoperation:
tb3_teleop

Using the full command

Alternatively, use the complete ROS2 command:
ros2 run turtlebot3_teleop teleop_keyboard
Before starting teleoperation, ensure a simulation world is already running. The robot must exist in Gazebo before you can control it.

Keyboard controls

Once teleoperation is active, use these keyboard keys to control the robot:
KeyActionDescription
iMove forwardDrives the robot straight ahead
,Move backwardDrives the robot in reverse
jRotate leftRotates the robot counter-clockwise
lRotate rightRotates the robot clockwise
kStopImmediately stops all robot movement
uForward + leftMoves forward while turning left
oForward + rightMoves forward while turning right
mBackward + leftMoves backward while turning left
.Backward + rightMoves backward while turning right
Press k immediately if the robot behaves unexpectedly. This key stops all movement and is your emergency brake.

Speed control

Adjust the robot’s velocity while teleoperation is running:
KeyActionDescription
wIncrease linear speedMakes forward/backward movement faster
xDecrease linear speedMakes forward/backward movement slower
aIncrease angular speedMakes rotation faster
dDecrease angular speedMakes rotation slower
sReset to default speedReturns to default velocity settings

Basic teleoperation workflow

1

Launch simulation

Start a Gazebo world in the first terminal:
tb3_empty
Wait for Gazebo to fully load with the robot visible.
2

Start teleoperation

Open a second terminal and launch keyboard control:
tb3_teleop
3

Control the robot

Use the keyboard keys to move the robot:
  • Press i to move forward
  • Press j or l to rotate
  • Press k to stop
4

Observe in VNC

Watch the robot movement in Gazebo through your browser at:
http://localhost:6080

Complete workflow example

Terminal 1: Launch simulation

tb3_world
Wait for the TurtleBot3 world to load completely.

Terminal 2: Start teleoperation

tb3_teleop
You’ll see output similar to:
Control Your TurtleBot3!
---------------------------
Moving around:
        u    i    o
        j    k    l
        m    ,    .

w/x : increase/decrease linear velocity
a/d : increase/decrease angular velocity
s : force stop
k : stop smoothly

CTRL-C to quit

In VNC browser (http://localhost:6080)

Watch the robot respond to your keyboard commands in real-time within the Gazebo simulator.

Using teleoperation for SLAM

Teleoperation is essential for creating maps with SLAM. Drive the robot slowly to explore and map the environment.
1

Launch simulation world

tb3_world
2

Start SLAM

In a second terminal:
tb3_slam
RViz2 will open showing the map being built in real-time.
3

Drive to explore

In a third terminal:
tb3_teleop
4

Map the environment

Drive slowly using keyboard controls:
  • Use i for forward movement
  • Use j and l for smooth turns
  • Avoid rapid movements for better map quality
  • Cover all areas you want mapped
When mapping with SLAM, move slowly and smoothly. Rapid movements or high speeds can reduce map quality and accuracy.

Best practices

Smooth control

  • Press keys briefly: Tap keys rather than holding them down for more precise control
  • Use stop key frequently: Press k between movements to avoid overshooting
  • Start slow: Begin with reduced speeds (press x and d) when learning

SLAM mapping tips

  • Drive slowly: Slower speeds produce better quality maps
  • Smooth turns: Use u and o for gradual curved paths instead of sharp rotations
  • Complete coverage: Ensure all areas are visible to the robot’s sensors
  • Return to start: For best results, return to your starting position to close the loop

Safety

  • Know your stop key: k stops the robot immediately
  • Monitor in VNC: Always watch the robot in Gazebo while controlling
  • Test in empty world first: Practice in tb3_empty before complex environments

Troubleshooting

Robot doesn’t respond to keys

1

Check simulation is running

Verify Gazebo is running with the robot loaded:
ros2 node list
You should see TurtleBot3-related nodes.
2

Verify topic connection

Check that velocity commands are being published:
ros2 topic echo /cmd_vel
Press movement keys and confirm messages appear.
3

Restart teleoperation

Press Ctrl+C to stop teleop, then restart:
tb3_teleop

Keys don’t work

  • Focus the terminal: Click on the teleoperation terminal window
  • Check keyboard layout: Ensure you’re using a QWERTY keyboard layout
  • Disable caps lock: CAPS LOCK may interfere with key recognition

Robot moves erratically

1

Stop the robot

Press k immediately to stop all movement.
2

Reset velocity

Press s to reset to default speed settings.
3

Reduce speed

Press x and d several times to reduce both linear and angular velocity.
4

Test slowly

Try gentle movements with the reduced speed.

Simulation lags

  • Allocate more resources to Docker (4+ CPU cores, 8GB+ RAM)
  • Use a simpler world like tb3_empty
  • Try software rendering mode: tb3_empty_sw
  • Close other resource-intensive applications

Advanced usage

Custom velocity limits

You can modify maximum velocities by editing the teleop node parameters or creating a custom launch file with adjusted limits.

Multiple robots

For controlling multiple robots, remap the cmd_vel topic:
ros2 run turtlebot3_teleop teleop_keyboard --ros-args --remap /cmd_vel:=/robot1/cmd_vel

Joystick control

While this guide focuses on keyboard control, TurtleBot3 also supports joystick/gamepad control through additional ROS2 packages.

Build docs developers (and LLMs) love