Kinect 4 Windows v2.0 Plugin

[=RuBa1987;176578]
I just didn’t RTFM. I think I can just use the mapping defined in KinectFunctionLibrary.h
[/]

Is there a manual somewhere?

[=;176616]
Is there a manual somewhere?
[/]

yep, it’s the code. Well written code should be self documenting for the most part and from what I have seen this code fits that bill. it’s well structured, good conventions that are easy to follow, and good variable names.

Can somebody please explain how to set up a simple Kinect-controlled character in 4.5? Ideally in noob-friendly steps.
I have built the engine with the plugin, but am not sure how to proceed.
Thanks a lot!

[=;176732]
Can somebody please explain how to set up a simple Kinect-controlled character in 4.5? Ideally in noob-friendly steps.
I have built the engine with the plugin, but am not sure how to proceed.
Thanks a lot!
[/]

There are a couple ways you can do it. The first one is in you pawn class add a poseable mesh comp and set the skel mesh that you want to use on there. Then, on being play, grab the events you need to bind to (NewSkeletonDetectedEvent and KinectBodyEvent) and bind them to some events. Then when the New Skeleton Detected event fires assign the skeleton to the player. Here is what that stuff roughly looks like:

That doesn’t work 100% because i’m not entering in a bone name (I just put it together for show)

Here is how you can tell which index to use on your skeleton (from KinectFunctionLibrary.h):

	JointType_SpineBase = 0 UMETA(DisplayName = "JointType_SpineBase"),
	JointType_SpineMid = 1 UMETA(DisplayName = "JointType_SpineMid"),
	JointType_Neck = 2 UMETA(DisplayName = "JointType_Neck"),
	JointType_Head = 3 UMETA(DisplayName = "JointType_Head"),
	JointType_ShoulderLeft = 4 UMETA(DisplayName = "JointType_ShoulderLeft"),
	JointType_ElbowLeft = 5 UMETA(DisplayName = "JointType_ElbowLeft"),
	JointType_WristLeft = 6 UMETA(DisplayName = "JointType_WristLeft"),
	JointType_HandLeft = 7 UMETA(DisplayName = "JointType_HandLeft"),
	JointType_ShoulderRight = 8 UMETA(DisplayName = "JointType_ShoulderRight"),
	JointType_ElbowRight = 9 UMETA(DisplayName = "JointType_ElbowRight"),
	JointType_WristRight = 10 UMETA(DisplayName = "JointType_WristRight"),
	JointType_HandRight = 11 UMETA(DisplayName = "JointType_HandRight"),
	JointType_HipLeft = 12 UMETA(DisplayName = "JointType_HipLeft"),
	JointType_KneeLeft = 13 UMETA(DisplayName = "JointType_KneeLeft"),
	JointType_AnkleLeft = 14 UMETA(DisplayName = "JointType_AnkleLeft"),
	JointType_FootLeft = 15 UMETA(DisplayName = "JointType_FootLeft"),
	JointType_HipRight = 16 UMETA(DisplayName = "JointType_HipRight"),
	JointType_KneeRight = 17 UMETA(DisplayName = "JointType_KneeRight"),
	JointType_AnkleRight = 18 UMETA(DisplayName = "JointType_AnkleRight"),
	JointType_FootRight = 19 UMETA(DisplayName = "JointType_FootRight"),
	JointType_SpineShoulder = 20 UMETA(DisplayName = "JointType_SpineShoulder"),
	JointType_HandTipLeft = 21 UMETA(DisplayName = "JointType_HandTipLeft"),
	JointType_ThumbLeft = 22 UMETA(DisplayName = "JointType_ThumbLeft"),
	JointType_HandTipRight = 23 UMETA(DisplayName = "JointType_HandTipRight"),
	JointType_ThumbRight = 24 UMETA(DisplayName = "JointType_ThumbRight"),
	JointType_Count = 25 UMETA(DisplayName = "JointType_Count", Hidden)

