simple_pendulum.controllers.gamepad

Controllers

Submodules

simple_pendulum.controllers.gamepad.gamepad

class simple_pendulum.controllers.gamepad.gamepad.GamePad(gamepad_name='Logitech Logitech RumblePad 2 USB', dt=0.005)

Bases: object

read()
rumble()
stop_rumble()

simple_pendulum.controllers.gamepad.gamepad_controller

Gamepad Controller

class simple_pendulum.controllers.gamepad.gamepad_controller.GamepadController(torque_limit=1.0, gamepad_name='Logitech Logitech RumblePad 2 USB', mass=1.0, length=0.5, damping=0.1, coulomb_fric=0.0, gravity=9.81, lqr_torque_limit=2.0, Q=array([[10, 0], [0, 1]]), R=array([[1]]), dt=0.005, rumble=False, max_vel=10.0, eps=[0.15, 0.05])

Bases: AbstractController

Controller actuates the pendulum with a gamepad

get_control_output(meas_pos, meas_vel, meas_tau=0, meas_time=0)

The function to compute the control input for the pendulum actuator

Parameters:
meas_posfloat

the position of the pendulum [rad]

meas_velfloat

the velocity of the pendulum [rad/s]

meas_taufloat, default=0

the meastured torque of the pendulum [Nm] (not used)

meas_timefloat, default=0

the collapsed time [s] (not used)

Returns:
des_posfloat

the desired position of the pendulum [rad] (not used, returns None)

des_velfloat

the desired velocity of the pendulum [rad/s] (not used, returns None)

des_taufloat

the torque supposed to be applied by the actuator [Nm]

get_swingup_time()