I investigate the same subject. It is not necessary to find out how the controller works electronically, nor is it too hard to figure it out if you open one. (I guess it does not feed analogue signals through a ... USB for obvious reasons, but has 6 DOF A/Ds feeding a CoTS serial device).
(theoretically you could use a polling A/D for all six axes, instead of 6, since, regardless of how you scan -parallel or serial, you feed a serial device. Anyway, how it works is only a speculation and it doesn't really matter for using it in automation.)
Instead, treat it like a HID device under linux and use an embedded linux device to do the control you want to do. Small AVR's along with custom boards plus your time cost MUCH more than the 50€ buying you an Atmel NGW100 with a full blown 32bit Linux and cross development capabilities for most linux distros.
You may find
http://www.frogmouth.net/hid-doco/x286.html
and
http://www.aaue.dk/~janoc/index.php?n=P ... torSupport
useful.
So far I tested that spacenavig.c (found in the latter link and explained in the first) can be compiled for AVR32, which is an embedded controller suitable for automation projects.
It merely requires a gcc spacenavig.c -o spacenavig to test it...
(same for avr32 using avr32-linux-gcc instead).
What for do you plan to use it for? Might be able to give a hand if interesting.
All the best.
GPD
p.s. it would be nice to control a few six dof devices I have in mind, and not necessarily difficult

Anyone interested, keep me posted. Done such things before with ... slightly more expensive gear (barely more expensive

)
p.s.2 the code is this:
- Code: Select all
#include <linux>
#include <sys>
#include <sys>
#include <fcntl>
#include <stdio>
#include <math>
#include <stdlib>
#include <stdint>
/* this macro is used to tell if "bit" is set in "array"
* it selects a byte from the array, and does a boolean AND
* operation with a byte that only has the relevant bit set.
* eg. to check for the 12th bit, we do (array[1] & 1<<4)
*/
#define test_bit(bit, array) (array[bit/8] & (1<<(bit%8)))
int main(int argc, char **argv)
{
int i = 0;
char *fname = NULL;
struct input_id ID;
int fd;
// find the SpaceNavigator or similar device
fname = (char *)malloc(1000 * sizeof(char));
while (i <32> 0)
{
ioctl(fd, EVIOCGID, &ID);
if (ID.vendor == 0x046d &&
(ID.product == 0xc626 ||
ID.product == 0xc623 ||
ID.product == 0xc603))
{
printf("Using device: %s\n", fname);
break;
}
}
}
// detect supported features
if (fd > 0)
{
int axes[6] = {0,0,0,0,0,0};
int buttons[2] = {0, 0};
struct input_event ev;
uint8_t evtype_bitmask[EV_MAX/8 + 1];
int ev_type;
ioctl(fd, EVIOCGBIT(0, sizeof(evtype_bitmask)), evtype_bitmask);
printf("Supported event types:\n");
for (ev_type = 0; ev_type <EV_MAX>= sizeof(struct input_event))
{
switch (ev.type)
{
case EV_KEY:
printf("Key %d pressed %d.\n", ev.code, ev.value);
buttons[ev.code] = ev.value;
break;
case EV_REL:
if (ev.code == 0)
printf("%d %g\n", ev.code, ev.value);
axes[ev.code] = ev.value;
break;
default:
break;
}
}
printf("%d %d %d %d %d %d\n", axes[0], axes[1], axes[2], axes[3], axes[4], axes[5]);
}
}
else
{
fputs("Unable to open sensor!\n", stderr);
return(-1);
}
close(fd);
}