Configure a Web Gamepad

Configuring a webgamepad input controller allows you to use a web-based gamepad as a device to communicate with your machine.

To be able to test your gamepad as you configure it, physically connect your gamepad to your machine’s computer and turn both on. Then, configure the controller.

Configuration

Use the following configuration for an input controller of model webgamepad:

Navigate to the CONFIGURE tab of your machine’s page in the Viam app. Click the + icon next to your machine part in the left-hand menu and select Component. Select the input_controller type, then select the webgamepad model. Enter the name WebGamepad and click Create.

An example configuration for a web-based gamepad input controller component in the Viam App config builder

{
  "components": [
    {
      "name": "WebGamepad",
      "model": "webgamepad",
      "type": "input_controller",
      "namespace": "rdk",
      "attributes": {},
      "depends_on": []
    }
  ]
}

Test the input controller

After you configure your input controller, open the input controller’s TEST panel on the CONFIGURE or CONTROL tabs. View the current value of each input on your controller.

The input controller component in the test panel of the Viam app.

Troubleshooting

If your input controller is not working as expected, follow these steps:

  1. Check your machine logs on the LOGS tab to check for errors.
  2. Review this input controller model’s documentation to ensure you have configured all required attributes.
  3. Click on the TEST panel on the CONFIGURE or CONTROL tab and test if you can use the input controller there.

If none of these steps work, reach out to us on the Community Discord and we will be happy to help.

Next steps

For more configuration and usage info, see:

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.