Announcement

Collapse
No announcement yet.

Patch for Vive Trackers support

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

    [VIVE] Patch for Vive Trackers support

    I made some changes in the default SteamVR module. I don't know if (or when) Epics approve my pull request, and this fix is important for developers using my Vive Mocap plugin, so I'd like to publish it here as a patch.

    List of changes:
    * bug fix: crash at the engine startup with 4+ Vive Trackers
    * bug fix: with 3+ Vive Trackers: any input event from the left motion controller cause crash
    * bug fix: Steam_Generic_Trigger, Steam_Generic_Touchpad, Steam_Generic_Grip, Steam_Generic_Menu events for Vive Trackers declared, but not initialized
    * bug fix: bad mapping of Vive Trackers to EControllerHand after turning off and on one of the trackers (multiple trackers could be mapped to the same Special_N key)

    Changes in sources: https://github.com/EpicGames/UnrealEngine/pull/4492

    This patch is only for Windows x64!
    Engine Version Link
    4.18.3 Download (now for packaging)
    4.19.0 Preview 5 Download
    4.19.0 Download
    4.19.1 Download
    4.19.2 Download
    4.20.0 Download


    How to install:
    1. Make sure UEngine isn't launched.
    2. Make a backup copy of the [Program Files\Epic Games\UE_[engine version]\Engine\Plugins\Runtime\Steam\SteamVR] folder!
    3. Copy with replace [SteamVR] folder from the archive to [Program Files\Epic Games\UE_[engine version]\Engine\Plugins\Runtime\Steam]

    Important! Input from Vive Trackers doesn't work with SteamVR Beta (v1.0.15). I can't fix it via SteamVR plugin only, because it's necessary to add support for the lastest OpenVR SDK (Engine\Source\ThirdParty\OpenVR) and to add actions manifest file which would affect all UE4 projects and the Editor itself.
    Last edited by YuriNK; 07-19-2018, 06:22 AM.
    Marketplace: Vive Mocap Kit / Fingers Solver / VR IK Body Solver / Subtitles to LipSync / Dialogue System with Character Animation
    And random stuff at Youtube

    #2
    So, this also works while using multiple Trackers? with 8 I'm still using 4.16.2, so if this works with 4.18.3 without crashes, well my friend, I owe you a beer
    ENTER REALITY

    VR Solutions

    Contact us for more informations

    Comment


      #3
      It should work with 8 trackers, yes. But I only have 4 to try.
      Marketplace: Vive Mocap Kit / Fingers Solver / VR IK Body Solver / Subtitles to LipSync / Dialogue System with Character Animation
      And random stuff at Youtube

      Comment


        #4
        Added: 4.19.0 Preview 5 version. Was tested with 4 and 6 trackers.

        By the way. Unfortunately, I don't see a plans for controllers input unification in the UE4 Roadmap. Does anybody interested in a patch for a whole VR system refactoring with unificated input from SteamVR and Oculus controllers (i.e. Touch, Vive wands and Knuckles) and support of discrete input from different Vive Trackers? My idea is to put this input to event deletages and functions inside of Motion Controller Component and send them from VR plugins via IMotionController/XRMotionControllerBase interface.
        Marketplace: Vive Mocap Kit / Fingers Solver / VR IK Body Solver / Subtitles to LipSync / Dialogue System with Character Animation
        And random stuff at Youtube

        Comment


          #5
          4.19.0 release version added. Still, only for Windows x64.
          Marketplace: Vive Mocap Kit / Fingers Solver / VR IK Body Solver / Subtitles to LipSync / Dialogue System with Character Animation
          And random stuff at Youtube

          Comment


            #6
            Originally posted by YuriNK View Post
            Added: 4.19.0 Preview 5 version. Was tested with 4 and 6 trackers.

            By the way. Unfortunately, I don't see a plans for controllers input unification in the UE4 Roadmap. Does anybody interested in a patch for a whole VR system refactoring with unificated input from SteamVR and Oculus controllers (i.e. Touch, Vive wands and Knuckles) and support of discrete input from different Vive Trackers? My idea is to put this input to event deletages and functions inside of Motion Controller Component and send them from VR plugins via IMotionController/XRMotionControllerBase interface.
            I wouldn't worry about input refactoring if I were you, OpenVR just overhauled input entirely in the .10 and .11 versions, so its likely that anything you change will get changed anyway by Epic when they start porting over to newer OpenVR binaries.

            Also your input idea kind of breaks the intended input methodology of the engine, not really sure that is a good idea, better to leave the inputs as global events.

            *Edit* They also upped the number of max tracked devices I believe in OpenVR .11
            Last edited by mordentral; 03-15-2018, 08:39 AM.


            Consider supporting me on patreon

            My Open source tools and plugins
            Advanced Sessions Plugin
            VR Expansion Plugin

            Comment


              #7
              Originally posted by mordentral View Post
              Also your input idea kind of breaks the intended input methodology of the engine, not really sure that is a good idea, better to leave the inputs as global events.
              It's not a good solution IMO. It requires a special set of events for every new tracked object. Motion Controller (R) Trigger, Motion Controller (L) Trigger, Motion Controller (Special 1) Trigger, Special 2, Special 3 and up to Special 11. And the same for grip, touchpad, fingers, face buttons. With new tracked devices from new VR companies they'll need more then hundred of events.

              And developers using Knuckles and Oculus Touch need to duplicate input handling for different systems which goes against the idea of unification.
              Last edited by YuriNK; 03-15-2018, 09:56 AM.
              Marketplace: Vive Mocap Kit / Fingers Solver / VR IK Body Solver / Subtitles to LipSync / Dialogue System with Character Animation
              And random stuff at Youtube

              Comment


                #8
                Originally posted by YuriNK View Post
                It's not a good solution IMO. It requires a special set of events for every new tracked object. Motion Controller (R) Trigger, Motion Controller (L) Trigger, Motion Controller (Special 1) Trigger, Special 2, Special 3 and up to Special 11. And the same for grip, touchpad, fingers, face buttons. With new tracked devices from new VR companies they'll need more then hundred of events.

                And developers using Knuckles and Oculus Touch need to duplicate input handling for different systems which goes against the idea of unification.
                You are still going to need separate global events unless you lock all input notifications to the motion controller component, which is pretty terrible. You can also use events as Actions instead of button events and just rebind the calling button (ie: action_grip, rebind as trigger / grip based on platform). There is also some attempts at the SDK level to abstract input and the XR layer should end up handling it in the end.

                Better to keep the global inputs but with a "tracked device ID" attached to it and the capability of setting input events tied to a specific id.


                Regardless 12 trackers all adding button inputs is a use case that isn't ever going to be needed except by extreme outliers, who can re-factor input themselves to accommodate for it.

                *Edit* Even if you move input into the controllers, how are you going to keep it from bloating there too? You'll have it easier in device by device events, but now you still have to support Oculus specific inputs and Knuckles capacitive inputs and other manufacturer input events. It still ends up being a platform by platform configuration, except with less flexibility since you don't have re-binding and have the un-used events sitting in there.

                Don't get me wrong, current input is a mess and far from ideal, but I'm not sure that is the solution.
                Last edited by mordentral; 03-15-2018, 10:23 AM.


                Consider supporting me on patreon

                My Open source tools and plugins
                Advanced Sessions Plugin
                VR Expansion Plugin

                Comment


                  #9
                  Originally posted by mordentral View Post
                  Better to keep the global inputs but with a "tracked device ID" attached to it and the capability of setting input events tied to a specific id.
                  Is it possible now?

                  Originally posted by mordentral View Post
                  Regardless 12 trackers all adding button inputs is a use case that isn't ever going to be needed except by extreme outliers, who can re-factor input themselves to accommodate for it.
                  Idea to prodive a full support for some input devices and incomplete support for absolutely similar devices is werid.

                  Originally posted by mordentral View Post
                  Even if you move input into the controllers, how are you going to keep it from bloating there too? You'll have it easier in device by device events, but now you still have to support Oculus specific inputs and Knuckles capacitive inputs and other manufacturer input events. It still ends up being a platform by platform configuration, except with less flexibility since you don't have re-binding and have the un-used events sitting in there.
                  VR-plugins could be responsible for binding their custom button events to unified keys.

                  ed. To be clear: For me it's more or less theoretical discussion, I don't have any plans like this. But I do think that tons of events - wrong solution.
                  Last edited by YuriNK; 03-15-2018, 10:28 AM.
                  Marketplace: Vive Mocap Kit / Fingers Solver / VR IK Body Solver / Subtitles to LipSync / Dialogue System with Character Animation
                  And random stuff at Youtube

                  Comment


                    #10
                    Originally posted by YuriNK View Post
                    Is it possible now?
                    Yes, the input key structure would just have to have an id given, possibly a secondary list for tracked devices to not bloat the primary one.

                    Originally posted by YuriNK View Post
                    Idea to prodive a full support for some input devices and incomplete support for absolutely similar devices is werid.
                    You are talking about up to 14 input devices at once, that is as far outside of standard requirements as you are going to get.
                    It would almost be better to support trackers specifically in a component like that.

                    Originally posted by YuriNK View Post
                    VR-plugins could be responsible for binding their custom button events to unified keys.
                    Which is what they currently do...just with some per plugin overlap that can be fixed up.

                    *Edit* Dunno, its a mixed bag when dealing with something like this, but I wouldn't want all input events routed through the motion controllers for the controllers themselves.
                    Last edited by mordentral; 03-15-2018, 10:39 AM.


                    Consider supporting me on patreon

                    My Open source tools and plugins
                    Advanced Sessions Plugin
                    VR Expansion Plugin

                    Comment


                      #11
                      Originally posted by mordentral View Post
                      You are talking about up to 14 input devices at once, that is as far outside of standard requirements as you are going to get.
                      It would almost be better to support trackers specifically in a component like that.
                      Not 14 devices. All vive trackers now generate the same events and devs can't separate input from first and second tracker. Unreal supports - in theory - 11 trackers, developers I know use up to 8 (some probably more, I don't know), but there is no separate input from trackers at all. If I understand you correctly, you suggest to add events for a reasonable number of trackers. But it's kinda weird to have events for tracker #3 and don't have events for #4.
                      Marketplace: Vive Mocap Kit / Fingers Solver / VR IK Body Solver / Subtitles to LipSync / Dialogue System with Character Animation
                      And random stuff at Youtube

                      Comment


                        #12
                        Originally posted by YuriNK View Post
                        Not 14 devices. All vive trackers now generate the same events and devs can't separate input from first and second tracker. Unreal supports - in theory - 11 trackers, developers I know use up to 8 (some probably more, I don't know), but there is no separate input from trackers at all. If I understand you correctly, you suggest to add events for a reasonable number of trackers. But it's kinda weird to have events for tracker #3 and don't have events for #4.
                        No, I suggested either a dedicated component for the dedicated hardware or an extension to the global input mappings to handle arrays of tracked device inputs.

                        Just not routing all tracked device input events through a component base, would make Player controller / character input handling really unwieldy.

                        It could also be done with dynamic mapping to events.
                        Last edited by mordentral; 03-15-2018, 10:51 AM.


                        Consider supporting me on patreon

                        My Open source tools and plugins
                        Advanced Sessions Plugin
                        VR Expansion Plugin

                        Comment


                          #13
                          Originally posted by mordentral View Post
                          No, I suggested either a dedicated component for the dedicated hardware or an extension to the global input mappings to handle arrays of tracked device inputs.
                          It makes sence.

                          Ed. Can't find any input events with int parameter.
                          Last edited by YuriNK; 03-15-2018, 10:58 AM.
                          Marketplace: Vive Mocap Kit / Fingers Solver / VR IK Body Solver / Subtitles to LipSync / Dialogue System with Character Animation
                          And random stuff at Youtube

                          Comment


                            #14
                            Thank you for putting together this patch!

                            It seems to work as a workaround for avoiding the editor crash that i am getting in 4.18.3 when trying to work with 2 motion controllers and 4 vive trackers.
                            ( See my bug report under: https://answers.unrealengine.com/que...n-6th-tra.html )

                            However, if i run a ( development ) build of the project, it still crashes on turning on the 6th lighthouse tracked device, with the following error:

                            Assertion failed: Key.IsValid() [File:\Build\++UE4+Release-4.18+Compile\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp] [Line: 6103]

                            Is this known/expected? Does the patch only fix the Editor crash, or is it supposed to also prevent the too-many-vive-trackers crash in a build version, too?


                            Comment


                              #15
                              GAMECHANGER
                              Yes, I know about that. Patch for 4.19 works in packaged projects.

                              Ed. The bug was already submitted, see https://issues.unrealengine.com/issue/UE-54387
                              Last edited by YuriNK; 03-21-2018, 01:36 PM.
                              Marketplace: Vive Mocap Kit / Fingers Solver / VR IK Body Solver / Subtitles to LipSync / Dialogue System with Character Animation
                              And random stuff at Youtube

                              Comment

                              Working...
                              X