Hi,
I would like some help in using the USB SpaceExplorer to fly my aircraft simulator running on RedHawk (RedHat) Linux.
Ideally, I could find some example source code (C++) that has function calls that return the values of the 6dof SpaceExplorer cap, as well as the state of all the buttons. I would call these functions from my real time simulation that runs at 60Hz.
I have no interest in anything graphical (no cubes to draw or anything), just the values (like -1.0 to 1.0 for the cap, and TRUE/FALSE for the buttons)
I've already installed the SpaceExplorer on my system and it all seems happy since "xcube" and "xvalues" seem to behave as expected.
Since it's USB, do I need to do any initializing or closing when the simulation starts/stops?
Some system specs:
"uname -a"
Linux 2.6.23.17-RedHawk-5.1.2-trace #1 SMP PREEMPT Tue Sep 16 12:33:37 EDT 2008 i686 i686
i386 GNU/Linux
"g++ -v"
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic
--host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)
"/etc/3DxWare/daemon/3dxsrv -v"
3DxWareUNIX = V1.2.17, ID 3493
How to use SpaceExplorer as Flight Controls to fly aircraft
Moderator: Moderators
-
- Posts: 5
- Joined: Thu Feb 05, 2009 1:36 pm
- Location: NY
You could follow the evdev examples, it works (somewhat).
If udev doesn't mount it as readable for users, add such a rule:
To a /etc/udev/rules.d/99-joysticks.rules
Also take care you've disabled xorg hotplug or exempted your device, because there are issues with hotplug.
If udev doesn't mount it as readable for users, add such a rule:
Code: Select all
KERNEL=="event*", SUBSYSTEM=="input", ATTRS{name}=="3Dconnexion SpaceNavigator", MODE="0666"
Also take care you've disabled xorg hotplug or exempted your device, because there are issues with hotplug.
-
- Posts: 5
- Joined: Thu Feb 05, 2009 1:36 pm
- Location: NY
Thank you, pyalot, for your quick reply. Unfortunately, all your info will take a while for me to digest. I was hoping for something easier to understand (for a rookie).
Is there any way I can get the source code for the application "xvalues"? Seems that that's exactly what I want (minus the display part of it, but adding the button state part of it.
I wonder though, if using "evdev" violates the recommendation to use 3dconnexion's driver and SDK (as stated in viewtopic.php?t=1792&sid=df40b88217559e ... 7c88c98137
I would prefer to keep things standard so that it's easier to integrate new 3dconnexion products in the future without having to modify my code.
Is there any way I can get the source code for the application "xvalues"? Seems that that's exactly what I want (minus the display part of it, but adding the button state part of it.
I wonder though, if using "evdev" violates the recommendation to use 3dconnexion's driver and SDK (as stated in viewtopic.php?t=1792&sid=df40b88217559e ... 7c88c98137
I would prefer to keep things standard so that it's easier to integrate new 3dconnexion products in the future without having to modify my code.
The evdev stuff is rather simple, plus if you do it with evdev you get support for any Human Interface Device, not just space pilots etc. (Joysticks, gamepads and whatnot too).
Sure the "official" recommendation would be to use the "official" SDK and the "official" usbfs driver adapter (that opens an annoying non working window).
I think the space pilot is nothing else then a six axis two button joystick, and that works pretty well for me over evdev.
To require users to use some proprietary custom software blobs and methods just to get a HID working that should be plug&play is just plain silly.
Sure the "official" recommendation would be to use the "official" SDK and the "official" usbfs driver adapter (that opens an annoying non working window).
I think the space pilot is nothing else then a six axis two button joystick, and that works pretty well for me over evdev.
To require users to use some proprietary custom software blobs and methods just to get a HID working that should be plug&play is just plain silly.
Hi aero_engineer,
You are right: if you use the SDK you will be prepared for all future 3Dconnexion devices that are supported on your Linux. No need to adapt any source, any scripts, ...
Uta Ludwig
3Dconnexion
The example xapp.c in the SDK is exactly the xvalue demo.aero_engineer wrote:Is there any way I can get the source code for the application "xvalues"? Seems that that's exactly what I want (minus the display part of it, but adding the button state part of it.
aero_engineer wrote:I wonder though, if using "evdev" violates the recommendation to use 3dconnexion's driver and SDK (as stated in viewtopic.php?t=1792&sid=df40b88217559e ... 7c88c98137
I would prefer to keep things standard so that it's easier to integrate new 3dconnexion products in the future without having to modify my code.
You are right: if you use the SDK you will be prepared for all future 3Dconnexion devices that are supported on your Linux. No need to adapt any source, any scripts, ...
Uta Ludwig
3Dconnexion
@uludwig
there seems to be some 3dconnexion terminal reality disconnect.
1) you recommend using the "official" broken way of doing things in the linux developer forum
2) you get thread upon thread in the linux user forum about how utterly hard it is to configure and use the device with any application
I mean, you know...
Whatever happend to USB HID plug&play (which btw. DOES work on linux vor a whole variety of devices)
there seems to be some 3dconnexion terminal reality disconnect.
1) you recommend using the "official" broken way of doing things in the linux developer forum
2) you get thread upon thread in the linux user forum about how utterly hard it is to configure and use the device with any application
I mean, you know...
Whatever happend to USB HID plug&play (which btw. DOES work on linux vor a whole variety of devices)
-
- Posts: 5
- Joined: Thu Feb 05, 2009 1:36 pm
- Location: NY
Just wanted to provide an update: I've decided to go with a nice prepackaged solution provided by nuclear, it's been working great:
- no annoying X11 window to deal with
- simple inteface, once you learn how to use it properly (study the API as defined in the .h file)
- unplug the USB plug, then plug it back in again and it all starts working again automatically
see
viewtopic.php?t=1310&highlight=
and
http://spacenav.sourceforge.net/
The 3Dconnexion SDK was just too difficult, I gave up on it.
- no annoying X11 window to deal with
- simple inteface, once you learn how to use it properly (study the API as defined in the .h file)
- unplug the USB plug, then plug it back in again and it all starts working again automatically
see
viewtopic.php?t=1310&highlight=
and
http://spacenav.sourceforge.net/
The 3Dconnexion SDK was just too difficult, I gave up on it.
-
- Posts: 5
- Joined: Thu Feb 05, 2009 1:36 pm
- Location: NY