Skip to content

fredoliveira/psmoveapi

 
 

Repository files navigation

PS Move API
===========

A cross-platform C library for using the Sony Playstation Move Motion
Controller, with bindings for Python, Java, Qt and others.

The library is available for Mac OS X, Windows and Linux (USB and Bluetooth).

Basic features:

 * Set the RGB LED color and rumble intensity (USB and Bluetooth)
 * Read digital buttons, analog trigger and sensors (Bluetooth only)

Advanced features:

 * Tracking: Controller tracking with a camera using OpenCV
 * Calibration: Reading of normalized/calibrated values
 * Orientation: Rotation tracking using gyro and accelerometer

Minimal build dependencies on Ubuntu:

  build-essential
  cmake
  libudev-dev
  libbluetooth-dev


Environment variables:

 PSMOVE_TRACKER_CAMERA

     If set, this is the camera that will be used when using
     psmove_tracker_new() instead of using auto-detection

   Example: export PSMOVE_TRACKER_CAMERA=2  # Will use the 3rd camera

 PSMOVE_TRACKER_FILENAME

     If set, this will use a video file to playback instead of
     capturing from a camera. Any camera settings are ignored.

   Example: export PSMOVE_TRACKER_FILENAME=demo.avi # Will play demo.avi

 PSMOVE_TRACKER_ROI_SIZE

     If set, this controls the size of the biggest (initial) ROI that will
     be used to track the controller. Bigger means slower in general, but
     recovery from tracking loss might be faster.

   Example: export PSMOVE_TRACKER_ROI_SIZE=200

 PSMOVE_TRACKER_WIDTH, PSMOVE_TRACKER_HEIGHT

     If set, these variables control the desired size of the camera picture.

   Example: export PSMOVE_TRACKER_WIDTH=1280
            export PSMOVE_TRACKER_HEIGHT=720

 PSMOVE_TRACKER_DIMMING

     If set, this controls the dimming factor (1-100) of the RGB LED. Use in
     situations where you can't control the exposure of the camera image.

   Example: export PSMOVE_TRACKER_DIMMING=10




 |- Windows notes ----------- -- -  -
 | If you are using MinGW from the Qt SDK, you have to replace the file
 | libbthprops.a in mingw\lib\ with the file of the same name from the
 | mingw-w64 package. A modified set of Bluetooth headers can be found in
 | external/mingw-w64-headers if you need them - they are taken from the
 | mingw-w64 distribution and have been modified to work with Qt SDK's mingw.
 |
 | If for some reason, you get an assertion error (hFind != NULL) on Windows
 | with psmovepair, it could be that you are not using the Windows Bluetooth
 | stack. Whatever the reason is, the psmovepair utility accepts a command-line
 | parameter that is the desired host address, so you can still pair the device
 | by figuring out the Bluetooth host address manually and using this as the
 | first parameter when starting psmovepair, e.g.:
 |
 |       psmovepair.exe AA:BB:CC:DD:EE:FF
 |
 | If you have Python 2.7 and Swig (tested with 2.0.4) installed, the Python
 | module will be built and can be used normally. If you want to try out the
 | samples, use the follwing (assuming you built the project in "build/":
 |
 |       set PYTHONPATH=..\build\
 |       set PATH=%PATH%;C:\python27\
 |       python psmove_test.py
 |
 .

The PS Move protocol information is based on information from the the linmctool
and Move On PC projects.

Bindings to the API using C# / Unity are available in "bindings/unity". They
can be used to create application in the Unity Framework. This project has been
contributed by the Copenhagen Game Collective (thanks to Douglas Wilson et al)
and has its own homepage at:

    http://www.copenhagengamecollective.org/unimove/

Documentation links:

    http://code.google.com/p/moveonpc/wiki/InputReport

Known issues:

    * On Debian Wheezy, you might need to specify the path to "swig"
      thp#5

Author / contact info: Thomas Perl <m@thp.io>
Project homepage: http://thp.io/2010/psmove/
Git repository: https://github.com/thp/psmoveapi
License: Simplified BSD-style license (see COPYING)

Initial release date 1.0.0: 2011-03-24
Release of PSMoveAPI 1.0.2: 2011-12-03

Updated: 2012-08-07

About

PS Move Controller Low-Level API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 47.6%
  • C++ 40.9%
  • Python 5.1%
  • C# 3.1%
  • Objective-C 2.5%
  • Prolog 0.4%
  • Other 0.4%