Tutorial?

Introduction

The device: PS Move Controller

playstationController.jpg
camera.png

The SDK: PSMoveAPI

We used The PS Move API, which is an open source library for Linux, Mac OS X and Windows to access the Sony Move Motion Controller via Bluetooth and USB directly from your PC without the need for a PS3. Its details can be found on its website.

Requirements

Creating the Development Environment

$ git clone https://github.com/thp/psmoveapi.git

cd to the newly created psmoveapi folder. You can follow the steps provided by the README.ubuntu file. After installing the build dependencies (step 4), I recommend to build the API as a standalone (step 5.b) rather than as an Debian package. During this step I also recommend adding "-DPSMOVE_USE_DEBUG=true -DPSMOVE_USE_DEBUG_CAPTURE=true -DPSMOVE_USE_MADGWICK_AHRS=true" options to cmake command. If you want more options you can install cmake-gui and run it exactly the same way as the cmake command in order to see the other options you may need in a more convenient way.

WARNING : some dependencies are not listed in the README file. You may need to install SDL library from you package manager (libsdl1.2-dev when this tutorial was written). But also bluez, udev and some other libraries that should be preinstalled with your Ubuntu system but sometimes they may not be installed with the system.

You can then go to the build directory you created by following the steps, plug you PSMove controller via USB to your computer and run :

$ sudo psmovepair

If you use a virtual machine, don't forget to plug the bluetooth hardware to your virtual machine so that it can be visible from it. It seems that there are issues with the bluetooth devices sharing on VMWare. Just giving the virtual machine a total control on the hardware should solve such problems.

Don't forget that you should have bluetooth hardware connected to your machine, enabled and set as visible for other devices.

Now you can unplug your device and press the PS button. Your device should establish bluetooth connection with your computer. As a feedback, after pressing the PS button the PSMove led will start blinking and as soon as it connects with the computer the led will stop blinking and be lit continuously.

You can now run :

$ ./example

You should see your PSMove lighting, rumling and then see the captured data in the terminal window. You can also run the test_tracker and test_opengl files that use the PSEye and show some capabilities of the tracker. You can also play arround with the different examples provided in psmoveapi/examples.

If you use a virtual machine, don't forget again to plug your camera to the virtual machine, but you have to know that video capture on virtual machine sometimes won't work. You can try to install cheese from the package manager to check if your video capture is working well. But if you see a black screen even in this programm you have to know that the problem has not been troubleshooted yet, so you won't be able to use tracker data unless you find a solution to this issue.

$ sudo make install

Development of SIGService for PSMoveController

Download the source code from GitHub

Once you have correctly configured and install the Playstation Move API you can then start to develop SIGVerse programs using the PSMove. First, Install the PSMove SIGService on your computer. You can get the source code here on Github. You can also clone the entire repository by running :

$ git clone https://github.com/t-inamura/SIGVerse_test.git

on your machine and then cd to SIGVerse_test/Plugin/PSMove/

Build the project

Now you should be in a directory with a PSMoveAPIService.cpp file, a PSMoveData.h file and a Makefile. Edit the Makefile to provide the path to you installation directory of SIGService include and lib directory. Then you can just run the make command and it will create a PSMoveAPIService.sig file.

Run the service

You can now run the service. Here is the steps to follow in order to make the service runnig fine.

For example if you want to send your messages to "man_001" in the FollowMe sample program :

$ ./PSMoveAPIService.sig localhost 9000 man_001 --enable-tracker

Develop your program

As you may notice the PSMoveAPIService won't have any impact on your program if you don't implement a specific behaviour in your entities' code. If we take the previous example, we are sending messages with the data from the controller and the tracker to "man_001". So we have to handle these messages in the onRecv() method of the entity named "man_001" on the server. When you downloaded the source code of the PSMoveAPIService you got a PSMoveData.h file. This file contains the decoder of the messages sent by the service. just include this file in the implementation of your entity ("man_001" in our example) and use the buildMoveData function on the message received from the PSMoveAPIService. It will format the data from the service in a MoveData struct that you can see in the PSMoveData.h file. There will be one struct for each connected psmove sending data. They are then returned as a std::vector by the buildMoveData method. You can then use the data in your program.

Counter: 6936, today: 1, yesterday: 0

Front page   New List of pages Search Recent changes   Help   RSS of recent changes