Announcement

Collapse
No announcement yet.

[Plugin] Leap Motion - Event Driven

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

  • replied
    Just created a First Person Blueprint and added the Leap Event Interface to the Character with a Stabilized Palm Position pointing to a Debug Sphere.
    After 60 seconds it crashed.
    Attached Files

    Leave a comment:


  • replied
    I was working through this thread last night and encountered the same crash after 60 seconds that some of you are getting. It turns out that when following the instructions at the top of the thread (step 5), I had added the leap component in both the component tab AND in the event graph, instead of just doing one or the other. Simply removing the leap component from the component tab fixed the crash for me.

    Leave a comment:


  • replied
    Originally posted by Joe1029 View Post
    Hey getnamo since you're a programmer I assume you understand the leap API well enough. I've been looking at the best way to get the rotation data and give that to the hand bone. I've been using palm normal and direction but my understanding is that the hand bone rotates at the wrist while the leap is grabbing the rotation from the center of the palm, is there a way to correct this?
    NB: Rotation is location independent, you can easily use the palm orientation (and this is what you are looking for) and use it to rotate the wrist bone in your skeleton.

    Out of curiosity I took a look at this. Referring to the Leap API you can see that there are the two vectors reported that are relevant (as you mentioned). These are palmNormal() and direction(). Now one way you can get your orientation is by doing the following:
    Code:
        float pitch = hand.direction().pitch();
        float yaw = hand.direction().yaw();
        float roll = hand.palmNormal().roll();
    But since UE blueprints have convenience nodes, I find it easier to do the following



    Which is simply taking the normal and the direction and making a rotator from the Z and X axis, that's it.

    We can show this is correct by using a convenience debug function like this



    which gives the following result (along with debug showing finger positions for context)



    Also noticed that the palm normal was being scaled (which it shouldn't be) so I fixed that and updated the plugin to 0.7.3. This wouldn't affect the above graph however.

    Originally posted by fabianoberlim
    Tried in another computer and the engine still crashes. I notice that my actor (character) gets delete after 60 seconds. The engine does not crash until "Event Hand Moved" is activated.
    Maybe there's a UPROPERTY missing and the garbage collector is deleting the actor or component.
    Does anybody can replicate it?
    I have tried your example in the third person blueprint template and it isn't crashing for me, let's try to narrow this down. Make a new project, run me through which type of project (e.g. 3rd person template, blueprint) /etc so I can replicate it exactly. Also if you can send me your logs (found in {Project Root}/Saved/Logs), we should be able to identify what is going on.


    Originally posted by Luis Oliveira View Post
    Heh, thanks but I've been working with UE4 for some time now (but mainly just making level design). I know the basics except for the classes and blueprints part, I can only make openable doors lol.

    "That said you need to make sure that the pawn is set as the default pawn in your game mode." - Yeah I did that but it doesn't really affect my level. I can't move anymore after I do that, but maybe the player controls are inside the default pawn. I still have a lot to learn ^^

    Do i need to add stuff to the components part? Because there's nothing there right now. I tried adding a camera but that didn't help much.
    It is probably best that you start with a template character which will have all the movement input bindings conveniently set up. For really basic movement you can simply re-parent your pawn to Character.h.
    Last edited by getnamo; 10-31-2014, 10:10 AM.

    Leave a comment:


  • replied
    Tried in another computer and the engine still crashes. I notice that my actor (character) gets delete after 60 seconds. The engine does not crash until "Event Hand Moved" is activated.
    Maybe there's a UPROPERTY missing and the garbage collector is deleting the actor or component.
    Does anybody can replicate it?

    Leave a comment:


  • replied
    Hey getnamo since you're a programmer I assume you understand the leap API well enough. I've been looking at the best way to get the rotation data and give that to the hand bone. I've been using palm normal and direction but my understanding is that the hand bone rotates at the wrist while the leap is grabbing the rotation from the center of the palm, is there a way to correct this?

    Leave a comment:


  • replied
    I've been able to compile a new project. So I will test in my main project and see what happens.
    Originally posted by getnamo View Post
    Tested this in blueprint for both finger and hand (finger is a subclass of pointable, the only other class that has timeVisible code), it printed for longer than 60 seconds without issue, so I could not replicate this bug. The code is simply a pass-through for the underlying leap object, so it shouldn't be the reason for a bug. Are you referring to 'getFrame' instead which supports up to 60 frames (valid index 0-59)? Please elaborate what specific setup/steps cause this bug to show up?
    Leap still crashes with a very simple project. I have nothing but the character in the scene with this setup inside blueprints character.
    It crash both in the editor and the compiled project. It actually crash around 40 to 59 seconds.
    Click image for larger version

Name:	SimpleBlueprintsSetup.jpg
Views:	1
Size:	158.7 KB
ID:	1060410
    Last edited by fabianoberlim; 10-30-2014, 02:16 PM.

    Leave a comment:


  • replied
    Originally posted by Luis Oliveira View Post
    Heh, thanks but I've been working with UE4 for some time now (but mainly just making level design). I know the basics except for the classes and blueprints part, I can only make openable doors lol.

    "That said you need to make sure that the pawn is set as the default pawn in your game mode." - Yeah I did that but it doesn't really affect my level. I can't move anymore after I do that, but maybe the player controls are inside the default pawn. I still have a lot to learn ^^

    Do i need to add stuff to the components part? Because there's nothing there right now. I tried adding a camera but that didn't help much.
    Did you enable the leap blueprint props? Its at the top of your BP next to the compile and save button.

    Leave a comment:


  • replied
    Heh, thanks but I've been working with UE4 for some time now (but mainly just making level design). I know the basics except for the classes and blueprints part, I can only make openable doors lol.

    "That said you need to make sure that the pawn is set as the default pawn in your game mode." - Yeah I did that but it doesn't really affect my level. I can't move anymore after I do that, but maybe the player controls are inside the default pawn. I still have a lot to learn ^^

    Do i need to add stuff to the components part? Because there's nothing there right now. I tried adding a camera but that didn't help much.

    Leave a comment:


  • replied
    Originally posted by Luis Oliveira View Post
    Hm, that makes sense. I'll try it.

    Also I think this may have to do with my pawn blueprint. I don't know if I'm controlling it. I tried searching for pawn tutorials but no results. After I create pawn should I just drag and drop or do I need to do something with it?
    This really covers basics, so I recommend following unreal tutorials first. That said you need to make sure that the pawn is set as the default pawn in your game mode.

    Leave a comment:


  • replied
    Hm, that makes sense. I'll try it.

    Also I think this may have to do with my pawn blueprint. I don't know if I'm controlling it. I tried searching for pawn tutorials but no results. After I create pawn should I just drag and drop or do I need to do something with it?

    Leave a comment:


  • replied
    Originally posted by Luis Oliveira View Post
    I added through the Option B, and I even ticked all the HMD options because I'm using with the Oculus.
    But still, nothing happens.
    I recommend not using the rift first, but ensure it works by using the regular on-table placement and showing the debug hands. You may be simply not seeing the hand because it is off-screen. Understand that using Optimize for HMD will adjust the positions are rotations with the expectation that you have your leap mounted, essentially requiring you to put on the hmd to preview the hands.

    Leave a comment:


  • replied
    I added through the Option B, and I even ticked all the HMD options because I'm using with the Oculus.
    But still, nothing happens.

    Leave a comment:


  • replied
    Originally posted by Luis Oliveira View Post
    Hey guys, I'm having a bit of difficulty putting this to work. So, I downloaded the latest leap-ue4-master. I created a pawn blueprint with all the correct nodes (I copied exactly from the instructions), and inserted interface on blueprint props. But when I press play nothing happens!
    Any idea of what might be? Thanks!
    You need to add a Leap component in addition to add the interface. Without the component your interface events will never fire!

    Two methods of adding a component are:
    Option A: Adding Component Directly


    Option B: Adding Component through event graph

    Leave a comment:


  • replied
    Hey guys, I'm having a bit of difficulty putting this to work. So, I downloaded the latest leap-ue4-master. I created a pawn blueprint with all the correct nodes (I copied exactly from the instructions), and inserted interface on blueprint props. But when I press play nothing happens!
    Any idea of what might be? Thanks!

    Leave a comment:


  • replied
    Originally posted by fabianoberlim View Post
    [BUG]
    There's a bug in the "Time Visibility". If you keep your hands in the leap for 60 seconds, it freezes. Happens when the clock reaches 59 seconds to 60 seconds. It's probably turning the clock to zero and then dividing something.
    Tested this in blueprint for both finger and hand (finger is a subclass of pointable, the only other class that has timeVisible code), it printed for longer than 60 seconds without issue, so I could not replicate this bug. The code is simply a pass-through for the underlying leap object, so it shouldn't be the reason for a bug. Are you referring to 'getFrame' instead which supports up to 60 frames (valid index 0-59)? Please elaborate what specific setup/steps cause this bug to show up?

    Originally posted by fabianoberlim View Post
    First of all, I noticed that I was not using the current build 0.7.2. Updated and fixed all errors inside blueprints. So far so good! Works perfect inside editor.

    After those steps, I get several errors when I try to compile. Most of the errors are like these:

    And the list goes on for all the header files. I'm not a C++ programmer so I may be making some mistake.
    Just to make clear. Do I need to compile and link the LeapSDK with the Unreal code? I don't think so, since the LeapSDK is already inside your build.
    What I'm missing?
    First of all what build type are you trying to do? Are you packaging your project? (File->Package->Platform->x64/x32) Is it shipping or development build? Please be as specific as you can in terms of what you're doing, for example Launch is not supported due to lack of automatic dll copying in packaging process, but packaged shipping/development builds are.

    From my understanding of how the compilation works, for both development and shipping build, the game collapses the plugin into the build and because of this requires the project to have code so that the compiler includes the plugin source in the build. This is a limitation of the shipping process for plugins as far as I am aware. But you should not need to have any additional code or step beyond what is mentioned in the shipping instructions.

    Either way, I've tested the shipping instructions several times and they work on my end, perhaps they are not clear enough or you are doing something unexpected, walk me through your packaging process as well the project context (C++ base, blueprint base, leap component added to character subclass/etc).

    Also please ensure you DELETE the old plugin(if you have no other plugins, simply delete the Plugins folder from your project) when upgrading, as you may get duplicate classes otherwise which may cause errors when you compile.

    Leave a comment:

Working...
X