Now, you are likely going to need to do some magic depending on your skeleton and such to get the transforms to apply properly. That you will need to play around with and figure out.

All that being said I didn’t really care for this approach.

The other way you can do this is via an anim instance. Create a new anim instance and in the even graph do something like this:

Then go to the anim graph, create a state machine and all those basics (or you can do it in the root of the anim graph, I just don’t like doing that) and do something like this:

Again, you will need to fiddle around with the rotations and such but this is the general idea (or at least the approach I am taking).

Thanks a lot for the instructions!

This cleared up things, but as somebody new to UE4, it is very hard to reproduce this all…

Is it possible to post a small demo project?

After giving a few different techniques a try on animating a skeleton with this data I am curios how other people have done it. Can someone post some info on the techniques you are using to do the animation? The one i have posted above work for the most part but it seems overly tedious to get things to be nice and smooth.

[=;176818]
Thanks a lot for the instructions!

This cleared up things, but as somebody new to UE4, it is very hard to reproduce this all…

Is it possible to post a small demo project?
[/]

I’m still testing things out and trying to get something nice a smooth. Once I do that I will post a tutorial and code to go with it.

The approaches that I have tried all have their ups and downs but none of them make it easy to get the animations smooth.

[=]
After giving a few different techniques a try on animating a skeleton with this data I am curios how other people have done it. Can someone post some info on the techniques you are using to do the animation? The one i have posted above work for the most part but it seems overly tedious to get things to be nice and smooth.
[/]

I would think that an IK approach in the anim graph would be the way to go with this but i’m not getting clean results with it. That’s kinda where I was going with this approach.

[=;149270]
Hey all!

I want to thank and Epic devs for their help!

I have an exciting new feature to unveil!

Motion capture!

https://.com/watch?v=82zaW1EoYgQ
[/]

can you post some screenshots of the anim bp you are using for this? I’m trying to do this but I want to do it in real-time rather than mocap.

Hi I am working on a ue4 project that will use the kinect v2. However, the github repo for the plugin is down. Please how can I get it?

seems to up: https://github.com/lion03/UE4-K4W-Plugin/tree/KinectV2Plugin-4.5

you can also use this: http://www.downforeveryoneorjustme.com/

you need to have an active UE subscription with a github account linked to Epic. This is an engine plugin so you will need to build it with the engine source so you can’t (with some exceptions) get away with using an old engine version unless it matches what they have coded it for.

Hi all :).
Want to ask for some clarifications, I am trying to build a classical virtual pit experiment at my University with Oculus Rift DK2 and hopefully Kinect v2, which is on the way. We have ditched some ideas of IMUs for tracking which were too expensive until things like PrioVR gets out of Kickstarter that lead us to Kinect v2, as Kinect 1 is just too slow for VR applications.

I want to ask, If I can make something like the experiment shown in this video (skip to 2:55) with this plugin: https://www…com/watch?v=KqEdn2lTpPw
We have and Oculus Rift DK2 and a Kinect v2 on the way. I have read through this whole forum but haven’t found if the current version of the plugin can handle real time skeletal tracking as seen in the video or not.
I have also thought about changing the facing of the player so he will be only moving sideways on the plank facing directly kinect if it helps tracking or makes it more easy for tracking. For better understanding skip to 1:20 in this videowww…com/watch?v=ZDRONATWc2g (Sry could not find better example). The guy going first is the example here, and the pit would be only on one side of the plank as seen, so it would simulate the feeling of walking over mountain ledge, with wall flat surface behind the player being the mountain.
Also can you get the plugin with the free Academic subscription of UE4?
Thx in advance for answer

1 Like

anyone know how to get the kinect plugin to work in the standalone game launch mode?

Hi,

just tried to compile the plugin with UE4.5 sources. Did I understand that correctly that the plugin now needs no engine modifications? Since I took the KinectV2 folder from plugins and copied it into my “normal” UE4 source folder. But I get compile errors:

Thanks for any hints!

