Gamepad Node

From RoboPad Wiki
Revision as of 02:25, 10 March 2023 by Blayze (talk | contribs) (Adds descriptions of settings)
Jump to navigation Jump to search

← Return to Node Catalogue

NOTICE: Currently, gamepad support is not very robust. Different web browsers and devices support different levels of access to hardware peripherals (such as gamepads) standardisation is lacking. We are working to improve this node's ability to detect gamepads across all browsers and devices, however we cannot guarantee that your specific controller/device/browser combination will work. If you encounter issues, experiment with different web browsers and/or controllers.
Gamepad Node
Inputs
    none
Outputs
  • connected
  • [...axis]
  • [...buttons]
Version Introduced
2.4-b2

The Gamepad Input Node is a Node that can be configured to search for a specific physically attached gamepad controller which, upon finding, can be configured to transmit axis (analogue stick/trigger movements) and button signals into the nodegraph.

Gamepad Nodes were introduced in firmware version 2.4-b2.

Outputs

By default the Gamepad Node only has one output port - connected. This output port emits a low (0) initially, but then a high (1) when the node's configured gamepad is found.

Further outputs of the form axis a, axis b, axis c, etc as well as button a, button b, button c, etc that track the states of physical button bushes and analogue stick movements on the physical controller.

Note that axis signals will usually present between -1 and 1, while button signals will usually present between 0 and 1. Make sure you have fully understood the signals coming out of the node with your specific configuration before you connect any outputs to any physical actuators - it is recommended to attach the outputs to an Indicator Node first to check that you understand what signals the node is emitting.

Settings

The Gamepad Input Node's settings window starts out simply with only one configurable option and a button next to "Open Gamepad Selector". In this initial state, the button indicates whether or not the currently configured gamepad is found (by default, no gamepad is configured, so the button displays "gamepad "none" detected"). Clicking the button will open up the Gamepad Selector dialogue, which allows you to select a gamepad from a drop-down list of detected gamepads and also specify which buttons and axes are tracked on that gamepad (i.e. which ones this node will use as output ports). Because the Gamepad Selector requires the configured gamepad to be connected in order to list available axes and buttons, it will wipe all selected axis and buttons if you open it without the configured gamepad detected.

  • ID: Provides a drop-down box that lists all currently connected Gamepads by their unique vendor IDs. This will automatically select the currently configured gamepad's ID, or go to "none" if it cannot be found.
  • Index: Rarely you may want to connect more than one gamepad of the same type (with the same ID) to a single device. This lets you specify which gamepad you are referencing. Under most normal use cases, this should be left as "0".
  • Buttons and Axes: A list of all buttons and axes available on the currently connected (and configured) gamepad. Each one can indpendently be selected with a checkbox on its left - check this checkbox will set that axis or button as an output port on the node in order to forward gamepad signals into the nodegraph. Make sure you read the "Outputs" section above to understand how these work.
  • Sample Rate (ms): The physical gamepad must be sampled at regular intervals to read the values of each of axes and buttons set to be emitted - this setting configures the interval that this happens at. A higher interval will result in higher percieved delay lag between interacting with a physical gamepad input and the node emitting a signal, while a lower interval will result in more responsive output emissions, but might cause lag within your web browser as it attempts to rapidly sample the gamepad.