GodotVR / gdleapmotion

Leap motion module for Godot
MIT License
19 stars 5 forks source link

Firmware update and GDNative errors #9

Closed pwab closed 4 years ago

pwab commented 5 years ago

Hey @BastiaanOlij thanks a lot for the implementation of the leap motion sensor. I'm using it quite often for about a year now and it's working fine in my scenarios.

I bought a new LeapMotion device for a home project and started using it in Godot 3.1.stable.mono.official. I downloaded the module from the AssetLib, dropped the Leap_Motion.tscn scene into my tree and it works as expected from the start. I watched the console log and saw two interesting message blocks:

1. Firmware Update

It seems that the leap motion is getting a firmware update when using it at the first time. I installed newest Orion Beta software ten minutes ago and tested the device in the Visualizer. I'm not sure why this is done when using it in Godot. Also these Error 3 and Error 2 are confusing me. What's the error here?

Also if this update process is started at the beginning and you shouldn't unplug your device this should be mentioned somewhere. Not sure if this could brick your device otherwise.

LeapMotion - connected to leap motion
LeapMotion - Error 3 - 1572783553725452: Leap Motion Controller detected: LP38265064917
LeapMotion - Error 3 - 1572783555121696: Firmware version: 1.3.0
LeapMotion - Error 3 - 1572783555121705: Leap Motion Controller firmware version 1.3.0 is out of date.
LeapMotion - Error 3 - 1572783555121710: Initiating firmware upgrade to version 1.7.0.
LeapMotion - Error 2 - 1572783555121711: Do not unplug your Leap Motion Controller.
LeapMotion - Error 3 - 1572783555121712: If upgrade fails, please visit http://support.leapmotion.com to troubleshoot.
LeapMotion - Error 2 - 1572783557563319: Firmware Update Started! DO NOT DETACH
LeapMotion - Error 3 - 1572783557563826: Progress: 0%
LeapMotion - Error 3 - 1572783560023013: Progress: 10%
LeapMotion - Error 3 - 1572783563074237: Progress: 20%
LeapMotion - Error 3 - 1572783566030960: Progress: 30%
LeapMotion - Error 3 - 1572783569059182: Progress: 40%
LeapMotion - Error 3 - 1572783571994021: Progress: 50%
LeapMotion - Error 3 - 1572783574904119: Progress: 60%
LeapMotion - Error 3 - 1572783577825590: Progress: 70%
LeapMotion - Error 3 - 1572783580631686: Progress: 80%
LeapMotion - Error 3 - 1572783583478033: Progress: 90%
LeapMotion - Error 3 - 1572783586374877: Progress: 100%
LeapMotion - Error 3 - 1572783586780174: Firmware update succeeded.
LeapMotion - Error 3 - 1572783586865368: Leap Motion Controller disconnected: LP38265064917
LeapMotion - Error 3 - 1572783587278722: Leap Motion Controller detected: LP38265064917
LeapMotion - Error 3 - 1572783587281232: Firmware is up to date.
LeapMotion - Error 3 - 1572783607972698: Tracking resumed with client application connected
LeapMotion - Error 3 - 1572783699245841: Tracking optimized for head-mounted device
LeapMotion - Error 3 - 1572783748225326: Tracking optimized for up-facing device
LeapMotion - Error 3 - 1572783765904896: Leap Motion Controller disconnected: LP38265064917
LeapMotion - Error 3 - 1572783876116620: Leap Motion Controller detected: LP38265064917
LeapMotion - Error 3 - 1572783876119599: Firmware is up to date.
LeapMotion - Error 3 - 1572784089756705: Tracking optimized for head-mounted device
LeapMotion - Error 3 - 1572784092914355: Reversed tracking orientation
LeapMotion - Error 3 - 1572784189166280: Tracking optimized for up-facing device
LeapMotion - found device LP38265064917

2. GDNative Errors

While running and while staying in Godot editor I'm getting error messages every few minutes. Not sure when these are triggered but it seems to be some problem with GDNative:

ERROR: get_symbol: No valid library handle, can't get symbol from GDNative object
   At: modules/gdnative/gdnative.cpp:488
ERROR: terminate: No valid library handle, can't terminate GDNative object
   At: modules/gdnative/gdnative.cpp:393

Apart from that it still runs fine without any difference to the Visualizer application. Thanks again for your effort.

BastiaanOlij commented 5 years ago

How strange, I think they are just chatter coming from the SDK indeed informing your of what is going on. But the only place that would output such messages is: https://github.com/BastiaanOlij/gdleapmotion/blob/master/src/gdlm_sensor.cpp#L894 And the status should be critical, warning, information or unknown, not error :) I think they are harmless though.

The GDNative errors are a bit more worriesome. It means either the plugin is trying to call something in Godot that doesn't exist anymore or visa versa.

Now I did write this a long time ago so it's not impossible something was retired in Godot 3.1, I should probably update the upstream repos and compile this against a newer version of godot-cpp and the latest leap motion SDK. I probably won't have time to look at it until the weekend though. Please give me a nudge if I forget :)

pwab commented 4 years ago

Please give me a nudge if I forget :)

I'm not sure if you forgot but I wanted to let you know that I don't get any error messages in Godot 3.2.1 (with current leap motion firmware). šŸ‘

BastiaanOlij commented 4 years ago

