Announcement

Collapse
No announcement yet.

Razer Hydra Plugin

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

  • replied
    @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).

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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).

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    @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.

    Leave a comment:


  • replied
    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!

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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?

    Leave a comment:


  • replied
    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.

    Leave a comment:


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

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    By the way, this may be slightly off topic, but would anyone be able to tell me what a poseable mesh is or how to go about creating one in Unreal? While reading a tutorial for the leap motion, I noticed this was one of the components, but I could not find any reference to what this would be in any of the Unreal documentation or forums.

    Leave a comment:


  • replied
    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.
    Last edited by aialexander; 10-17-2014, 02:53 PM.

    Leave a comment:


  • replied
    Updated plugin to v0.7
    -Updated to UE4.5
    -New Component based system using interfaces; now able to extend any
    blueprint class to have a Hydra component and receive the HydraInterface
    events! See readme or unreal thread for details.
    -All events now emit a UHydraSingleController, allowing for easy probe
    of additional data at the event state.
    -Some compatibility may be broken, but old style C++ extension is still
    possible using the old delegate (still retained). New style C++ plugin
    extension leads to less code, see convenience actor for details.

    Component Based System
    This method works by adding a Hydra Component and then subscribing to the events by adding a HydraInterface to your interfaces in your blueprint class. Both parts are required for you to receive hydra events.

    Setup
    Open the blueprint you wish to receive hydra events.

    Add the Hydra Component to your blueprint through method 1 or 2.

    (Option 1) Add component directly


    (Option 2) Add component through event graph


    To receive events we now have to add an interface. Click on Blueprint Props and under Details find 'Add' under interfaces. Add the HydraInterface.


    How to Use

    You can get any of the HydraInterface events by right clicking on the event graph and typing 'Hydra events'


    An event will emit when the action occurs, giving all relevant data in context as pins in the node. You can filter the events by hand using Is x Hand function on the controller output.


    The controller pointer is emitted for every relevant event, allowing you to conveniently access other variables you may be interested in that context. This removes the need to poll for most cases.


    If you need to access past frames you can do so by querying your HydraComponent. The plugin stores the last 10 frames for use i.e. gesture recognition. The controllerId refers to each single controller, 0 or 1 is a valid input. You can also manually check if your hydra is available. Should the state change it will also emit an event since the plugin supports hot plugging.



    Feedback is always welcome, seeing as this might break a few things, let me know if this setup makes things easier or harder for you

    Edit:
    Update to 0.7.1
    -Synced folder layout with other plugins. To install you now need to copy both Binaries and Plugins for future plugin updates.
    -Added support for 32bit shipping build, for either packaged or shipping build copy only the Binaries folder after packaging has been complete. See github instructions for details
    Last edited by getnamo; 10-18-2014, 04:42 PM.

    Leave a comment:

Working...
X