[tool] relabsd - Turn your SpaceNavigator into a joystick.

Questions and answers about 3Dconnexion devices on UNIX and Linux.

Moderator: Moderators

Post Reply
Astrophobia
Posts: 5
Joined: Wed Sep 02, 2015 2:42 am

[tool] relabsd - Turn your SpaceNavigator into a joystick.

Post by Astrophobia »

I 'm developing a tool that converts the SpaceNavigator's (or any 6DOF's, really) relative inputs into absolute ones, effectively turning it into a 6DOF joystick.
As many other, I had issues with my device because it reports its values as relative despite the fact that they are not related to the previous position but indeed to the origin point (which basically means the values should be considered absolutes).
This caused, among other things, problems when trying to use the device with SDL (which would consider it to be a 2 directional ball).

My program works already, but is still in need of improvements (and more tests! always more!) and should be considered highly unstable.

You can find it on GitHub. Any constructive participation is appreciated.
Astrophobia
Posts: 5
Joined: Wed Sep 02, 2015 2:42 am

Re: [tool] relabsd - Turn your SpaceNavigator into a joystic

Post by Astrophobia »

(Seems like my previous post is not editable)

After some work, relabsd has reached a state where I'm confident it can be used, so it's no longer "highly unstable" (still not enough tests for it to really be considered "stable" though :P ), so feel free to use it.
clickbait1
Posts: 5
Joined: Sun Sep 27, 2015 12:50 pm

Re: [tool] relabsd - Turn your SpaceNavigator into a joystic

Post by clickbait1 »

Hi,

Thanks for the good work. I tried it, but when I check the output via

Code: Select all

sdl2-jstest --test 0
nothing happens, i.e. the axes values are "#".

"sdl2-jstest --list" however, outputs correct information: 6 axes, 2 buttons, etc.

Thanks.
Astrophobia
Posts: 5
Joined: Wed Sep 02, 2015 2:42 am

Re: [tool] relabsd - Turn your SpaceNavigator into a joystic

Post by Astrophobia »

Hi,

I'll try to see what's wrong.
Could you please post:
  • The name of your (real) device.
  • Information about your system (what distro, its version and the version of libevdev).
  • The configuration file you used.
Recompile using the RELABSD_DEBUG_REAL_EVENTS and RELABSD_DEBUG_VIRTUAL_EVENTS options to make sure relabsd is what's causing the issue (this will flood you with information about the values that are read and the values that are emitted). Please tell me if something seems wrong there.
There is a guide at https://github.com/nsensfel/relabsd/wik ... up-relabsd on how to set the compilation options (section "Choosing compilation options (optional)").
clickbait1
Posts: 5
Joined: Sun Sep 27, 2015 12:50 pm

Re: [tool] relabsd - Turn your SpaceNavigator into a joystic

Post by clickbait1 »

Hi,

Thanks for the reply.

My device is Space Navigator, currently using ubuntu 14.04, libevdev-dev from official repo, ver 1.0.99. For configuration I used the one that comes with your git repo.

I added the 4 lines udev rules according to the github wiki (instead of copying the udev.rules in git repo).

I did recompile with said build flags, I see no output from relabsd. Here's how I call relabsd:

Code: Select all

sudo ./relabsd /dev/input/spacenavigator ../conf/space_navigator.conf
clickbait1
Posts: 5
Joined: Sun Sep 27, 2015 12:50 pm

Re: [tool] relabsd - Turn your SpaceNavigator into a joystic

Post by clickbait1 »

Uh sorry I just realized I had to use relabsd udev rules as well as spacenavigator udev rules.

But anyway still the same (no) output. :(
clickbait1
Posts: 5
Joined: Sun Sep 27, 2015 12:50 pm

Re: [tool] relabsd - Turn your SpaceNavigator into a joystic

Post by clickbait1 »

Just found the mistake.

I have spacenavd (spacenav daemon) running. Once I killed it, relabsd works. :D

quick question: with relabsd, can I access the joystick using linux kernel's joystick API?

Thanks for the good work!
Astrophobia
Posts: 5
Joined: Wed Sep 02, 2015 2:42 am

Re: [tool] relabsd - Turn your SpaceNavigator into a joystic

Post by Astrophobia »

I have never programmed anything using the Linux joystick API, but according to its man page, "jstest can be used to test all the features of the Linux joystick API", and jstest seems to work with the device just fine. :)
clickbait1
Posts: 5
Joined: Sun Sep 27, 2015 12:50 pm

Re: [tool] relabsd - Turn your SpaceNavigator into a joystic

Post by clickbait1 »

Astrophobia wrote:I have never programmed anything using the Linux joystick API, but according to its man page, "jstest can be used to test all the features of the Linux joystick API", and jstest seems to work with the device just fine. :)
Awesome!
theAntiBob
Posts: 1
Joined: Tue Oct 22, 2019 1:17 am

Re: [tool] relabsd - Turn your SpaceNavigator into a joystick.

Post by theAntiBob »

Hey, thank you very much!
relabsd actually allows you to use your 3dconnexion device like any other multiaxis usb hid device on the planet: as a joystick!

i used your tool to test different 6DoF input methods

https://youtu.be/i1H1d21-E68
Yak_Forger38
Posts: 7
Joined: Wed Nov 27, 2019 12:06 am

Re: [tool] relabsd - Turn your SpaceNavigator into a joystick.

Post by Yak_Forger38 »

Thanks for the explanations! I'm experimenting with different Linux based systems and it's good to know that the SpaceNavigator can be used this way.
Post Reply