[[Tutorial]] #contents * Control of an agent by Kinect [#s03fafab] ※This tutorial is valid for SIGVerse 2.2.0 or later. ※This tutorial requires Windows 8.1 and Kinect for Windows SDK 2.0. This tutorial introduces a method to control a human avatar using KinectV2 sensor ** Kinect for Windows SDK 2.0 [#qd9610ff] -[[You can download SDK from here>http://www.microsoft.com/en-us/download/details.aspx?id=44561]] ** Set up at client side on Windows 8.1 [#hc45c4cb] A plug-in module for the SIGViewer receives motion data from Kinect, calculates Quaternion of each joint, and send the data to avatar controller on the server. *** Building the KinectV2 SIGService from source [#nefbf579] Connect your Kinect to the client PC. ** Set up at server side [#vbb0fd2f] A controller receives joint angle data; controls the avatar's joints. *** Controller [#vc7899c9] Create a controller file kinectController.cpp as follows: #gist(raghavendrajain/bbe0100ecaa008a3951b) This controller receives messages from Kinect; rotates each joint of an avatar. Compile with the following command. $ ./sigmake.sh kinectController.cpp *** World file [#kcdef075] Create world file kinectWorld.xml as follows: #gist(raghavendrajain/b5fb732e835db76eabcc) Just an avator will be appeared in this world. This sample controls only one human avatar by the Kinect. ** Execution [#s58961b9] *** SIGVerse server [#fe0a59dc] Start the SIGVerse server $ sigserver.sh -w ./kinectWorld.xml Next, run the SIGViewer and connect to the sigserver. You can see an avatar is standing. *** Registration of user interface plug-in [#i3bdc209] Click the [Service]-->[Add] menu on the top-left of the SIGViewer window bar. #ref(SIGNi_1.PNG) You then can see the following window. Click the Add button to registrate SIGNiUserTracker.sig #ref(./SIGNi_2.PNG,80%) After the registration of SIGNiUserTracker.sig to the Service list, click the OK button to close the window. Next, click the [Service]-->[Start] menu; then select the SIGNiUserTracker.sig. If the Kinect's depth map window is appeared and you see the following message on the server, it means the application is successfully started. [SYS] Service: "SIGKINECT" is available Click the "START" button to start the simulation. You can control the human avatar with the Kinect. #ref(./SIGNi_3.PNG,40%) ** Compilation of source code of user interface plug-in [#n9886846] In this tutorial Visual C++ 2008 is used to compile the user interface plug-in. *** Download of the source code of user interface plug-in [#g1622ce0] Please download the source code from [[KINECT Service]] //#ref(SIGNiUserTracker_1-0-0.zip) Move the SIGNiUserTracker folder, which is contained in the ZIP file, to a folder which has sample codes of OpenNI. C:\Program Files (x86)\OpenNI\Samples *** Compile [#od39f64a] Next, double-click the solution file in the SIGNiUserTracker folder with administrative right. ※You have to install boost library in the case of the version number is 1.0.0. //VC++が起動したらソリューションエクスプローラの中のソリューション名を右クリックしてビルドを選択します。ビルドが成功すると以下に実行ファイルSIGNiUserTracker.exeが作成されます。 Right-click the solution name in the solution explorer of VC++ to build the source code. If the build succeeds, SIGNiUserTracker.exe will be created at C:\Program Files (x86)\OpenNI\Samples\Bin\Release You can registrate the plug-in module to SIGViewer after changing the suffix from .exe to .sig. #highlight(end)