Announcement

Collapse
No announcement yet.

Razer Hydra Plugin

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

    Originally posted by aialexander View Post
    Hey, Getnamo! I just wanted to let you know that I tried out your new system and went through this process for the new hydra plugin, but I seem to have broken something. Now every time I try to hit play in the editor, Unreal crashes. All I did was add the Hydra component to the default character blueprint. I will try the second option and see if I get the same result.

    EDIT: Okay I've tried both methods and I've gotten crashes for both. Not sure what's causing it. For the time being I'll see what I can do with the older tutorials for this plugin and see how far I get.
    If you're using 0.7.1 make sure you're copying both the Plugins folder and the Binaries folder. The update brought win32 shipping build and I synced the overall setup with all my other plugins. I've tested the plugin on a blank project and it shouldn't crash, if it still is, send me your logs, but before you do that try to start from a fresh project so you can help narrow the scope.
    Plugins: Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense

    Comment


      Alrighty, I gave that a shot as well, and even started a fresh project. Still crashing. How do I send you my logs?

      Comment


        Originally posted by aialexander View Post
        Alrighty, I gave that a shot as well, and even started a fresh project. Still crashing. How do I send you my logs?
        This is weird, the hydra plugin has always been very stable. To help me narrow the issue, make a clean project (no code), add the plugins and binaries then open the project. Then add the Hydra Component and add the Hydra Interface (edit: this part is NOT optional for receiving events!). Then in your graph try subscribing to any of the events. Hit play in editor, if you crash then send the logs found at {Project Root}/Saved/Logs.
        Last edited by getnamo; 10-18-2014, 03:48 PM.
        Plugins: Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense

        Comment


          I have the same problem. (crash)

          For me the FhydraPlugin:elegateTick is called before the fHydraPlugin::SetDelegate

          Putting in a flag in SetDelegate and testing it in DelegateTick stops the first crash on startup.

          If stopped and restarted in the editor it will again crash because the DelegateTick is call before SetDelegate.

          Is there a function to test the Delegate to make sure it has a good value?

          Comment


            Originally posted by MaxFlash View Post
            I have the same problem. (crash)

            For me the FhydraPlugin:elegateTick is called before the fHydraPlugin::SetDelegate

            Putting in a flag in SetDelegate and testing it in DelegateTick stops the first crash on startup.

            If stopped and restarted in the editor it will again crash because the DelegateTick is call before SetDelegate.

            Is there a function to test the Delegate to make sure it has a good value?
            You haven't set the Hydra interface, if you're using components you must add the hydra interface to your blueprint. There should be a warning shown and in the log saying "HydraBlueprintDelegate Warning: Delegate is NOT set, did your class implement HydraInterface?". I will ensure this won't cause a crash in the future, but this is the root cause of the problem.

            Edit:
            Patched the plugin to 0.7.2 which contains the fix. This will stop your game from crashing, but until you add the HydraInterface to your class, you will not receive the hydra events and a warning will be emitted to your screen and log files.
            Last edited by getnamo; 10-18-2014, 04:00 PM.
            Plugins: Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense

            Comment


              Okay I think I figured out what I did wrong. The first time I posted I did not copy the Binaries file to my directory, which I didn't know I needed to do, since I didn't need to do that for the previous version. The second time I posted I think I forgot to add the hydra interface to my blueprint. I started a fresh project in the 3rd person template and followed the steps again and got the project to print a string for me when the hydra was moved. And the best part, no crash! Yay!

              Comment


                @n00854180t, I think I figured out why I was having issues with my blueprint when I was following your examples before. Because I was following your blueprints so closely, I never set up the input mappings to receive any input from the hydra, so there was nothing in my character blueprint to tell the character to do anything when I was waving my hydras around. At least that's my theory.

                Comment


                  I need your help again. I was able to set up the input axes relatively easily in the Project settings menu for Hydra Left Motion and Hydra Right Motion, but I'm having a LOT of trouble figuring out how to set them up in the character blueprint to make them work. My confusion lies primarily in what targets go where and how to transform what bone to where using what nodes. It seems like a lot of the functions reference a component called a poseable mesh, which through trial and error, I have come to the conclusion that this is not what I am looking for. So far however, all of the nodes I have experimented with referencing a skeletal mesh are equally as confusing. On the bright side, I have a small semblance of a calibration happening in game, although not entire noticeable if you're not looking for it.
                  Last edited by aialexander; 10-19-2014, 06:58 PM.

                  Comment


                    Originally posted by aialexander View Post
                    I need your help again. I was able to set up the input axes relatively easily in the Project settings menu for Hydra Left Motion and Hydra Right Motion, but I'm having a LOT of trouble figuring out how to set them up in the character blueprint to make them work. My confusion lies primarily in what targets go where and how to transform what bone to where using what nodes. It seems like a lot of the functions reference a component called a poseable mesh, which through trial and error, I have come to the conclusion that this is not what I am looking for. So far however, all of the nodes I have experimented with referencing a skeletal mesh are equally as confusing. On the bright side, I have a small semblance of a calibration happening in game, although not entire noticeable if you're not looking for it.
                    I do not recommend using the input mapping system for skeletal animation, these are meant for normalized input akin to joystick movement. This is because the input mapping system have all their values normalized (to a range of 0-1.0), what you want to use instead are the raw values converted into UE space (giving that 1:1 feeling) which are emitted by the HydraInterface events and available in for polling from the HydraComponent. For this reason you should use the On Controlled Moved or polling (get latest data) to forward your controller positions (after calibrating to component space) to the IK targets in your animation graph. See earlier in the thread for concrete examples of how this was done.
                    Plugins: Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense

                    Comment


                      So I'm going to need more time to get some examples out, but I just recently got it to a point where it's working very nicely and I can touch my head and have it map basically 1:1. Unfortunately I'm using a lot of feel good variables to get it mapped to my height and reach.

                      Some improvements I want to make:

                      * Rotate the fingers a bit instead of the wrist for very small initial rotations away from the neutral pose (to emulate rotating the Hydra with the player's fingers, and prevent over-rotation of the wrist).
                      * Rotate the fore and upper arm as a percentage of the Hydra rotation, again to prevent over-rotation of the wrist and also allow for better skinning results.
                      * Create a real (no feel-good variables) mapping of player height/arm length to character height/arm length. One thing that's needed there is being able to get the Oculus profile height, though it could be faked during the Hydra calibration by just taking the Z value and adding some for the head height.
                      * Generally clean everything up and get it working in a nice fashion, and ported into the VR Game Template.

                      In the mean time, if you want to use FABRIK nodes (which I find give nicer results), just do a Make Transform and hook the Hydra position into it. The tip node will be the hand, the base node will be the upper arm (or whatever bone is above the forearm on your skeleton).
                      Storyteller - An immersive VR audiobook player

                      Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes

                      Comment


                        Originally posted by getnamo View Post
                        I do not recommend using the input mapping system for skeletal animation, these are meant for normalized input akin to joystick movement. This is because the input mapping system have all their values normalized (to a range of 0-1.0), what you want to use instead are the raw values converted into UE space (giving that 1:1 feeling) which are emitted by the HydraInterface events and available in for polling from the HydraComponent. For this reason you should use the On Controlled Moved or polling (get latest data) to forward your controller positions (after calibrating to component space) to the IK targets in your animation graph. See earlier in the thread for concrete examples of how this was done.
                        Okay I think I know what you're saying here. However, the other thing I'm having trouble figuring out is how to call the variables I have stored in my Animation Blueprint for the location/rotation of the left and right hands. If I try to get variables, either nothing happens or the variable I get only has a pin on the right side and I need it to be on the left. Here's what I have so far.

                        This is my Character Blueprint setup that I have so far for the Hydra

                        Click image for larger version

Name:	CharacterBlueprint.JPG
Views:	1
Size:	170.7 KB
ID:	1057992

                        And this is my Animation Event Graph (Detail of the Hydra setup)

                        Click image for larger version

Name:	AnimEventGraph.JPG
Views:	1
Size:	160.9 KB
ID:	1057993

                        I've also been researching what the difference is between Transforms in Bone Space and Transforms in World Space and so far, I have not been able to find any examples of what that difference is. There is plenty of documentation on this, but it's all written using the same type of vocabulary, and without seeing an example of what these terms are refering to, I'm afraid I don't quite understand which of these transform nodes I need. Do I need to Transform the bones FROM Bone space or TO bone space? Or do I do neither? I only grabbed these nodes because transforming bones seemed like a useful function for what I've been trying to do.
                        Last edited by aialexander; 10-20-2014, 05:12 PM.

                        Comment


                          @aialexander - You don't need to transform to bone space (or world space).

                          Your anim blueprint looks okay, assuming that the Shoulder Midpoint is being set during the calibration step (e.g., have it so the user presses start, then it calculates it - you'll want the user to be in a t-pose during this).
                          Storyteller - An immersive VR audiobook player

                          Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes

                          Comment


                            Yes, the calibration has been set to activate when the start button is pressed. So then how do I go about telling the character to move his hands if not by using a transform bone function?

                            Comment


                              Originally posted by aialexander View Post
                              Yes, the calibration has been set to activate when the start button is pressed. So then how do I go about telling the character to move his hands if not by using a transform bone function?
                              You're setting the hand positions and rotation's in your Anim Blueprint Event Graph - you use those variables in the Animation Graph with animation node (Two-Bone IK or FABRIK node). When you have the Anim Blueprint open, you'll see "Anim Graph" in the list of variables/functions, click it and it will open a new tab with the Anim Graph. That's where you modify the skeleton. The Transform To nodes just transform something into a different coordinate space (e.g., World coordinate space to bone coordinate space, meaning the positions are relative to the world's 0, 0, 0 origin or the skeleton, respectively).

                              Go back through the thread or my tutorial and find the graph that's labelled "Beggar Anim Graph" at the top (or whatever the other anim graphs shown were labelled). Anything with the Two-Bone IK node is going to be in the Anim Graph.
                              Storyteller - An immersive VR audiobook player

                              Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes

                              Comment


                                I've actually been referencing your screenshots that you posted earlier in the forum quite a lot. That's the only reason I was able to set up the Anim Graph to get to this point. I'm not sure if there was another tutorial of yours that you wanted me to look at but I did look at those images quite a bit. I understand that I was setting the position variables in the Anim Graph of the Animation Blueprint. What I was confused about was about how to reference those variables or get them from the Animation Blueprint to the Character Blueprint for the character that I would like to use. Are you saying that since I already have the Anim Graph set up this way that I don't need to call these position variables in the Character Blueprint? Would I call them in the Hydra controller instead?

                                The reason I am asking about the character Blueprint is because I noticed that there are always nodes present giving instructions to the character based on the input received from certain devices. I figured since the Hydra was an input device, that it only made sense that the character blueprint would need to set up some kind of instructions for the Hydra just like you would for the keyboard or a gamepad. If the Anim Graph is also a function that I can use in another graph, how do I call it? I've tried calling it both in the character blueprint and in the Hydra controller and have had no luck.

                                Comment

                                Working...
                                X