I just followed this and it works in 4.5 for me

[=BZysberg;161647]
Hello,

Here’s a quick step by step on how to compile the plugin.

Requirements :
-Windows 8.1 64 bits. The Kinect For Windows SDK 2.0 DOES NOT work on Windows 7.
-Kinect For Windows SDK 2.0 : http://www.microsoft.com/en-us/download/details.aspx?id=43661 : BE CAREFUL. Microsoft pushed a new version (1409) mid-september and you need it.
-USB 3.0. And only a few controllers are recognized such as Intel’s or Renesas’
-Kinect For Windows 2
-Visual 2013
-June 2010 DX Runtime : http://www.microsoft.com/en-us/download/details.aspx?id=8109

Once everything is installed, plug Kinect and launch the Kinect Samples Browser.
Look for Body Basics D2D and click on run. If your skeleton does not appear while you’re in front of Kinect, it means your Kinect is not working.
It’s no use to move further.

Now to compile :

I - You already have the sources of the engine
1)Get Lion’s plugin from his GitHub : https://github.com/lion03/UE4-K4W-Plugin/tree/KinectV2Plugin-4.4
2)Copy the folder KinectV2 from the folder Engine/Plugins into your own folder Engine/Plugins. If you already had a previous version, delete the entire existing KinectV2 folder first.
3)Run the batch “GenerateProjectFiles.bat”. It will parse all the news files and update the solution
4)Choose the Development configuration and the x64 platform
5)Build
6)Copy Kinect20.VisualGestureBuilder.dll from C:\Program Files\Microsoft SDKs\Kinect\v2.0-PublicPreview1409\Redist\VGB\x64 into …\GitHub\UnrealEngine\Engine\Binaries\Win64

II - You don’t have the sources of the engine
1)It’s going to be faster to use Lion’s entire branch so get it from GitHub :
https://github.com/lion03/UE4-K4W-Plugin/tree/KinectV2Plugin-4.4
2)Download the two dependencies :
https://github.com/EpicGames/UnrealEngine/releases/download/4.4.0-release/Required_1of2.
and
https://github.com/EpicGames/UnrealEngine/releases/download/4.4.0-release/Required_2of2.
3)Unzip them where you placed the sources.
4)Run the batch GenerateProjectFiles.bat. It will generate the solution.
5)Open the solution with VS2013
6)Choose the Development configuration and the x64 platform
7)Build
8)Your custom build of UE will be located in Engine\Binaries\Win64
9)Copy Kinect20.VisualGestureBuilder.dll from C:\Program Files\Microsoft SDKs\Kinect\v2.0-PublicPreview1409\Redist\VGB\x64 into Engine\Binaries\Win64
[/]

1 Like

Mmhh, I did the same. Did you use the latest commit from the UE4 Github? And just to be sure: You used the 4.5 branch of the plugin (not the 4.4 from those instructions)?

I used the 4.5 release branch:

git checkout 4.5.1-release

you shouldn’t use master for stuff like this. they update/break master all the time. Also, just because the latest we can download from the launcher is 4.5.1 (or whatever it is at any give time) doesn’t mean that master is the same as that either.

I was using the 4.5.1-release branch, but I still got those errors - that’s a little confusing. Anyway, I removed the SealedEvent and EditInline attributes and then things first seem to compile fine, but then I get errors that “FCOMPTR is not a template”. I must be doing something completely wrong, like using incompatible code branches, but I double-checked and couldn’t find the issue. Maybe that latest FCOMPTR error is a hint for someone what I might be doing wrong?

I’m going to be doing a clean setup for one of the guys I work with this weekend. I will take note of anything I do that is different from the steps above. There is a decent chance I did something different and didn’t really think about it.

Nope

[=RuBa1987;180139]
anyone know how to get the kinect plugin to work in the standalone game launch mode?
[/]

Struggling with this as well.
Even packaged in shipping mode it looks like it’s not picking up any of the kinect functionality.