.. tutorials intermediate create_joystick ==================================== Create a new joystick configuration ==================================== New joystick configurations can be added in the ``paparazzi/conf/joystick`` directory. Profile a joystick ================== Test if your joystick is recognized: plug your joystick then run ``dmesg``. The message is different for every device, but the last lines should look like these: [49174.642275] usb 1-1: new low-speed USB device number 8 using xhci_hcd [49174.812307] usb 1-1: New USB device found, idVendor=046d, idProduct=c214, bcdDevice= 2.05 [49174.812309] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [49174.812310] usb 1-1: Product: Logitech Attack 3 [49174.812311] usb 1-1: Manufacturer: Logitech [49174.823264] input: Logitech Logitech Attack 3 as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/0003:046D:C214.000B/input/input37 [49174.823608] hid-generic 0003:046D:C214.000B: input,hidraw4: USB HID v1.10 Joystick [Logitech Logitech Attack 3] on usb-0000:00:14.0-1/input0 Launch ``./sw/ground_segment/joystick/test_stick``. It will display joystick information, then print current status: Available button: 5 (0x5) Available hats: 0 (0x0) Available axes: 4 (0x4) Axis 0 : parameters = [-32768,32768] Axis 1 : parameters = [-32768,32768] Axis 2 : parameters = [-32768,32768] Axis 3 : parameters = [-32768,32768] Input device name: "Amazing Joystick" on SDL device "0" buttons 0 0 0 0 0 | hat 0 | axes 0 0 0 0 buttons 0 0 0 0 0 | hat 0 | axes 0 0 0 0 buttons 0 0 0 0 0 | hat 0 | axes 0 0 0 0 buttons 0 0 0 0 0 | hat 0 | axes 1 -40 0 0 buttons 0 0 0 0 0 | hat 0 | axes -33 -83 0 0 buttons 0 0 0 0 0 | hat 0 | axes -101 0 0 0 .. note:: Your joystick may need to be calibrated. Go to the :ref:`Calibration` section below. Create a new file for your joystick in the ``paparazzi/conf/joystick`` directory with the syntax of the following example: .. code-block:: xml