Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement support for Leap Motion's "Orion" release #41

Closed
zachkinstner opened this issue Mar 4, 2016 · 24 comments
Closed

Implement support for Leap Motion's "Orion" release #41

zachkinstner opened this issue Mar 4, 2016 · 24 comments
Assignees
Labels

Comments

@zachkinstner
Copy link
Member

There are several changes/improvements in "Orion" that affect Hover VR. Notably, it no longer uses the LeapCSharp.NET3.5.dll, which means I'll need to change the way that the Hover DLLs are compiled.

@zachkinstner zachkinstner self-assigned this Mar 4, 2016
@zachkinstner zachkinstner added this to the Near-Term milestone Mar 4, 2016
@zachkinstner
Copy link
Member Author

@squakmix had emailed about this issue. Scott, have you seen the forum discussion linked above?

@squakmix
Copy link

squakmix commented Mar 5, 2016

Yeah, unfortunately I'm having issues getting the Hover dlls to compile (with or without the LeapCSharp.Net3.5.dll). When I open Hover.sln in Monodevelop and build all, it creates Hover.common.dll but runs into an error trying to move it:

Executing: cp "D:\projects\Hover-VR-Interface-Kit-1.4.0\Core\Solution\Hover.Common\bin\Debug\Hover.Common.dll" "D:\projects\Hover-VR-Interface-Kit-1.4.0\Core\Solution/../../Unity/Assets/Plugins/"

---------------------- Done ----------------------

Failed to execute custom command 'cp': The system cannot find the file specified
Build canceled.

Hover.Common.dll appears to have built without an issue (without the LeapCSharp.Net3.5.dll in the Core/Packages/LeapMotion/ folder), so I'll try using that in my project.

@zachkinstner
Copy link
Member Author

That Leap DLL is outdated, and is no longer supported in Orion, so we can't build against it.

I tried a couple long-shot ideas tonight, where I referenced the "LeapC" code in the Visual Studio solution in various ways, and hoped that it would "just work" on the Unity side. No luck so far, and I doubt it's possible.

It looks like three main options:

  • Move all the code/structure into the Unity project. I'd rather not, because Hover VR can support different input devices, and could have various other optional components. It seems best provide a set of versioned DLLs, where the developer simply chooses which to include in their project. I realize that this creates an extra layer of complexity for developers who want to modify the code, though.
  • Create a "LeapC" DLL manually, build against it, and require Hover VR developers to use it. They'd need to delete the "LeapC" folder in Unity, and place the LeapC DLL in the "Plugins" folder instead. Doesn't sound like a great option.
  • Figure out what Leap's reasoning is here, and see if they might switch back to the DLL. I have continued this discussion in the Leap forum.

@squakmix
Copy link

squakmix commented Mar 6, 2016

Option 1 sounds best to me.

@zachkinstner
Copy link
Member Author

Joe Ward responded at the Leap Motion forum:

There isn't a strong reason not to build the files into a dll, other then to help developers understand what was going on by having the source available. We'll discuss whether we want to make the change and figure out the ramifications, if any.

Thanks for letting us know that there was a use case we weren't considering.

And later:

