Coding a HID-Spacenavigator object


#1

Hi,

I want to try and code a spacenavigator object. The spacenavigator is a 6 degrees-of-freedom 3D-mouse (3 axes of translation and 3 axes of rotation in one hand).
It's an HID device, so I what your advice would be in this regard. I looked into the mouse-object and was wonderin, if I could just change it a little (add a z-axis and 3 rotational axis).
But my biggest issue is that when I plug in the 3d mouse the axoloti console says this:

USB Device Attached
PID: C626h
VID: 46Dh
Address (#1) assigned.
cfg desc: num interfaces 1
interface: interface 0, num 0, numep 1, class 3 , sub class 0
endpoint: interface 0, ep num 0, addr  81
Manufacturer : 3Dconnexion
Product : SpaceNavigator
Serial Number : N/A
Enumeration done.
This device has only 1 configuration.
Default configuration set.
HID class failed to init

Does this mean the device is found, just that the HID-part isn't working?
Is the problem somewhere else? If yes, then the whole thing seems hopeless from the beginning no?

edit: in another thread here I got some clues about the usb-stuff.
I am still not sure though, how I'm about to go on.
Would it be necessary, to create a new file (i guess a "profile") vor the Spacenavigator in "firmware/STM32_USB_Host_Library/Class/HID/Inc/" for the spacenavigator to use?


#2

The Spacenavigator requires a proprietary closed source driver - by itself, it does not output generic HID data (not even the primary two axes will show up as a mouse). Here is an old and stale attempt to reverse engineer an open source Linux driver: http://spacenav.sourceforge.net/ - but it might be quite a way to code a object from that.


#3

Actually no, you don't need any driver. I connected the device to my Linux computer and through a usb-library I was able to directly read out the data with python.
A friend did the same once in VVVV/V4 (a graphical programming environment made for visuals (mostly)). He did it just by reading out the data. No driver was installed for that.

So I thought maybe there is a way of doing that on the axo as well. I would just need a way of knowing how to read out certain values.
For a normal mouse there already exists a profile (at least if I understand the process correctly).


#4

Sort of - it will only deliver inclination/displacement data, joystick-like. If you can do with a joystick with extra dimensions, it might do. The abstraction into "space-mouse" motions is done inside the high level driver.


#5

with "high level driver" do you mean one that runs on a desktop pc? Or would the one on the Axo already be a high level driver?


#6

The Axo is essentially driverless, so you'd have to code that functionality into your interface. The device itself strictly speaking is a six axis joystick with a very minimal physical range (mine does not appear to move by more than 5mm or maybe 10° into any direction), so it will only communicate (presumably as RAW data or in some other way that prevents it being misdetected as a a HID mouse) that it has been moved or turned by a few millimetres from the default. It is the driver that computes that offset into the force/speed with which the imaginary HID mouse is moved along that vector.