Announcement

Collapse
No announcement yet.

Razer Hydra Plugin

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

    #46
    Updated it to 4.2, grab the latest plugin and replace the plugins folder in your project.

    Unfortunately I haven't had the time to fix the Shipping Build compilation (it seems shipping builds absorbs the plugin in some way, and may need conditional compilation) and Input mapping is still on the roadmap. If you can help with either of those, by all means please contribute!
    Plugins: GES - Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo

    Comment


      #47
      Thank you so much. You get a plug on my new blog

      http://wp.me/p4El8g-3
      Stygian Abyss Demo VR Remake

      http://mrob76u.wordpress.com/

      Comment


        #48
        Originally posted by Mrob76u View Post
        Thank you so much. You get a plug on my new blog

        http://wp.me/p4El8g-3
        Awesome project. I remember seeing that avatar video earlier and thinking how you nailed the execution for hydra/rpg controls, especially the bow. Looking forward to your progress
        Plugins: GES - Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo

        Comment


          #49
          Thanks getnamo, I'm nearly there using your plugin to get the same system working in UE4. keep an eye on the blog for updates.
          Stygian Abyss Demo VR Remake

          http://mrob76u.wordpress.com/

          Comment


            #50
            very rare crash

            Hey gitnamo just had a couple of crashed over the last few days while using your plugin. It is very very rare so no urgency just thought I would post this here just in case it helps you out.

            !Id:58d7873d7b3b01c658a9d3bc93ef72db

            Access violation - code c0000005 (first/second chance not available)

            UE4Editor-HydraPlugin.dll

            UE4Editor_HydraPlugin + 14955 bytes
            UE4Editor_HydraPlugin + 10339 bytes
            UE4Editor_HydraPlugin + 19063 bytes
            UE4Editor_Engine + 6055491 bytes
            UE4Editor_Engine + 1656563 bytes
            UE4Editor_Engine + 8617942 bytes
            UE4Editor_Engine + 8688548 bytes
            UE4Editor_Core + 462146 bytes
            UE4Editor_Core + 462589 bytes
            UE4Editor_Core + 524839 bytes
            UE4Editor_Engine + 9015033 bytes
            UE4Editor_Engine + 8917088 bytes
            UE4Editor_Engine + 8960756 bytes
            UE4Editor_Engine + 5129510 bytes
            UE4Editor_Engine + 5156650 bytes
            UE4Editor_Kismet + 2840943 bytes
            UE4Editor_UnrealEd + 1465656 bytes
            UE4Editor_UnrealEd + 5375494 bytes
            UE4Editor!FEngineLoop::Tick() + 3555 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.2\engine\source\runtime\launch\private\launchengineloop.cpp:2091]
            UE4Editor!GuardedMain() + 476 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.2\engine\source\runtime\launch\private\launch.cpp:132]
            UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.2\engine\source\runtime\launch\private\windows\launchwindows.cpp:125]
            UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.2\engine\source\runtime\launch\private\windows\launchwindows.cpp:207]
            UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]
            Also thought I would let you know that I now have the arms working as I had them before in unity so thanks very much for the plugin. Will be an update and video on my blog soon.
            Stygian Abyss Demo VR Remake

            http://mrob76u.wordpress.com/

            Comment


              #51
              Care sharing what axis setup was like on your arms and what, if any, conversions you did to the rotational data to get it to work properly? Did you have to play with the order of the axis rotation is applied to? I am having a bit of trouble with this as my hands act strangely when I cross 90 degrees on certain axis. How I ended up solving this was doing rotation in world space and adding an offset.
              Last edited by BlackFangTech; 06-20-2014, 11:42 AM.

              Check out my discord -> https://discord.gg/kQdVwJ3

              Follow us on twitter to get updates on new products and special offers -> https://twitter.com/BlackFangTech

              Black Fang Technologies' products -> https://www.unrealengine.com/marketp...20Technologies

              Comment


                #52
                Yeah had a few problems with rotation on the hands. This is the offsets and rotations applied to each hand. Not sure if it will be the same for you. Hope it helps

                Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	108.7 KB
