Drive a Rover (like SCUTTLE) Using a Gamepad with a Dongle
This tutorial teaches you how to add a Bluetooth dongle gamepad controller to your wheeled robot. By the end of this tutorial, you’ll be able to drive your rover around like an RC car.
Tip
If your gamepad has a dongle, keep reading. If your gamepad does not have a dongle, check out Drive a Yahboom Rover with a Gamepad for Bluetooth pairing instructions.
Requirements
You will need the following hardware to complete this tutorial:
- A wheeled rover, configured with a base component on the Viam app.
This tutorial uses a SCUTTLE rover as an example but you can complete this tutorial using a different rover.
- Regardless of the type of base you are using, Setting up a SCUTTLE with Viam is a good place to start if you haven’t already configured your base.
- EasySMX ESM-9101 Wireless Controller or a similar gamepad and dongle. This is the controller that comes with the SCUTTLE rover.
Set up the hardware
Plug the gamepad Bluetooth dongle into a USB port on the rover’s board. Turn on power to the rover.
Add the controller to the rover’s config
Go to your rover’s Config tab on the Viam app.
Configure a gamepad:
- Click Create component.
- Select
input_controller
for the component Type. - Select
gamepad
for the Model. - Enter
my-gamepad
as the component Name. - Click Create.
If instead of using the config builder, you prefer to write raw JSON, switch to Raw JSON mode on the Config tab.
Inside the components
array of your config, add the following configuration for your gamepad:
{
"name": "my-gamepad",
"model": "gamepad",
"type": "input_controller",
"namespace": "rdk",
"attributes": {},
"depends_on": []
}
The controller config adds the gamepad controller to your robot. However, it is not functional yet. To make it functional, you need to add the base remote control service.
Add the base remote control service
Services are software packages that provide robots with higher level functionality. To link the controller’s input to the base functionality, you need to configure the base remote control service:
- Go to the Services subtab of your robot’s Config tab.
- In the Create service panel, click the Type dropdown and select
Base Remote Control
. - Enter
gamepad_service
for the Service name. - Click Create service.
Copy and paste the following into the empty Attributes field, replacing <your-base-name>
with your base’s name.
{
"base": "<your-base-name>",
"input_controller": "my-gamepad"
}
If instead of using the config builder, you prefer to write raw JSON, switch to Raw JSON mode on the Config tab.
Add the following configuration for your base remote control service, replacing <your-base-name>
with your base’s name:
"services": [
{
"name": "gamepad_service",
"type": "base_remote_control",
"attributes": {
"input_controller": "my-gamepad",
"base": "<your-base-name>"
}
}
]
If you already have a "services"
array with other services configured, add just the contents of the square brackets above to that array, rather than creating two different "services"
arrays.
Click Save config, then go to the Control tab.
You should see the panel for the gamepad and its connection indicator:
Try moving the left joystick or pressing the D-pad to move the rover using the gamepad.
The ESM-9101 controller has different modes that allow you to use either the joystick or the D-pad.
If you are in the mode that allows you to use the joystick (#7), it will change the X
and Y
values on the Control tab gamepad panel:
"X
0.0000
Y
0.0000"
If you are in the mode that allows you to use the D-pad (#8), it will change the Hat0X
and Hat0Y
values:
"Hat0X
0.0000
Hat0Y
0.0000"
Testing these attributes tells you which mode you are in.
EasySMX ESM-9101 wireless controller information
Here is a diagram of the gamepad.
![]() | ![]() |
To change the movement/direction control on the gamepad between the D-pad and the joystick, press and hold the Home button (#11) until it displays the lighted segment combination for the gamepad configuration you need. Each red color arrangement allows you to control the gamepad in the Viam app:
LED 1 and 3: Use the D-Pad![]() | LED 3 and 4: Use the D-Pad![]() |
LED 1 and 2: Use the D-Pad![]() | LED 1 and 4: Use the Joystick![]() |
Have questions, or want to meet other people working on robots? Join our Community Discord.
If you notice any issues with the documentation, feel free to file an issue or edit this file.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!