Input Controller Component

The input controller API provides an API for configuring callbacks for events, allowing you to configure input devices to control your machines.

If you have a keyboard, mouse, elevator button panel, light power switch, joystick, gamepad, or video game controllers with which you want to control a robotic base, use an input controller component.

This component supports devices like gamepads and joysticks that contain one or more Controls representing the individual axes and buttons on the device. To use the controller’s inputs, you must register callback functions to the Controls with the input API.

The callback functions can then handle the Events that are sent when the Control is activated or moved. For example, when a specific button is pushed, the callback function registered to it can move another component, or print a specific output.

The base remote control service implements an input controller as a remote control for a base.

Configuration

To use an input controller to control your machine’s actions, you need to add it to your machine’s configuration.

Go to your machine’s CONFIGURE page, and add a model that supports your input controller.

The following list shows the available input controller models. For additional configuration information, click on the model name:

Model
Description

API

The input controller API supports the following methods:

Method NameDescription
GetControlsGet a list of the Controls that your controller provides.
GetEventsThis method returns the current state of the controller as a map of Event Objects, representing the most recent event that has occurred on each available Control.
TriggerEventDirectly send an Event Object from external code.
GetGeometriesGet all the geometries associated with the input controller in its current configuration, in the frame of the input controller.
RegisterControlCallbackDefines a callback function to execute whenever one of the EventTypes selected occurs on the given Control.
ReconfigureReconfigure this resource.
GetResourceNameGet the ResourceName for this input controller with the given name.
CloseSafely shut down the resource and prevent further use.

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 your 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 general configuration, development, and usage info, see: