Reply To: Joystick as tracking device?

Home Forums AR Sandbox Forum Joystick as tracking device? Reply To: Joystick as tracking device?

Oliver Kreylos

Re: controller That doesn’t seem to be a Bluetooth controller, but a regular wireless one with a custom dongle. Those show up as USB devices. Setting those up usually involves a bit of detective work. You need to check that the controller is recognized at the USB level. Plug it in and check the output of lsusb for something that looks like the controller, then note down its vendor and product IDs.

Second, you need to open access to the device for non-admin users. This is done via scripts in /etc/udev/rules.d . There should already be a 69-Vrui-devices.rules in there, open it in a text editor (via sudo). Then insert a line like this:

ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c625", TAG+="uaccess"

but replace the vendor and product IDs with your device’s. Then unplug the wireless dongle and plug it back in.

Then create a patch configuration file like “Controller.cfg” with contents similar to the following:

section Vrui
	section Desktop
		inputDeviceAdapterNames += (HIDAdapter)
		section HIDAdapter
			inputDeviceAdapterType HID
			inputDeviceNames (SteelSeriesStratusXL)
			section SteelSeriesStratusXL
				name SteelSeriesStratusXL
				deviceVendorProductId 0111:1419
				trackingDeviceName Mouse
				trackingDeviceType Ray
				axis0Settings (-2047, 0, 0,  2047)
				axis1Settings ( 2047, 0, 0, -2047)
				axis2Settings (-2047, 0, 0,  2047)
				axis3Settings ( 2047, 0, 0, -2047)
				axis4Settings (-4095, 0, 0,  4095)
				axis5Settings (-4095, 0, 0,  4095)
				buttonNames (Back, Home, A, B, X, Y, L1, R1, Forward, LStick, RStick)
				valuatorNames (LStickX, LStickY, RStickX, RStickY, R2, L2, DPadX, DPadY)

adapting settings to your controller. You can store the configuration file in /usr/local/etc/Vrui-4.5. Then load it via the command line:

./bin/SARndbox ... -mergeConfig Controller

and you should be able to bind tools to the controller’s buttons.

Comments are closed.