-
Notifications
You must be signed in to change notification settings - Fork 14
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
Ensure we compile with C++11 #19
Conversation
I can confirm it does not detect the controller as is under Arch Linux 64bit. From the leap documentation:
The following (stupid) workaround fixes it: Subject: [PATCH] workaround for not finding the controller
---
HardwareDetection.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/HardwareDetection.cpp b/HardwareDetection.cpp
index 8b3bc2e..a65e4b1 100644
--- a/HardwareDetection.cpp
+++ b/HardwareDetection.cpp
@@ -1,6 +1,9 @@
#include "HardwareDetection.h"
#include "ControllerDevice.h"
+#include <chrono>
+#include <thread>
+
using namespace LeapOsvr;
@@ -14,6 +17,8 @@ HardwareDetection::HardwareDetection() : mFound(false) {
OSVR_ReturnCode HardwareDetection::operator()(OSVR_PluginRegContext pContext) {
Leap::Controller controller;
+ std::this_thread::sleep_for(std::chrono::duration<int, std::milli>(100));
+
if ( !controller.isConnected() ) {
mFound = false;
return OSVR_RETURN_FAILURE;
--
2.8.0 It should probably be fixed by using the callbacks mentioned in https://developer.leapmotion.com/documentation/cpp/devguide/Sample_Tutorial.html |
Ooh, excellent find! I think I might be able to make the callback based fix
|
See also #13 (comment) Looks like the whole detection process should be reworked. |
Just as a note: use this command to test if all fingers are detected correctly:
(spiky hands) http://i.imgur.com/O2QIrQV.gifv |
…. To be replaced by Leap registration callbacks
Working great for me. I'll see if I can't do something about the proper callbacks this weekend, although it seems there's already some attention to this issue elsewhere. |
I'm thinking a way of doing this neatly would be to keep track of Leap On Wed, Apr 20, 2016 at 2:52 PM, phiresky notifications@github.com wrote:
|
As far as I can tell there isn't really an optimal method. Leap only has a callback for connected, so you would still need to check .isConnected in hardwareDetect even after receiving the connected callback from leap. This assumes state (the Leap::Controller instance) can be kept somewhere when HardwareDetect returns |
Ah, didn't quite work out anyway. Tried making a static Leap::Controller The mFound boolean is particularly mysterious, by all means it seems to be On Thu, Apr 21, 2016 at 5:05 PM, phiresky notifications@github.com wrote:
|
This is required for compiling with the latest GCC on Linux.
It compiles correctly, but doesn't show anything in
osvr_print_tree
orOSVRTrackerView
if I load up the provided config, so I'm not completely certain if it works correctly. Can anyone else confirm? Has someone tried it lately?