Announcement

Collapse
No announcement yet.

Tyre Change in VR with the HTC Vive -ASSEMBLY TRAINING-

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

    [VIVE] Tyre Change in VR with the HTC Vive -ASSEMBLY TRAINING-

    Hey guys,

    I'm a beginner in UE4 and having some issues doing a VR project in university. The task is to do a tyre change in VR with the HTC Vive. I really hope someone of you can help me to get the right direction how to do it. I have built an environment and imported all the necessary models.

    This should be the steps:

    Pick up the impact wrench and attach it to the hand in the right position (trigger should still be used for 'picking up' the screws):


    Release the screws of the wheel with the impact wrench attached to the hand mesh:


    Lay down the impact wrench and 'pick up' the wheel using only the hands:


    Take a new wheel and let it snap on the right position on the wheel hub and the same thing with the screws to reassemble the whole structure.

    Does anyone of you have an idea how to solve my problems? I would be very very thankful because I could finally start my Bachelor thesis when this project is done.

    Thanks in advance and greetings from Germany.

    Ralf

    #2
    Hey Ralf,

    You have to break it down in simple steps and tackle one at the time. I'll give you some pointers like I would do with my students, but for ethical reasons I can't solve it for you. You have to get through it yourself.
    • To pick up the wrench you can use the same logic of the Pickup Cubes in the standard VR template. As a matter of fact you can duplicate the Pickup Cube BP, edit it to replace the cube mesh with the wrench mesh and it will work. You may have to adjust a bit its position on the hand to make it look good. Using a socket may be the way to go in this case.
    • Next you need to add some logic to detect when the tip of the wrench is close to a bolt on the wheel and enable the wrench to undo that bolt when you press the trigger. Collision components (sphere, box or capsule) are your friends here. Overlap events is what you should work with.
    • The wheel should also be a grabbable actor like the wrench. But it should only be grabbable when all the bolts have been taken out. You can count how many bolts you have taken out and when all of them are off you can "tell" the wheel that it can be grabbed. Then you can grab the wheel and take it away.
    • To put on the new wheel you follow the opposite process.
    To realize all this in the easiest possible way you need to understand basic Blueprint to Blueprint communication via events or interfaces. This official doc can get you started, but there are many YouTube tutorials you may want to watch.

    https://docs.unrealengine.com/latest...intCommsUsage/

    Not the easiest topic if you just got started with UE4. In case feel free to ask again here. I am sure your teacher/assistant will also be able to help you.

    MfG,
    Marco
    CTO | Head of VR Development - Visit us at http://humanxr.com
    My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

    Comment


      #3
      Hey Marco,

      at first thank you very much for your help. I‘m not totally new to UE4 because I did a little project (only a small car showroom) before. So I understand the basics of BP to BP communication. My teacher can not really help me because I’m the first one using UE4 at our institute for CAD. I’m studying Automotive Engineering and we just Start with topics like that. The way you described it sounds very good. I can totally understand the ethical reasons But I still have some questions:

      1. If I use the logic of the Pick Up Cube I have to pull the trigger to pick it up. But when I release the trigger the wrench will fall off my hand. How can I fix it to the hand to use the trigger for some other actions then? And how can I release that attachment to have my hands back again to pick up the wheel. Your video on YouTube „Two hands shotgun handling“ is a good example I think. What did you mean with ‚using a socket‘?

      2. Which BP can I use to detect if all bolts are released? Do I need the PickUp Cube logic for the bolts too? Or should they only be moveable? What about the ‚Simulate Physics‘ checkbox on all the parts?

      3. When I get the new wheel how can I handle it to snap at the right position on the hub? (Same for the bolts) Is a collision box which, when overlapped with the wheel, getting it in a physical constraint the right way?

      I hope these are not too much questions Your videos on YouTube are amazing. Wish I could do VR development like that.

      Thanks in advance.

      MfG

      Ralf

      Comment


        #4
        Ok, looks like you may need a bit more help than I thought, so here it goes.

        Originally posted by Aapeminsch View Post
        1. If I use the logic of the Pick Up Cube I have to pull the trigger to pick it up. But when I release the trigger the wrench will fall off my hand. How can I fix it to the hand to use the trigger for some other actions then? And how can I release that attachment to have my hands back again to pick up the wheel. Your video on YouTube „Two hands shotgun handling“ is a good example I think. What did you mean with ‚using a socket‘?
        The standard VR template uses the Trigger for grabbing (mostly for compatibility between the different head-sets), but you can change that easily. Since you are using the Oculus, you can use the Grip1 for grabbing and object and still have the Trigger available to operate the wrench. Do this: go to Edit --> Project Settings --> Input. Under Action Mappings, look for Grab Left and Grab Right. Open the two actions. You will see they are mapped to the MotionController (L) Trigger and MotionController (R) Trigger respectively. In the drop down, change them to use MotionController (L) Grip1 and MotionController (R) Grip1. Close the window. With that, you will be able to pickup objects pressing and holding the Grip button instead of the Trigger. Unless you modified something, you will hold the grabbed object as long as you keep the grip pressed.

        A socket is a special "bone" you place on a skeletal mesh (your VR hand) which you can use to finely control where you will be attaching something to it. It is commonly used to attach weapons etc. to the hands and for a lot more. For the moment forget about using sockets unless necessary. It will work anyway as long as you pick up the wrench properly. We may fix this later.

        Originally posted by Aapeminsch View Post
        2. Which BP can I use to detect if all bolts are released? Do I need the PickUp Cube logic for the bolts too? Or should they only be moveable? What about the ‚Simulate Physics‘ checkbox on all the parts?
        Each Bolt should have an own Blueprint, so you can detect when they overlap with the wrench and if the wrench is activated. If during the overlap the wrench is activated long enough (say 2 seconds) then the bolt is undone and you can activate its physics so it will fall to the floor. What you will also do when a bolt is undone is to increase a counter variable which counts how many bolts have been undone, so you know when the wheel is free to be taken out. I think that a good place for this variable would be in the blueprint of the wheel itself. So basically the wheel knows by how many bolts it is currently held in place and, if it reaches zero, it knows it is free to move / be taken away (you will make it grabbable). Same for the reverse operation when you place on the new wheel.

        Probably you need the bolt BP to implement a pickup logic as well because later on you need to pick up the bolts to place in the new wheel. Honestly this is an extra level of complication which you may want to avoid if possible. Ideally you want to pickup the fallen bolts with the tip of the wrench, ready to fasten them on the new wheel. It depends on how realistic you want to make it.

        Originally posted by Aapeminsch View Post
        3. When I get the new wheel how can I handle it to snap at the right position on the hub? (Same for the bolts) Is a collision box which, when overlapped with the wheel, getting it in a physical constraint the right way?
        Yes, you need to work with SceneComponents and collision volumes. The collision volume detects the overlap and then you use the position of the scene component as a reference to snap (SetActorLocation) the wheel or the bolt into place.

        My recommendation is that you try to build the single behaviors first, then assemble them together in one flow. Think also about this. You can have different BP for different states of the same actor. For example, one for the bolt when it is on the wheel and falls off when you undo it and another one for the bolt that you pick up and place back on the wheel. When the bolt falls to the floor, you "swap" it with the other one, so the player believes it is the same bolt, but behind the scenes it is a different one with a different behavior. However they look exactly the same.

        Same goes for the wheels. The one you take down may have a different blueprint than the one you put back on, so they implement different logic and different behaviors.

        Hope this helps!

        Start building a prototype and let's take if from there.
        CTO | Head of VR Development - Visit us at http://humanxr.com
        My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

        Comment


          #5
          Hey Marco,

          thank you so much for investing that much time helping me.

          Comment


            #6
            That all sounds very good and comprehensibly. I will start working on that prototype on Friday because I had/have to work today and tomorrow. I‘m working with a Vive...so are the settings for the Action Mappings the same there. I‘ll try your advices and write again if I‘m getting into issues.

            Thank you and have a nice evening.
            Last edited by Aapeminsch; 01-31-2018, 05:07 PM.

            Comment


              #7
              Oh, I see, sorry. For some reasons I thought you were using the Oculus. Anyway, it should work exactly the same with the Vive. The input names are also the same as I indicated above.
              CTO | Head of VR Development - Visit us at http://humanxr.com
              My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

              Comment


                #8
                Ok that‘s good. The only problem is that I need the Grip Buttons for the teleport.

                Comment


                  #9
                  Originally posted by Aapeminsch View Post
                  Ok that‘s good. The only problem is that I need the Grip Buttons for the teleport.
                  OK but then you have to make a choice depending on which functionality is most used and the overall interaction with your experience.
                  CTO | Head of VR Development - Visit us at http://humanxr.com
                  My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

                  Comment


                    #10
                    Aapeminsch Just checking in. How is your project coming along?
                    CTO | Head of VR Development - Visit us at http://humanxr.com
                    My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

                    Comment


                      #11
                      Hey vr_marco ,

                      I had to write my last two exams, so it lasts a little longer than I thought. But here is the current state of my project:

                      I've merged the different parts of the wrench to one, so I could use the logic of the PickUp Cube and did the same for the rim and the tire. For each bolt I used the PickUp logic too. For the wheel and the bolts I deactivated the 'Simulate Physics' checkbox because the parts felt down by starting the preview. Is that all right or do I have to use 'normal' BP's for the bolts?



                      I also watched some tutorials for using sockets and tried to apply it to my project but I'm not sure if it's right and working because my university is closed for the days of Cologne carnival and I have no HMD at home to try. Here's what I did:

                      1. I added a socket to the VR Mannequin mesh of the hand





                      undefined

                      2. I made an own BP for the merged wrench and put it into the level





                      Am I on the right way doing it like this?

                      The next steps will be to build the BP's for picking up the bolts with the wrench, laying down the wrench, picking up the wheel etc.
                      But I'm not really sure how to do that all (for example the counter of the 5 bolts to set the wheel 'pickupable').
                      I will try some things and let you know if I did that with some new screenshots.

                      Thank you very much.

                      MfG

                      Ralf

                      Comment


                        #12
                        Hey vr_marco ,

                        Because it’s not that important how realistic the tyre change works and to make it maybe more easier, here’s again a short overview of the steps I want to realise during the assembly:
                        1. Teleport to the tool car by using the Grip Button (already included in the VR Template).
                        2. By colliding the hand with the wrench, the wrench should be attached to the hand with a socket so I can use the trigger to grab the bolts with the tip of the wrench and let them fall on the tool car or somewhere else by releasing the trigger.
                        3. If all bolts are undone I want to put back the wrench on the tool car so I can use the hands to grab the wheel and put it on the floor.
                        4. Then grab a new wheel and put it on the hub in the right position/location.
                        5. Again colliding the wrench with the hand to attach it to the hand.
                        6. Using the left hand to grab the bolts and put them on the tip of the wrench to put them back on the wheel. (If it’s easier only using the tip of the wrench to grab the bolts will be ok too)
                        7. Again put the wrench on the tool car…ready

                        How about using sockets again to attach the bolts to the tip of the wrench by overlapping a collision sphere of the bolts and pulling the trigger of the Motion Controller and releasing the socket of the bolt by colliding a little sphere on the tool car and releasing the trigger to let the bolt fall on the tool car? Is that a possible way to handle it?

                        Is it easier that way? It should just be a training of the different steps of a tyre change to expand on other applications of repairing a car later.

                        MfG

                        Ralf
                        Last edited by Aapeminsch; 02-11-2018, 09:53 AM.

                        Comment


                          #13
                          HiAapeminsch sounds like a good plan to me! You don't necessarily need to use sockets to attach the bolts to the wrench, you can simply attach them as subcomponents and then adjust their relative location and rotation. Using a socket is cleaner though.

                          You should be able to pull your project off by remembering that a BP car react as needed to an input or action, based on its state. Take you wheel for example. It can have an attached state (bIsAttached) and on that basis you can switch on or off its physics or decide whether it reacts to a Grab/Pickup event or not. Think in terms of objects, properties and behaviors. The rest should follow.

                          Happy anyway to help you further here in case you get stuck.

                          Cheers,
                          Marco.
                          CTO | Head of VR Development - Visit us at http://humanxr.com
                          My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

                          Comment


                            #14
                            Originally posted by Aapeminsch View Post
                            Hey vr_marco ,

                            Am I on the right way doing it like this?

                            The next steps will be to build the BP's for picking up the bolts with the wrench, laying down the wrench, picking up the wheel etc.
                            But I'm not really sure how to do that all (for example the counter of the 5 bolts to set the wheel 'pickupable').
                            I will try some things and let you know if I did that with some new screenshots.
                            One remark. I don't see why the bolts should have a different BP each. There is no reason for that since they should all behave in the exact same way and should be interchangeable. You should have 1 bolt BP with 5 or 6 instances of it in your level.

                            The rest looks pretty ok to me so far. Keep up with the good job!
                            CTO | Head of VR Development - Visit us at http://humanxr.com
                            My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

                            Comment


                              #15
                              Hey vr_marco ,

                              I can not thank you enough but I'm still struggling with some issues I don't really understand or don't know the name of the most BP's. I made a short list with my questions and I hope you can help me again

                              Wrench
                              • Overlapping collision sphere of the wrench attaches the wrench to the hand with socket.
                                • Are both hands possible? Because there is only the right hand in the Mannequin BP.
                              • Overlapping the collision sphere next to the wrench should detach the wrench from the hand.
                                • Generate an Overlap Event in Level Blueprint? How can I cast to the wrench to detach it from the hand?/What is the target?
                                • Is it possible to pick up the wrench again? Because it`s in the green collision sphere then.
                                • How can I set the physics for the wrench to put it down on the tool car?






                              Bolts
                              • Grabbing the bolts with the attached wrench by pulling the trigger and putting them down on the tool car by releasing the trigger?
                                • Is the simple PickUp_Cube logic sufficient in this case?
                                • How can I ensure that only the hand with the attached wrench can grab the bolts?
                                • How can I adjust the position of the bolts to the tip of the wrench?



                              Wheel
                              • Wheel should be grabbable when all five bolts are undone.
                                • Is here the simple PickUp_Cube logic sufficient or do I have to build an own BP for the wheel?
                                • How do I have to build the „countdown“ for the 5 bolts? Using a variable?
                                • How can I ensure that the wheel can only be grabbed with both hands and if the wrench is detached? (more realistic)
                                • How can I handle it to snap the wheel in the right position when reassembling it to the hub? Using a collision sphere again? Same for the bolts. (Level Blueprint or wheel/bolt Blueprint?)

                              I know these are many questions but I'm really trying to make as good as I can to have the chance to write my Bachelor Thesis at the institute where I'm doing this project.

                              Thanks a lot in advance.

                              Viele Grüße

                              Ralf
                              Last edited by Aapeminsch; 02-14-2018, 02:46 PM.

                              Comment

                              Working...
                              X