RJS - The Remote Joystick

Intro
Architecture
Screenshots
Requirements
Download
Links
Future Enhancements
Contact



 

Introduction:

RJS is a modification to mjstest which provides to useful functions:
  • Joystick data is mirrored to shared memory which allows independent processes to easily interface to the joystick(s)
  • A TCPIP client/server pair mirror the joystick shared memory data to a remote system
  • Applications hosted on a system without a USB interface can utilize low-cost joystick and game controllers for visualization, virtual reality, and simulation applications.
     

    Architecture:

    RJS consists of 3 daemon processes which communicate changes in the joystick devices to shared memory.  Figure 1 shows the configuration I use between my SGI Octane and my Linux laptop which has a joystick device.


    Figure 1. (click for a larger version)





    If I'm running the client application on the same system as the joystick only rjsd is required as shown in Figure 2.


    Figure 2.(click for a larger version)

    Requirements:

  • USB support is included in the kernel for versions 2.3 and above.  I recommend the backport of the USB drivers which is included in kernel 2.2.18 which you can download from kernel.org
  • The Linux Joystick Driver is included in the 2.2 kernel - Make sure you kernel has this driver enabled.  Refer to the Linux Joystick Driver homepage for a list of supported devices.
  • If using repeatd the networked systems must be able to open up a socket connection between them.  Port number 2013 is used by default and may be re-specified with the -p option to repeatd.
  • Download:

    The code and examples are bundled in a single compressed tarball.  The code has been tested with USB joysticks on Linux and on and SGI Octane running 6.5.11.
  • Get rjs.tz (2.0 Mb)
  • Links:

    The Linux Driver Homepage - The best place to start
    mjstest - the multiple joystick test - This is the basic code from which rjsd was formed
    Logitech - Several good USB controllers.  I have the Wingman Rumblepad 
    Interact - Many low-cost USB and 15-pin gameport devices.  I have a MakoPad  that I'm currently working on interfacing ($4.99 at Staples!) (this website requires a Flash plugin for your browser)
     

    Here's some links which assisted me in configuring USB on my laptop:

    Linux USB Project
    John's USB on Linux Experience
    How to get USB devices working under Linux
    Some General Dell Latitude and Linux on a laptop  links:
    Linux on the Dell Latitude CPi A366XT (great stuff - very useful)
    Linux on Dell Latitude  (a little dated but still good)
    Socket-level Programming - the basics for repeatd came from here
    And of course  for free and consistent tracking of website traffic.

    Future Enhancements:

    Too bad writing software isn't as fast as thinking about writing software :)  Some future directions and uses for RJS:
  • Multiple joystick device support -  support for more than a single host/single device
  • Multi-threaded server for repeatd - allowing multiple applications on separate machines to interact with a single device
  • Possibly integrating rjsd with repeatd
  • Encapsulating the raw joystick data into an abstract class.  I'd like to do things like:

  •   - Turning a two-axis controller (digital or analog) into 4 separate switch devices
      - Report rate data instead of instantaneous analog or digital data to the application
      -  Smooth data from "noisy" devices
      - Incorporate quaternion or matrix-valued rotations into low-level joystick functions
      - Adaptive sleep intervals for RJS.  The code currently has a CPU-intensive inner loop.
      - Allow the user to rotate the axis of a controller to accommodate left hand/right hand use or ergonomic issues
     
  • In the future I'd like to extend this capability with infared remote controls in addition to joystick devices.  Cheap IR remotes could function in a similar manner as the joystick devices.  The LIRC project page can give you a feel for the possibilities.

  •  

     
     
     
     
     
     

  • Microsoft has some very interesting controllers.  I'm enamored with the Sidewinder Dual Strike. It seems like a great device for architectural walkthrough applications.  (I'm not sure if they're supported yet however)

  •  
     
     
     
     
     

    Contact:

    Ken Schwarz kschwarz@sgi.com
    Hits