[Rock-dev] Joystick and twice a std vector in RawCommand

Javier Hidalgo Carrió javier.hidalgo_carrio at dfki.de
Thu Apr 10 12:43:49 CEST 2014


Hello Matthias,

Please find enclosed the proposed change for the controldev driver 
(library and component).
I tested it with several joysticks. The idea is to use 
/usr/include/linux/input.h nomenclature for the axes and buttons and map 
then in a NamedVector at component level.

In my opinion, it better maps the buttons and axes in one-dimensional 
array. Let me know.

Regards,

Javier.

DriverTest console mapping output for different joysticks:

Joystick (Logitech Logitech Attack 3) has 3 Axes (ABS_X ABS_Y ABS_Z )
It has 11 Buttons (BTN_TRIGGER BTN_THUMB BTN_THUMB2 BTN_TOP BTN_TOP2 
BTN_PINKIE BTN_BASE BTN_BASE2 BTN_BASE3 BTN_BASE4 BTN_BASE5 )
Axis: ABS_X: 0 ABS_Y: 0 ABS_Z: -0.226814
Buttons: BTN_TRIGGER: 0 BTN_THUMB: 0 BTN_THUMB2: 0 BTN_TOP: 0 BTN_TOP2: 
0 BTN_PINKIE: 0 BTN_BASE: 0 BTN_BASE2: 0 BTN_BASE3: 0 BTN_BASE4: 0 
BTN_BASE5: 0
****              ****

Joystick (USB Gamepad ) has 7 Axes (ABS_X ABS_Y ABS_Z ABS_RX ABS_RZ 
ABS_HAT0X ABS_HAT0Y )
It has 12 Buttons (BTN_TRIGGER BTN_THUMB BTN_THUMB2 BTN_TOP BTN_TOP2 
BTN_PINKIE BTN_BASE BTN_BASE2 BTN_BASE3 BTN_BASE4 BTN_BASE5 BTN_BASE6 )
Axis: ABS_X: 0 ABS_Y: 0 ABS_Z: -1 ABS_RX: 0 ABS_RZ: 0 ABS_HAT0X: 0 
ABS_HAT0Y: 0
Buttons: BTN_TRIGGER: 0 BTN_THUMB: 0 BTN_THUMB2: 0 BTN_TOP: 0 BTN_TOP2: 
0 BTN_PINKIE: 0 BTN_BASE: 0 BTN_BASE2: 0 BTN_BASE3: 0 BTN_BASE4: 0 
BTN_BASE5: 0 BTN_BASE6: 0
****              ****


Joystick (Thrustmaster T.Flight Stick X) has 6 Axes (ABS_X ABS_Y ABS_RZ 
ABS_THROTTLE ABS_HAT0X ABS_HAT0Y )
It has 12 Buttons (BTN_TRIGGER BTN_THUMB BTN_THUMB2 BTN_TOP BTN_TOP2 
BTN_PINKIE BTN_BASE BTN_BASE2 BTN_BASE3 BTN_BASE4 BTN_BASE5 BTN_BASE6 )
Axis: ABS_X: 0 ABS_Y: 0 ABS_RZ: 0 ABS_THROTTLE: -1 ABS_HAT0X: 0 
ABS_HAT0Y: 0
Buttons: BTN_TRIGGER: 0 BTN_THUMB: 0 BTN_THUMB2: 0 BTN_TOP: 0 BTN_TOP2: 
0 BTN_PINKIE: 0 BTN_BASE: 0 BTN_BASE2: 0 BTN_BASE3: 0 BTN_BASE4: 0 
BTN_BASE5: 0 BTN_BASE6: 0
****              ****

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-controldev-lib.patch
Type: text/x-patch
Size: 0 bytes
Desc: not available
Url : http://www.dfki.de/pipermail/rock-dev/attachments/20140410/07c39beb/attachment-0004.bin 


More information about the Rock-dev mailing list