hal_joystick has been depreciated from EMC 2.4 |
This page illustrates how to identify pins available on a hal_input joypad device. |
First open a terminal. Type: |
Step 1 Identify your joypadIn a terminal window type: less /proc/bus/input/devices The output will look something like this: I: Bus=0003 Vendor=046d Product=c216 Version=0300 N: Name="Logitech Logitech Dual Action" P: Phys=usb-0000:00:03.2-2/input0 S: Sysfs=/class/input/input3 H: Handlers=event3 js0 B: EV=b B: KEY=fff 0 0 0 0 0 0 0 0 0 B: ABS=30027 Don't proceed until you identify your joypad! You need to find a unique pattern in the output fields to specify your device. In my case I chose "Dual". See the Input Specification section of http://linuxcnc.org/docs/html/man/man1/hal_input.1.html for details. Step 2 Check what's available on your joypad.In a terminal window type: |
now, after you've plugged your joypad, load the hal_joystick component (I will assume that the address of your joypad is /dev/input/js0, the default if you have only one joypad attached): |
Now, after you've plugged your joypad, load the hal_input component with the correct input specification from step 1. |
halcmd: loadusr hal_joystick -d /dev/input/js0 -p joypad |
halcmd: loadusr -W hal_input -KRAL Dual |
now we load one halmeter to check the axes values: |
Now we load one halmeter to check the axes values: |
the little halmeter window should open, click on select and you will see all pins created by hal_joystick: |
the little halmeter window should open, click on select and you will see all pins created by hal_input: |
|
|
select the first axis, and click apply; now you should see the little halmeter window shoving the value for that axis: |
select the position of the desired joystick axis, and click on the position; now you should see the little halmeter window showing the position value for that axis: |
|
|
You can check all other axes if ou want, however if the first outputs the right values, others should do the same. If things are not that good, you could try to calibrate your joypad using jscal (install the package joystick from synaptic) |
You can check all other axes if you want, however if the first outputs the right values, others should do the same. PermissionsIf your system doesn't recognize the joypad you may need to modify the udev permissions to access the device. Prepared a one line file as per the description in the man udev. new syntax: ATTR{idProduct}=="c216", ATTR{idVendor}=="046d", MODE="0660", GROUP="plugdev" old syntax: SUBSYSTEM=="input", mode="0660", group="plugdev" Save the file to the /etc/udev/rules.d directory. Now tell Ubuntu to reload udev rules by entering the following in the terminal window: sudo udevadm trigger Next, add yourself to the plugdev group. adduser $username plugdev Logitech F310 Specific Absolute Axes and Button Pins |
[BACK] |
This is the joypad I used |
|
The Logitech F310 supports 6 absolute axes and twelve buttons. See http://linuxcnc.org/docs/html/man/man1/hal_input.1.html for the full pin names for these axes and buttons. |
Axes Pin Names * hat0x - Discrete pad. * hat0y - Discrete pad. * x - Right joystick. * y - Right joystick. * z - Left joystick. * rz - Left joystick. |
Button Pin Names * top2 - Front left top. * pinkie - Front right top. * base - Front left bottom. * base2 - Front right bottom. * base3 - "9" or "BACK" depending on vintage. * base4 - "10" or "START". * base5 - Left joystick press. * base6 - Right joystick press. * joystick - "1" or "X". * thumb - "2" or "A". * thumb2 - "3" or "B". * top - "4" or "Y" |
less /proc/bus/input/devices
The output will look something like this:
I: Bus=0003 Vendor=046d Product=c216 Version=0300 N: Name="Logitech Logitech Dual Action" P: Phys=usb-0000:00:03.2-2/input0 S: Sysfs=/class/input/input3 H: Handlers=event3 js0 B: EV=b B: KEY=fff 0 0 0 0 0 0 0 0 0 B: ABS=30027
Don't proceed until you identify your joypad! You need to find a unique pattern in the output fields to specify your device. In my case I chose "Dual". See the Input Specification section of http://linuxcnc.org/docs/html/man/man1/hal_input.1.html for details.
$ halrun
Now, after you've plugged your joypad, load the hal_input component with the correct input specification from step 1.
halcmd: loadusr -W hal_input -KRAL Dual
Now we load one halmeter to check the axes values:
halcmd: loadusr halmeter
the little halmeter window should open, click on select and you will see all pins created by hal_input:
select the position of the desired joystick axis, and click on the position; now you should see the little halmeter window showing the position value for that axis:
If it is 0 and you are not moving the joypad, everything is fine. Try to move your joypad in order to see which is the axis.0 You can check all other axes if you want, however if the first outputs the right values, others should do the same.
new syntax:
ATTR{idProduct}=="c216", ATTR{idVendor}=="046d", MODE="0660", GROUP="plugdev"
old syntax:
SUBSYSTEM=="input", mode="0660", group="plugdev"
Save the file to the /etc/udev/rules.d directory. Now tell Ubuntu to reload udev rules by entering the following in the terminal window:
sudo udevadm trigger
Next, add yourself to the plugdev group.
adduser $username plugdev
This is the joypad I used
The Logitech F310 supports 6 absolute axes and twelve buttons. See http://linuxcnc.org/docs/html/man/man1/hal_input.1.html for the full pin names for these axes and buttons.
Axes Pin Names
Button Pin Names