Program to transfer camera data to virtools directly from the kinect camera or from recorded files (use [PCL_Recorder]). Includes skeleton tracking and the AR Toolkit for camera tracking. Data can be returned in a number of ways.
For broadcasting data directly from the Kinect camera, using one ARTK pattern:
Kinect_Server_OpenNI.exe -x KinectAR.xml -c KinectCalib.dat -p marker_large_ID0.cfg
For broadcasting recorded data from a directory, using two ARTK patterns and world-centric tracking data (add list of patterns last!):
Kinect_Server_OpenNI.exe -x KinectAR.xml -r "F:\FullCap3" -f 20 -w -c KinectCalib.dat -p marker_large_ID0.cfg marker_config_2.cfg
Note that the images are received in Virtools using the Virtools_ImageStreamClient Manager. There is still an issue with image lag.
NB: Make sure that both the sender and the receiver are started with the same access rights when using the Named Pipe (i.e. both started with/without Administrator priviledges). Otherwise, the pipe will fail upon reading access!
If you broadcast pattern tracking data in camera-centric format (position of pattern relative to camera, without "-w" flag), use the following VRPN settings:
vrpnTracker_0 ARTK@localhost:3883
neutralPosition_0 0.0 0.0 0.0
neutralQuaternion_0 0.707106781186548 0.0 0.0 0.707106781186548
axisPermute_0 0 1 2
axisSign_0 1 -1 1
trackerScale_0 1
We assume the following conventions with regards to Virtools: The world extends in the x-z plane, gravity acts along the -y axis. Keep this in mind for the following VRPN settings.
If you broadcast pattern tracking data in pattern_centric format (position of camera relative to pattern, "-w" flag, use the following VRPN settings:
vrpnTracker_0 ARTK@localhost:3883
neutralPosition_0 0.0 0.0 0.0
neutralQuaternion_0 0.707106781186548 0.0 0.0 -0.707106781186548
axisPermute_0 0 2 1
axisSign_0 1 1 1
trackerScale_0 1
Skeleton data is currently provided only relative to the camera. Use the following VRPN settings:
vrpnTracker_1 skeleton_pose@localhost:3883
neutralPosition_1 0.0 0.0 0.0
neutralQuaternion_1 0.707106781186548 0.0 0.0 0.707106781186548
axisPermute_1 0 1 2
axisSign_1 1 1 1
trackerScale_1 1
A typical ARTK marker file (marker_config.cfg)
# multimarker definition file for ARToolKit (format defined by ARToolKit)
# dataset for test Painting application
# number of markers
1
# marker 0
0
120.0
0.0 0.0
1.0000 0.0000 0.0000 0.0
0.0000 1.0000 0.0000 0.0
0.0000 0.0000 1.0000 0.0
Typical Kinect camera calibration data (KinectCalib.dat)
ARToolKitPlus_CamCal_Rev02
640 480 320.0 240.0 523.7521 523.7964 0.2238 -0.3194 0.0049 -0.0069 0.0 0.0 0.0
Typical OpenNI configuration file (KinectAR.xml)
<OpenNI>
<Licenses>
<!-- Add licenses here
<License vendor="vendor" key="key"/>
-->
</Licenses>
<Log writeToConsole="false" writeToFile="false">
<!-- 0 - Verbose, 1 - Info, 2 - Warning, 3 - Error (default) -->
<LogLevel value="3"/>
<Masks>
<Mask name="ALL" on="true"/>
</Masks>
<Dumps>
</Dumps>
</Log>
<ProductionNodes>
<!-- Normal Image -->
<Node type="Image" name="Image1">
<Configuration>
<!-- <MapOutputMode xRes="640" yRes="480" FPS="30"/> -->
<Mirror on="false"/>
</Configuration>
</Node>
<!-- Depth Image -->
<Node type="Depth" name="Depth1">
<Configuration>
<!-- <MapOutputMode xRes="640" yRes="480" FPS="30"/> -->
<Mirror on="false"/>
</Configuration>
</Node>
<Node type="User"/>
<!-- Normal IR -->
<!--
<Node type="IR" name="IR1">
<Configuration>
<MapOutputMode xRes="640" yRes="480" FPS="30"/>
<Mirror on="false"/>
</Configuration>
</Node>
-->
<!--
<Node type="Audio" name="Audio1">
</Node>
-->
</ProductionNodes>
</OpenNI>
Serves as a network image streaming server to the Virtools_ImageStreamClient manager. Acts as a VRPN server broadcasting skeleton and marker tracking data
Skeleton Data:
6 - (XN_SKEL_RIGHT_HIP)
12 -(XN_SKEL_LEFT_HIP)
2 - (XN_SKEL_NECK)
1 - (XN_SKEL_TORSO)
3 - (XN_SKEL_RIGHT_SHOULDER)
9 - (XN_SKEL_LEFT_SHOULDER)
0 - (XN_SKEL_HEAD)
4 - (XN_SKEL_RIGHT_ELBOW)
5 - (XN_SKEL_RIGHT_HAND)
10 - (XN_SKEL_LEFT_ELBOW)
11 - (XN_SKEL_LEFT_HAND)
7 - (XN_SKEL_RIGHT_KNEE)
8 - (XN_SKEL_RIGHT_FOOT)
13 - (XN_SKEL_LEFT_KNEE)
14 - (XN_SKEL_LEFT_FOOT)
Compiling:
Running: