node-sixense

0.2.78 • Public • Published

NodeSixense

Description:

A NodeJS addon/port of the Sixense SDK for "six-degrees-of-freedom" controllers, such as the Razer Hydra™.

Restrictions:

  1. Linux based OS
  2. Currently only one sixense base is supported.

Prerequisite:

  1. node-gyp installed globally: npm install -g node-gyp

Documentation:

Refer to the 'Sixense_SDK_Reference.pdf' and 'Sixense_SDK_Overview.pdf' available from Sixense's website for instructions on how to utilize the available SDK methods. All the Sixense SDK methods work as described.

There are a few additional methods meant to make working with the module easier in JavaScript:

sixenseInit() and sixenseSetActiveBase(0) should be called before accessing any of the following mechanics. Once finished with these mechanics sixenseExit() should be called.

sixenseGetAllNewestDataAsync:

An asynchronous version of sixenseGetAllNewestData. This method accepts a callback that should accept error and allData parameters. The callback will be called every ~16.6ms (the refresh rate of the SixenseSDK). Once this method is invoked, you must call sixenseGetAllNewestDataAsyncStop in order to stop the module from executing the callback sent to sixenseGetAllNewestDataAsync.

sixenseGetAllNewestDataAsyncStop:

This method is used to stop the execution of the callback sent sixenseGetAllNewestDataAsync. If sixenseGetAllNewestDataAsync hasn't been called, this method doesn't do anything.

Events:

node-sixense is an EventEmitter from the NodeJS events module. All listeners must be removed before exiting your application. All event callbacks should accept a data parameter (the data listened for) and a metaData parameter (metaData about the data provided). All object level events will be emitted every ~16.6ms. All property level events will be emitted when that property changes.
Here is a list of the events that can be listened for:

  • controller:[index] - (i.e. - controller:0) emits all data associated with the requested controller.
  • controller:[index]:position - emits all position data associated with the requested controller.
  • controller:[index]:position:x - emits the x-axis position associated with the requested controller.
  • controller:[index]:position:y - emits the y-axis position associated with the requested controller.
  • controller:[index]:position:z - emits the z-axis position associated with the requested controller.
  • controller:[index]:rotationMatrix - emits all rotationMatrix data associated with the requested controller.
  • controller:[index]:rotationMatrix:x - emits all rotationMatrix x-axis data associated with the requested controller.
  • controller:[index]:rotationMatrix❌x - emits all rotationMatrix x-axis x position associated with the requested controller.
  • controller:[index]:rotationMatrix❌y - emits all rotationMatrix x-axis y position associated with the requested controller.
  • controller:[index]:rotationMatrix❌z - emits all rotationMatrix x-axis z position associated with the requested controller.
  • controller:[index]:rotationMatrix:y - emits all rotationMatrix y-axis data associated with the requested controller.
  • controller:[index]:rotationMatrix:y:x - emits all rotationMatrix y-axis x position associated with the requested controller.
  • controller:[index]:rotationMatrix:y:y - emits all rotationMatrix y-axis y position associated with the requested controller.
  • controller:[index]:rotationMatrix:y:z - emits all rotationMatrix y-axis z position associated with the requested controller.
  • controller:[index]:rotationMatrix:z - emits all rotationMatrix z-axis data associated with the requested controller.
  • controller:[index]:rotationMatrix:z:x - emits all rotationMatrix z-axis x position associated with the requested controller.
  • controller:[index]:rotationMatrix:z:y - emits all rotationMatrix z-axis y position associated with the requested controller.
  • controller:[index]:rotationMatrix:z:z - emits all rotationMatrix z-axis z position associated with the requested controller.
  • controller:[index]:rotationQuaternion - emits all rotationQuaternion data associated with the requested controller.
  • controller:[index]:rotationQuaternion:x - emits all rotationQuaternion x-axis associated with the requested controller.
  • controller:[index]:rotationQuaternion:y - emits all rotationQuaternion y-axis associated with the requested controller.
  • controller:[index]:rotationQuaternion:z - emits all rotationQuaternion z-axis associated with the requested controller.
  • controller:[index]:rotationQuaternion:w - emits all rotationQuaternion unit vector associated with the requested controller.
  • controller:[index]:joystick - emits all joystick data associated with the requested controller.
  • controller:[index]🕹x - emits joystick x-axis position associated with the requested controller.
  • controller:[index]🕹y - emits joystick y-axis position associated with the requested controller.
  • controller:[index]:trigger - emits all trigger state associated with the requested controller.
  • controller:[index]:buttons - emits all button data associated with the requested controller.
  • controller:[index]:buttons:button1 - emits button 1 state associated with the requested controller.
  • controller:[index]:buttons:button2 - emits button 2 state associated with the requested controller.
  • controller:[index]:buttons:button3 - emits button 3 state associated with the requested controller.
  • controller:[index]:buttons:button4 - emits button 4 state associated with the requested controller.
  • controller:[index]:buttons:start - emits start button state associated with the requested controller.
  • controller:[index]:buttons:bumper - emits bumper button state associated with the requested controller.
  • controller:[index]:buttons:joystick - emits joystick button state associated with the requested controller.

License:

The Sixense SDK is licensed under Sixense EULA which can be found here: http://sixense.com/eula

The JS port and NodeJS addon portions are licensed under:

The MIT License (MIT)

Copyright (c) 2013 Tyson Hester

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package Sidebar

Install

npm i node-sixense

Weekly Downloads

9

Version

0.2.78

License

MIT

Last publish

Collaborators

  • ironman9967
  • yurikoex