ID:	1052099
                Stygian Abyss Demo VR Remake

                http://mrob76u.wordpress.com/

                Comment


                  #53
                  @Getnamo (or anyone who knows), does the Sixense library give the position of the controllers back relative to the base station?

                  If so, how are you transforming them to the game's worldspace? Or do you make assumptions about where the position is relative to the hand?

                  I'm trying to figure out how to go about utilizing the positions of the PS Move controllers once I've got my plugin for them working (thanks btw Getnamo, I used your plugin as a base ).
                  Storyteller - An immersive VR audiobook player

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

                  Comment


                    #54
                    Originally posted by n00854180t View Post
                    @Getnamo (or anyone who knows), does the Sixense library give the position of the controllers back relative to the base station?

                    If so, how are you transforming them to the game's worldspace? Or do you make assumptions about where the position is relative to the hand?

                    I'm trying to figure out how to go about utilizing the positions of the PS Move controllers once I've got my plugin for them working (thanks btw Getnamo, I used your plugin as a base ).
                    The library reports back the distance from the base in mm for all three axis, Edit: but this is automatically converted in the plugin to UE format (where 1uu = 1cm by default). Typically you would want to use a calibration point to capture the length of a player's arms/etc to line your model up with any player that uses it. For example I use a T-pose to capture both the height of the shoulders and the arm separation in Skycall, and feed that back to keep the player flapping in sync with the bird model.

                    I'm unfamiliar with PS Move but the Hydra is pretty unique in that you get true 6-axis position and you derive velocity and acceleration rather than typical inertial motion controllers where the reverse is true (and quickly becomes inaccurate). You may want to look into what gets actually reported by the move controller and what its limitations may be.
                    Last edited by getnamo; 08-02-2014, 04:12 PM. Reason: accuracy: plugin now reports back position in cm from base
                    Plugins: GES - Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo

                    Comment


                      #55
                      Thanks Getnamo, I sort of figured that might be the case.

                      The Move can indeed support proper position and rotation without having to do derivation and stuff yourself, if it has the tracking camera enabled. I've run into some issues getting it all to work on 64bit, but I'm going to keep at it.

                      In the mean time I'm also trying to pick up a Hydra and use that to get things set up more rapidly for my game.

                      Any chance you could give an example of your calibration setup for the Hydra in your game?
                      Storyteller - An immersive VR audiobook player

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

                      Comment


                        #56
                        This is UScript (UDK) I've yet to update it but the principle is the same:
                        Code:
                         local float xOffset, yOffset;
                            
                            //Offsets, take the average Z and X position to set the base offset
                            HydraBaseHeightinCM = -1 * (RazerInput.LeftHandPosition.Z + RazerInput.RightHandPosition.Z)/2;
                            xOffset = -1 * (RazerInput.LeftHandPosition.X + RazerInput.RightHandPosition.X)/2;
                            yOffset = -1 * (RazerInput.LeftHandPosition.Y + RazerInput.RightHandPosition.Y)/2;
                            
                            //Player Vector offset (center point)
                            HydraPlayerOffset.X = xOffset;
                            HydraPlayerOffset.Y = yOffset;
                            HydraPlayerOffset.Z = HydraBaseHeightinCM + 40;
                            
                            //Wing Separation
                            ArmLength = VSize(RazerInput.LeftHandPosition-RazerInput.RightHandPosition);
                            ArmLengthFactor = 161/ArmLength;
                        The function is called when a player is in a T-pose, which captures the base offset, the player center point (shoulders for flight), and the player wing separation.
                        Plugins: GES - Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo

                        Comment


                          #57
                          Looking forward to new version for 4.3 Thanks very much.
                          Stygian Abyss Demo VR Remake

                          http://mrob76u.wordpress.com/

                          Comment


                            #58
                            Originally posted by Marc Audy View Post
                            Really great work, very excited to see people integrating technologies like this in to UE4.



                            This was one of the things I was wondering about as well. If you're interested in extending the plugin to implement the input system integration I'd be happy to help point you in the right directions.

                            One of the intentions of the way that FKey references inputs by FName is that adding new inputs in a plugin should be straightforward, however, it does not have a plugin based consumer of the API that I'm aware of yet.

                            The first step would be to call EKeys::AddKey for each of the new keys, probably as part of your module initialization. Then in your module you would need a tickable object, potentially using FTickableGameObject which pumps calls to FSlateApplication. Probably OnControllerAnalog, OnControllerButtonPressed/Released, and possibly OnMotionDetected, though I'm imagining there is some work that needs to be thought out about how to make the motion functions work with the two controllers.
                            I'm looking through this part right now to make the plugin support input mapping, I think I understand the initialization part but I haven't managed to narrow down what function needs to be called to update the axis value when the value has changed or a button has been pressed. I see no references to FSlateApplication. Could you point out what I need to call to update the mapping values?
                            Plugins: GES - Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo

                            Comment


                              #59
                              Originally posted by getnamo View Post
                              I'm looking through this part right now to make the plugin support input mapping, I think I understand the initialization part but I haven't managed to narrow down what function needs to be called to update the axis value when the value has changed or a button has been pressed. I see no references to FSlateApplication. Could you point out what I need to call to update the mapping values?
                              If you search the code you'll find many examples of FSlateApplication::Get() to get you the slate application, from there you can call the appropriate function to route your axis through. I think the best bet is OnControllerAnalog which can take an FKey for the axis and the current AnalogValue. It also takes a ControllerId, which I think, probably makes the most sense to just pass 0 as the first controller.

                              Comment


                                #60
                                Originally posted by Marc Audy View Post
                                If you search the code you'll find many examples of FSlateApplication::Get() to get you the slate application, from there you can call the appropriate function to route your axis through. I think the best bet is OnControllerAnalog which can take an FKey for the axis and the current AnalogValue. It also takes a ControllerId, which I think, probably makes the most sense to just pass 0 as the first controller.
                                Yep that did it, but I have to say quite a few of the details are still undocumented and convoluted. E.g. needing to #define LOCTEXT_NAMESPACE "(subcategory)",
                                including "Slate.h", and adding InputCore and Slate to your plugin module build settings. In addition to that any controller id apart from 0 doesn't work (does it assume a second player?) and the Plugin Actor derived classes can't seem to forward key Events (I'm guessing this has to do with the input chain as a Controller derived class does forward them).

                                But hey you learn the standards only once


                                Plugin V0.6, UE4.3
                                Thanks to Marc's hints, the plugin has now been updated to support Input Mapping!

                                Example usage in the third person template:


                                You can find these settings under Edit->Project Settings->Engine->Input. You can use key events in addition to the standard hydra events from a HydraPlayerController derived blueprint. This makes adding hydra support to any project a breeze, but the input mapping events do not include integrated or historical data. If you want to do manual gesture detection or more involved input manipulation I still recommend using blueprint events or the C++ delegate.
                                Feedback is always welcome, let me know if you find any bugs!

                                Input Mapping Hints:
                                -Motion is defined as a -1.0 to 1.0 scale for each axis. The range is capped at 2 meters from the base to provide fuller range, you may need to scale this value if you're using it as motion input rather than 1:1 world mapping.
                                -Rotation is scaled to -1.0 to 1.0 in each axis, again to provide snappier input you may need to scale the values.
                                -Joystick Trigger emits both its axis value and a 'click' defined by value >=0.5

                                Leftover Todo:
                                -Shipping build fix via conditional build (shipping builds seem to swallow the plugin into project code, unsure of best practices)
                                Attached Files
                                Last edited by getnamo; 08-04-2014, 09:04 PM.
                                Plugins: GES - Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo

                                Comment

                                Working...
                                X