We plan to release both in the SDK, but only the compiled .dll in the Unity assets (otherwise there would be name conflicts). (We have a few build issues related to Unity's ancient version of .NET to sort first, though.)

@zachkinstner
Copy link
Member Author

@squakmix, so even if the Leap DLL becomes available again -- would you prefer to have the code directly in the Unity project, vs. installing the Hover DLLs in the Unity project?

Adding code directly seems to be the "Unity way to do things", so I suspect that would be what most Unity developers would prefer. It has always seemed a little strange to me to paste third-party code directly into my projects -- it seems cleaner to keep that third-party code/functionality stored into DLLs.

The DLLs help to simplify installation because Hover VR has many optional components (i.e. installing only the Leap Motion input module, or only the Hovercast elements). I think this simplifies the upgrade process, too -- you get versioned DLL files, and you're only replacing a few DLLs vs. dozens of script files/folders.

Ease of making custom changes seems to be the primary benefit of placing the code directly into the Unity project. Do you agree? Are there other benefits that I'm not seeing? Thanks for your feedback!

@christianatkin
Copy link

Hey there, I emailed on the subject and appreciated the response and didn't want to nag any further via email.

For the short term I agree with squakmix simply through time concerns - the UI is central to my project and rather than wait for leap to move it would be very useful to have the functionality compatible with Orion sooner rather than later with hopefully fewer ramifications should the project be moved to a dll later than stick with the older leap dll.

With unity having the non-dll source in the project is a familiar practice and hence not seen as too inconvenient, and presumably for now maybe a bit less work until leap move on your suggestion.

Regarding the complexity of adding various components, it's also familiar to choose what to import into a project from a unity package from the options presented at the time of import, so with instruction a user could simply choose from that, which is to me just as familiar as figuring out which dll I should be importing

@squakmix
Copy link

The primary benefits I see to doing it the "Unity way" are consistency with other imported packages/libraries, ease of editing hover source files, and likely ETA of solution. As christianatkin said, supporting Orion as soon as possible is a high priority and it seems like you could move faster than Leap Motion might be able to.

zachkinstner referenced this issue Mar 17, 2016
…oved VS solution. Known issue: all "demo" scene references are now broken.
@zachkinstner
Copy link
Member Author

The above commit also includes a few changes to be compatible with the new Orion API. Notably:

  • Removed references to the obsolete IsValid properties.
  • Use of Leap's utility/extension methods (vs. custom ones from the VS project)
  • Switch from classes like FingerList to List<Finger>

Known issue: this change breaks all the script references in the "demo" scenes. This will be a big task to re-create these scenes, and I will not have time to do that in the near-term. Because of this, I have not tested the code changes in this commit. I will try to update a couple simple scenes today to confirm that the basic functionality is working as expected with Orion.

@zachkinstner
Copy link
Member Author

Please track the leap-orion branch for changes.

@zachkinstner
Copy link
Member Author

Resolving Missing Script References in Unity:

Recently, I have been moving some of our important and core code out of the Unity Assets directory and instead compiling them in to a .NET dll. When I did this I encountered in to the issue of all the scenes and prefabs that were using MonoBehaviours from those scripts had lost their reference.

This is the opposite direction (Hover code has moved from DLL to Unity) but the underlying problem is the same: the script references have changed.

TL;DR the format was meticulously designed to break your heart.

@zachkinstner
Copy link
Member Author

I'll update this table as I find more old-to-new GUID mappings. You'll be able to find-and-replace these in your script and prefab files, but only if you have those assets serialized as text.

TODO: Looks like the GUID isn't enough, because all of the scripts within the same DLL receive the same GUID. So, this table will also need to include the FileID value.

Script Old GUID New GUID
HovercastItemVisualSettingsStandard 35b8a73834ef15a45afe904384e56469 41ba672d9b0b2284c837e284d455520e
HovercastItem 0287263cc8027804ca949b1a81526620 35b8a73834ef15a45afe904384e56469
HovercastItemHierarchy 0287263cc8027804ca949b1a81526620 27f0ff91685882a4dabff32a466b1f63
HovercursorSetup 6e10d2a93151b5a4897c2e41bd3cd272 523acb6356824d4488a6132246af65f3
HovercastSetup fileID: 201543926, guid: 0287263cc8027804ca949b1a81526620 fileID: 11500000, guid: dec2e7f18891d414599832b56629f447
HovercastInteractionSettings 0287263cc8027804ca949b1a81526620 c1a613d7e7edd8340bdbf5dfd2c2f943
HovercastTransformInput 0287263cc8027804ca949b1a81526620 290dab0f4618cca4b9042eda2ced3ac4

@VicerVersa
Copy link

Hey Zach, can gou take me.off youe mailing list? For some reason im getting emails for l8ke every support case you have

Sent from my Verizon Wireless 4G LTE smartphone

-------- Original message --------
From: Zach Kinstner notifications@github.com
Date: 03/17/2016 10:27 AM (GMT-05:00)
To: aestheticinteractive/Hover-VR-Interface-Kit Hover-VR-Interface-Kit@noreply.github.com
Subject: Re: [Hover-VR-Interface-Kit] Implement support for Leap Motion's
"Orion" release (#41)

I'll update this table as I find more old-to-new GUID mappings. You'll be able to find-and-replace these in your script and prefab files, but only if you have those assets serialized as text.

Script
Old GUID
New GUID

HovercastItemVisualSettingsStandard
35b8a73834ef15a45afe904384e56469
41ba672d9b0b2284c837e284d455520e

HovercastItem
0287263cc8027804ca949b1a81526620
35b8a73834ef15a45afe904384e56469

HovercastItemHierarchy
0287263cc8027804ca949b1a81526620
27f0ff91685882a4dabff32a466b1f63

HovercursorSetup
6e10d2a93151b5a4897c2e41bd3cd272
523acb6356824d4488a6132246af65f3

HovercastSetup
0287263cc8027804ca949b1a81526620
dec2e7f18891d414599832b56629f447

HovercastInteractionSettings
0287263cc8027804ca949b1a81526620
c1a613d7e7edd8340bdbf5dfd2c2f943

HovercastTransformInput
0287263cc8027804ca949b1a81526620
290dab0f4618cca4b9042eda2ced3ac4


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

@zachkinstner
Copy link
Member Author

Hi @VicerVersa, you have probably clicked "Watch" for this project at some point. You should be able to click "Unwatch" (near the top of the GitHub project pages) to stop receiving notifications. There may be other GitHub options for how frequently you receive notifications, or whether they generate emails (vs. seeing them only when you login to your GitHub account).

zachkinstner referenced this issue Mar 17, 2016
…something is way off with the scale of hand movement and menu size.
zachkinstner added a commit that referenced this issue Mar 20, 2016
…ation of coordinates in Orion. Updated the test scene to use Leap's VR rig. Updated the Hovercast Leap Input to use camera transform (instead of a local-space direction) to determine the menu alpha strength. (#41)
zachkinstner added a commit that referenced this issue Mar 20, 2016
@zachkinstner
Copy link
Member Author

@squakmix, @christianatkin, thanks for your feedback on this.

Please see the latest commits in the leap-orion branch. The scene called HovercastTest-VR-LeapMenu-LeapCursor.unity (in the /Assets/Hover/Demo/CastTest folder) is working correctly for me with Leap Motion's Orion 3.1.1 + Oculus DK2 0.8. All other demo scenes are broken.

Moving the code from the Hover DLLs into Unity causes the script references to break in your Unity scenes. If you serialize your scenes as text, you can perform a search-and-replace (on both FileID + GUID) rather than manually updating your scene. More details in my comments above.

Note: there was a Unity bug causing the UI text to have an incorrect vertical alignment. Updating to the latest Unity build resolves this. If you can't update Unity, setting the Tahoma font resource to be "Dynamic" is also a workaround.

@squakmix
Copy link

Awesome, thanks Zach! I'll give this a shot over the next few days and let you know how it goes.

@christianatkin
Copy link

It's been working great for me, thank you for your time, it's great to be
using hover with tracking that feels remarkably natural, finally
On 21 Mar 2016 18:02, "squakmix" notifications@github.com wrote:

Awesome, thanks Zach! I'll give this a shot over the next few days and let
you know how it goes.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#41 (comment)

@squakmix
Copy link

The test scene works great for me, thanks again for the update!

@yesh66
Copy link

yesh66 commented May 13, 2016

I still cannot get this working, as I find 2 errors,

Assets/Hover/Hover.Cast.Input.Leap/InputMenu.cs(46,52): error CS1061: Type Leap.LeapTransform' does not contain a definition forRotation' and no extension method Rotation' of typeLeap.LeapTransform' could be found (are you missing a using directive or an assembly reference?)

if I replace R in Rotation with r, then I get the following error: Assets/Hover/Hover.Cast.Input.Leap/InputMenu.cs(46,52): error CS1955: The member `Leap.LeapTransform.rotation' cannot be used as method or delegate

and this error exists nevertheless

Removing Assets/Hover/Hover.Board.Input.Leap because the asset does not exist

@zachkinstner
Copy link
Member Author

Hi @yesh66, I haven't had time to look into the latest Orion release, but I suspect they have made a minor change with this property. Just today, there was a post at the Leap Motion forum with (what appears to be) the same issue:

Joe Ward (from Leap) wrote...

The rotation member is a property, so no parentheses. Also, since the rotation property is a Leap API class, you also have to convert it to a Unity Quaternion to assign it to a Unity rotation.

transform.rotation = _hand.Basis.rotation.ToQuaternion();

@yesh66
Copy link

yesh66 commented May 14, 2016

Thanks a lot Zachkinster for your prompt response, it is working now!
Brilliant stuff!!!

@Death111
Copy link

In files InputCursor.cs, InputMenu.cs and HovercursorLeapInput.cs one need to add
using Leap.Unity;
as they moved special Unity function (like the conversion of a Leap Vector in a Unity Vector) in this namespace.

@swann1444
Copy link

Hello,
I am really impressed by your work. I would like to know if you have now a target release date for a compatible version of the Hover with the new Orion version which is strongly more accurate.
Thank you.

@zachkinstner
Copy link
Member Author

zachkinstner commented Nov 2, 2016

All Hover UI Kit v2.0+ releases include input modules for Leap Motion's Orion and pre-Orion SDKs.

The latest release is v2.0.0A (alpha). This release is substantially different from the v1.x releases. Please see the project wiki for details.

@zachkinstner zachkinstner removed this from the Near-Term milestone Nov 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants