I was working on getting the SITL simulation up and running this weekend, and was able to modify MAVProxy.py to support real-time control via a joystick or gamepad, here is the updated file:
It requires installation of pygame (http://www.pygame.org) It will probably require some modification to map the axes on your particular controller to the proper APM channels, in these lines:
cmd_rc(["1", str(int(j.get_axis(2)*400 + 1500))])
cmd_rc(["2", str(int(j.get_axis(3)*400 + 1500))])
cmd_rc(["3", str(int(-j.get_axis(1)*800 + 1100))]) #throttle
cmd_rc(["4", str(int(j.get_axis(0)*400 + 1500))])
pygame prints any control input changes to the terminal, which can be annoying because it scrolls away some of the normal mavproxy messages.
I tested it flying the ArduCopter, and it works well, hopefully it will be useful for testing modifications to manual control modes.
I created a mavproxy module file that can be loaded into the normal version of mavproxy.py:
Copy this file into the /modules folder, and from within mavproxy, load the module by entering:
module load joystick
Axis mapping is still custom to the Logitech Dual Action, so modifications may be required for other devices. One issue is that it still writes the state of the joystick axes to the console - I'm still looking into whether there is a way to suppress this.
For future work, I want to add support for some of the gamepad buttons to change rc channels 5-8 to be used for changing mode, dropping waypoints, etc,