Announcement

Collapse
No announcement yet.

[Plugin] Leap Motion - Event Driven

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    #46
    Ok when you say play around with the values in persona do you mean I go into persona find the location of my characters elbows (lowerhand_l and lowerhand_r) and plug those in as join target location?

    I get movement out of my hands but theyre still stuck to his hips. I added SETs of my palm position and elbow position inside my BP_leapController so now when I call those variables they have something in it FYI is this good or bad?

    Comment


      #47
      Thanks, getnamo! The .dll switch didn't do anything, but I had forgotten to enable images from within the plug-in!

      (Also for some reason the billboards were disappearing so I had to route it to a static mesh with a custom material).

      It's sweet!

      Comment


        #48
        Hey getnamo I created two sockets behind each elbow and set them to 60 and -60 on the Y axis but that did not fix my characters fondling problem. Am I misunderstanding what you explained?

        Comment


          #49
          Originally posted by Joe1029 View Post
          Ok when you say play around with the values in persona do you mean I go into persona find the location of my characters elbows (lowerhand_l and lowerhand_r) and plug those in as join target location?

          I get movement out of my hands but theyre still stuck to his hips. I added SETs of my palm position and elbow position inside my BP_leapController so now when I call those variables they have something in it FYI is this good or bad?
          I guess I mentally shortcutted the process in my mind, what I meant by the persona preview is go to your AnimationBlueprint and turn your joints into variables. After having them fed in to the IK you can change any of the default values to your left and you will see what effect that has. This is a very handy way of previewing, debugging and changing your animation setup without adding the complexity of your actual input system.

          Here is what I mean:


          Also make sure that you IK alpha is set to 1.0 or you will not see any change as the animation setup will still use your animations fully instead of your IK.

          Originally posted by zalo View Post
          Thanks, getnamo! The .dll switch didn't do anything, but I had forgotten to enable images from within the plug-in!

          (Also for some reason the billboards were disappearing so I had to route it to a static mesh with a custom material).

          It's sweet!
          Great In my case the billboard was simply a component I had attached to my character to quickly debug the image output.
          Plugins: TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense - CIM

          Comment


            #50
            hey anyone can make a small video for show the actual and real latency?
            pd: excuse my english.

            lfw/paid modeling, painting, texturing.

            Comment


              #51
              So I set up leftJoint and rightJoint variables and I was tweaking the numbers but nothing happens and I made sure my alpha was on which is being driven by Bool LeapEnabled which is checked. Is it possible that something else is broken?
              Attached Files

              Comment


                #52
                Ok Getnamo update on my failures. In an attempt to get the joint target set up I created sockets at each elbow and placed the sockets 60 units behind each elbow (respectively 60 and -60) this is what I understood as behind the elbow. Then I put those value in the Y axis' of my joint variables plugged that into the joint target location and still nothing. I notice that when I launch the game the characters hands are still around its waist but the hands are receiving input from the leap so they move around near the waist but do not lift up . My hands are not moving in the z axis.
                Last edited by Joe1029; 10-21-2014, 10:32 PM.

                Comment


                  #53
                  Originally posted by Joe1029 View Post
                  Ok Getnamo update on my failures. In an attempt to get the joint target set up I created sockets at each elbow and placed the sockets 60 units behind each elbow (respectively 60 and -60) this is what I understood as behind the elbow. Then I put those value in the Y axis' of my joint variables plugged that into the joint target location and still nothing. I notice that when I launch the game the characters hands are still around its waist but the hands are receiving input from the leap so they move around near the waist but do not lift up . My hands are not moving in the z axis.
                  Couple of things (and this is why skeletal animation isn't really a trivial topic). Make sure you have rotated your inputs to have Y as forward (whereas world uses X), make sure again you are not just forwarding the raw values, but that you have a leap to character root offset added to the inputs before they are forwarded (unless you're using topdown with an hmd). The joint targets should probably be in component space and should not rotate with your arm movements (it may work otherwise, but I haven't personally tested this)

                  In your preview it appears that your hands are close to your character pelvis which indicates the alpha is working, since 0,0,0 is your component root which in the default character is at the pelvis. Now all you need to do to preview is change the Left Hand and Right Hand Position and see how the elbow bends as you move the positions around. Adjust the joint targets such that the elbow bends in a natural way.

                  Also ideally you should set Alpha to 0 whenever you hands are not visible, since you will have wrong data otherwise. That way you can let your animations handle your hand positions when they aren't being tracked by the leap. Quite a lot of this is covered in the hydra thread. Debug your vectors to visualize what they are doing and try to make them match what the animation system is expecting (by seeing what preview values are needed for the hand motions), this will indicate what you're doing wrong.

                  I am working on a generalized structure, which will have a convenience skeletal bind which will work for all vr input types, but it may be a few weeks before that gets posted, until then refer to the past few posts, the hydra thread and the unreal IK documentation for the how-to knowledge.
                  Plugins: TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense - CIM

                  Comment


                    #54
                    Finally got it work! I had to manually copy Leap.dll from the Win64 folder to my Windows/System32 folder. You should add this to the install instructions.

                    Comment


                      #55
                      The reason the distortion maps appear in the green and blue channels has to do with the pixel format you're using ("PF_B8G8R8A8") in the CreateTransient function (orders it BGRA).

                      You want to use "PF_R8G8B8A8" to get them into proper RGBA... though you should really be using "PF_G32R32F" (32-Bit Floats in each of the Red and Green channels) for lossless distortion data.

                      EDIT: Hmm, looks like my bit-fu isn't up to the task...
                      Last edited by zalo; 10-22-2014, 04:54 PM.

                      Comment


                        #56
                        Originally posted by BartBarlowski View Post
                        Finally got it work! I had to manually copy Leap.dll from the Win64 folder to my Windows/System32 folder. You should add this to the install instructions.
                        You shouldn't need to do that. This meant you probably used a non-standard version of the UE editor and you needed to compile the plugin, or you didn't add your leap.dll in the proper place (binaries in project root) or you were launching your app (which isn't really supported with plugins) instead of playing in editor (or play standalone).

                        I suppose this is one way to get that form of use working though.

                        Originally posted by zalo View Post
                        The reason the distortion maps appear in the green and blue channels has to do with the pixel format you're using ("PF_B8G8R8A8") in the CreateTransient function (orders it BGRA).

                        You want to use "PF_R8G8B8A8" to get them into proper RGBA... though you should really be using "PF_G32R32F" (32-Bit Floats in each of the Red and Green channels) for lossless distortion data.

                        EDIT: Hmm, looks like my bit-fu isn't up to the task...
                        I tried this when I was doing the image conversion for 0.7 and decided it wasn't worth the extra effort for now, but if you can make the 32-bit floats work, please make a pull request and I'll merge it. It also doesn't matter that the distortion map is split into specific channels since they are simply specific distortion information which you will pull out of the channels when you use the pixel and fragment shader to correct the image for whatever projection you want to use (see Leap Camera Image API).
                        Last edited by getnamo; 10-26-2014, 01:42 PM.
                        Plugins: TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense - CIM

                        Comment


                          #57
                          Hi again getnamo!

                          Im trying to determine which direction a user "swipes".. for instance.. from left->right or from right->left.. but I cant quite figure out how to do this the best way.. I guess that since I have the last 60 frames I could compare the hands position over the last for instance 20 frames and determine, do you have any other better options?

                          Thanks in advance!

                          Comment


                            #58
                            me.... again....
                            Im trying to create a packaged build, but Im abit unsure of how to do this.
                            I have read your documentation but I dont quite follow...

                            Projects require code, if you are using blueprint only add an empty class and compile your project module.
                            What sort of empty class?.. a C++ empty class?.. any specific class-name or filename thats required?.. in which dir should I place this empty class?.. how do I compile it?..
                            So for instance in my case I have used only Blueprints and used the FPS template without downloading any engine source code.. is ths engines source-code required for the compile?
                            If there is any other documentation regarding this that I could read then please let me know

                            Br,
                            Inx

                            Comment


                              #59
                              Originally posted by Inx51 View Post
                              me.... again....
                              Im trying to create a packaged build, but Im abit unsure of how to do this.
                              I have read your documentation but I dont quite follow...

                              Projects require code, if you are using blueprint only add an empty class and compile your project module.
                              What sort of empty class?.. a C++ empty class?.. any specific class-name or filename thats required?.. in which dir should I place this empty class?.. how do I compile it?..
                              So for instance in my case I have used only Blueprints and used the FPS template without downloading any engine source code.. is ths engines source-code required for the compile?
                              If there is any other documentation regarding this that I could read then please let me know

                              Br,
                              Inx
                              You simply do File->Add Code to Project and it can be anything so usually I just pick None->Create Class and then it will ask you to open visual studio where you just hit compile (Build solution or F7).

                              If you haven't added code before follow the unreal engine programing Quick Start guide. Essentially it boils down to downloading the free Visual Studio express and changing a few small configs.

                              You absolutely do not need a copy of the UE engine source, I almost exclusively use the stable prebuilt binaries for the editor that unreal releases since my code doesn't modify the engine in any way.

                              Originally posted by Inx51
                              Hi again getnamo!

                              Im trying to determine which direction a user "swipes".. for instance.. from left->right or from right->left.. but I cant quite figure out how to do this the best way.. I guess that since I have the last 60 frames I could compare the hands position over the last for instance 20 frames and determine, do you have any other better options?

                              Thanks in advance!
                              You can identify the direction by simply comparing the last frame hand/finger/pointable position to the current one.

                              But! I realized I have not included the gesture sub-classes in the plugin! Will update the plugin to include those and then it should be as easy as Gesture->Cast to Swipe Gesture-> Direction.
                              Plugins: TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense - CIM

                              Comment


                                #60
                                Getnamo, I figured out why my characters hands were staying next its hips was that the leap data was not being transferred 1:1 even though the "Use Topdown" was ticked. So I had to break the vectors flip the X and Y and times the X and Z by 100 and Y by -100. So now my arms are moving about but I still do not get any bend in my elbows I've played with the preview and default values with the Leap enabled and still nothing happens to the Joint target location. No matter what value I put into joint target location my joint target is not being affected. Do you have any idea what could be happening?
                                Attached Files
                                Last edited by Joe1029; 10-23-2014, 08:34 PM.

                                Comment

                                Working...
                                X