Starting teleoperation
Using the alias
The simplest way to start keyboard teleoperation:Using the full command
Alternatively, use the complete ROS2 command: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:| Key | Action | Description |
|---|---|---|
i | Move forward | Drives the robot straight ahead |
, | Move backward | Drives the robot in reverse |
j | Rotate left | Rotates the robot counter-clockwise |
l | Rotate right | Rotates the robot clockwise |
k | Stop | Immediately stops all robot movement |
u | Forward + left | Moves forward while turning left |
o | Forward + right | Moves forward while turning right |
m | Backward + left | Moves backward while turning left |
. | Backward + right | Moves backward while turning right |
Speed control
Adjust the robot’s velocity while teleoperation is running:| Key | Action | Description |
|---|---|---|
w | Increase linear speed | Makes forward/backward movement faster |
x | Decrease linear speed | Makes forward/backward movement slower |
a | Increase angular speed | Makes rotation faster |
d | Decrease angular speed | Makes rotation slower |
s | Reset to default speed | Returns to default velocity settings |
Basic teleoperation workflow
Launch simulation
Start a Gazebo world in the first terminal:Wait for Gazebo to fully load with the robot visible.
Control the robot
Use the keyboard keys to move the robot:
- Press
ito move forward - Press
jorlto rotate - Press
kto stop
Complete workflow example
Terminal 1: Launch simulation
Terminal 2: Start teleoperation
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.Best practices
Smooth control
- Press keys briefly: Tap keys rather than holding them down for more precise control
- Use stop key frequently: Press
kbetween movements to avoid overshooting - Start slow: Begin with reduced speeds (press
xandd) when learning
SLAM mapping tips
- Drive slowly: Slower speeds produce better quality maps
- Smooth turns: Use
uandofor 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:
kstops the robot immediately - Monitor in VNC: Always watch the robot in Gazebo while controlling
- Test in empty world first: Practice in
tb3_emptybefore complex environments
Troubleshooting
Robot doesn’t respond to keys
Check simulation is running
Verify Gazebo is running with the robot loaded:You should see TurtleBot3-related nodes.
Verify topic connection
Check that velocity commands are being published:Press movement keys and confirm messages appear.
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
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