I did get sidetracked and totally forgot about this. Glad to hear you solved it :)

BastiaanOlij commented 4 years ago

P.S just in case I did do #11

pwab commented 4 years ago

I don't get any error messages in Godot 3.2.1 (with current leap motion firmware)

I'm sorry but I'm still getting those errors. Not sure when and why. Sometimes my Leap Motion service isn't running and I have to start it manually via the Task Manager. I'll simply wait for a recompilation and then I'll check again.

It still doesn't have any effect other than flooding the console window.

BastiaanOlij commented 4 years ago

Did you check it with the branch for #11 ? I hadn't merged that into master yet. Did just merge it so if you had build from master you could try again ?

pwab commented 4 years ago

Hey @BastiaanOlij I tried it a few minutes ago. Here some feedback:

1. Compilation of current master

I updated my Visual Studio 2019 instance, installed scons with pip and cloned the master. I got to the point where I should compile the cpp bindings. I encountered the following error:

C:\Daten\Workspace\GitHub\gdleapmotion\godot-cpp>scons platform=windows bits=64 generate_bindings=yes
scons: Reading SConscript files ...
TypeError: write() argument must be str, not bytes:
  File "C:\Daten\Workspace\GitHub\gdleapmotion\godot-cpp\SConstruct", line 148:
    env = Environment(ENV = os.environ)
  File "c:\users\pwab\appdata\local\programs\python\python38-32\lib\site-packages\scons\SCons\Environment.py", line 990:
    apply_tools(self, tools, toolpath)
  File "c:\users\pwab\appdata\local\programs\python\python38-32\lib\site-packages\scons\SCons\Environment.py", line 102:
    env.Tool(tool)
  File "c:\users\pwab\appdata\local\programs\python\python38-32\lib\site-packages\scons\SCons\Environment.py", line 1810:
    tool(self)
  File "c:\users\pwab\appdata\local\programs\python\python38-32\lib\site-packages\scons\SCons\Tool\__init__.py", line 303:
    self.generate(env, *args, **kw)
  File "c:\users\pwab\appdata\local\programs\python\python38-32\lib\site-packages\scons\SCons\Tool\default.py", line 41:
    SCons.Tool.Tool(t)(env)
  File "c:\users\pwab\appdata\local\programs\python\python38-32\lib\site-packages\scons\SCons\Tool\__init__.py", line 303:
    self.generate(env, *args, **kw)
  File "c:\users\pwab\appdata\local\programs\python\python38-32\lib\site-packages\scons\SCons\Tool\mslink.py", line 314:
    msvc_setup_env_once(env)
  File "c:\users\pwab\appdata\local\programs\python\python38-32\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py", line 695:
    msvc_setup_env(env)
  File "c:\users\pwab\appdata\local\programs\python\python38-32\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py", line 814:
    d = msvc_find_valid_batch_script(env,version)
  File "c:\users\pwab\appdata\local\programs\python\python38-32\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py", line 762:
    d = script_env(vc_script, args=arg)
  File "c:\users\pwab\appdata\local\programs\python\python38-32\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py", line 621:
    stdout = common.get_output(script, args)
  File "c:\users\pwab\appdata\local\programs\python\python38-32\lib\site-packages\scons\SCons\Tool\MSCommon\common.py", line 238:
    sys.stderr.write(stderr)

Anything I can do about this? Just a side-question: Why there is a need for 'Oculus SDK 1.43.0' as mentioned in your Readme?

2. Using your precompiled version in the demo folder

So I used your precompiled version and the log was the following:

Running: C:\Daten\Box\Tools\Godot\Godot.exe --path C:/Users/pwab/Desktop/demo --remote-debug 127.0.0.1:6007 --allow_focus_steal_pid 9436 --position 288,150
Godot Engine v3.2.1.stable.official - https://godotengine.org
OpenGL ES 3.0 Renderer: GeForce GT 555M/PCIe/SSE2

Construct leap motion
Start thread
LeapMotion - connected to leap motion
Setting arvr to false
LeapMotion - Information - 1588506012396909: Leap Motion Controller detected: LP38265064917
LeapMotion - Information - 1588506014007927: Firmware is up to date.
LeapMotion - Information - 1588506031762925: Tracking resumed with client application connected
LeapMotion - found device LP38265064917
LeapMotion - policy event

It found the device very fast and tracking works perfectly. And also no errors anymore. šŸ‘

3. Demo scene

I tried your provided demo scene and was confused about the cylinder behavior. Is there something off with the CollisionShape? Here is a short gif:

N982erSo15

(Sorry that I mix 1 and 3 into this issue but I wanted to summarize my observations.)

BastiaanOlij commented 4 years ago

Ok,

1) those are errors coming from scons' internal script, I have no idea why, maybe version of python or scons needs to be updated?

If I'm mentioning the Oculus SDK in the readme then I need to fix that, probably just because I copied files over from my Oculus plugin when I started on this plugin :) Oops

2) great to hear atleast the compiled binary is working great

3) there is something amiss with the cylinder collision shape in Godot 3.2, I don't know what yet but I ran into that this weekend

pwab commented 4 years ago
  1. I'm using almost newest Python 3.8.2 but I'll look into this.
  2. I'll create seperate issues for the other points because the error messages are solved here šŸ‘