Thanks for hint to the gestreamer plugin - a theta gstreamer plugin (that is able to switch the device automatically on and to the right mode) would be one of the most desirable things for many projects…
I hope Linux detects the XBox Controller as joystick
apt install joystick
you could check with
and hopefully it shows up as js0 or js1 …
then a quick test with
I just hardcoded js1 because on my computer even the accelerometer shows up as a joystick. Otherwise, the input velocity [line 471-472] of could just come from a timer (or keyboard, or in the case of a real robot over the network ).
e.g. comment the joystick code out and set the yOffset to 800 and set the xVel to 6. and then slowly it should pan from left to right, each timer-step the xOffset is incremented by xVel.