double_pendulum.controller.gamepad

Controllers

Submodules

double_pendulum.controller.gamepad.gamepad

class double_pendulum.controller.gamepad.gamepad.GamePad(gamepad_name='Logitech Logitech RumblePad 2 USB')

Bases: object

Gamepad Controller Controller class to operate the double pendulum with a gamepad.

Parameters:
gamepad_name: string

string refering to the gamepad type Currently supported:

  • “Logitech Logitech RumblePad 2 USB”

(Default value=”Logitech Logitech RumblePad 2 USB”)

read()

Method to read the gamepad input.

double_pendulum.controller.gamepad.gamepad_controller

Gamepad Controller

class double_pendulum.controller.gamepad.gamepad_controller.GamepadController(torque_limit=[5.0, 5.0], gamepad_name='Logitech Logitech RumblePad 2 USB')

Bases: AbstractController

Controller actuates the pendulum with a gamepad

Parameters:
gamepad_name: string

string refering to the gamepad type Currently supported:

  • “Logitech Logitech RumblePad 2 USB”

(Default value=”Logitech Logitech RumblePad 2 USB”)

torque_limitfloat, default=np.inf

the torque_limit of the pendulum actuator

get_control_output_(x, t=None)

The function to compute the control input for the double pendulum’s actuator(s) based on the gamepad input.

Parameters:
xarray_like, shape=(4,), dtype=float,

state of the double pendulum, order=[angle1, angle2, velocity1, velocity2], units=[rad, rad, rad/s, rad/s]

tfloat, optional

time, unit=[s] (Default value=None)

Returns:
array_like

shape=(2,), dtype=float actuation input/motor torque, order=[u1, u2], units=[Nm]