-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Nat-Lab/leap
merge leap support to master
- Loading branch information
Showing
12 changed files
with
472 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
build32 | ||
build64 | ||
.vscode | ||
.vscode | ||
LeapSDK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Download the Leap Motion Orion SDK package from https://developer.leapmotion.com and copy LeapSDK folder here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include "leapio/leapio.h" | ||
#include "log.h" | ||
|
||
void log_tracks(const LEAP_TRACKING_EVENT *ev) { | ||
log_debug("saw %u hands.\n", ev->nHands); | ||
for(uint32_t h = 0; h < ev->nHands; h++) { | ||
const LEAP_HAND* hand = &(ev->pHands[h]); | ||
log_debug("hand %u is a %s hand. location (%f, %f, %f).\n", | ||
hand->id, hand->type == eLeapHandType_Left ? "left" : "right", | ||
hand->palm.position.x, hand->palm.position.y, hand->palm.position.z); | ||
} | ||
} | ||
|
||
int main () { | ||
log_info("connecting to leap service...\n"); | ||
leap_set_tracking_handler(log_tracks); // debug | ||
|
||
leap_connect(NULL); | ||
while (!leap_is_connected()) { | ||
Sleep(10); | ||
} | ||
log_info("connected to leap service.\n"); | ||
|
||
log_info("waiting for any leap device...\n"); | ||
while (!leap_is_device_connected()) { | ||
Sleep(10); | ||
} | ||
log_info("leap device connected.\n"); | ||
|
||
leap_join_thread(); | ||
|
||
// TODO | ||
|
||
log_info("disconnecting from leap service...\n"); | ||
leap_disconnect(); | ||
log_info("disconnected.\n"); | ||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
leap_configurator = executable( | ||
'leapconfig', | ||
name_prefix : '', | ||
include_directories : [inc, leap_inc], | ||
implicit_include_directories : false, | ||
c_pch : '../precompiled.h', | ||
link_with: [leapio_lib], | ||
dependencies: leap_lib, | ||
sources : [ | ||
'leap-configurator.c' | ||
] | ||
) |
Oops, something went wrong.