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

Linux support #13

Closed
MostHated opened this issue Jan 30, 2023 · 8 comments · Fixed by #14
Closed

Linux support #13

MostHated opened this issue Jan 30, 2023 · 8 comments · Fixed by #14

Comments

@MostHated
Copy link

Hey there,
I was wondering if there was any chance this might receive linux support? The actual Gemini framework has linux support: https://docs.ultraleap.com/linux/ I am guessing it must be newer? I only got my UL 3di device the other day, so I have not been keeping up until very recently. Just for giggles I attempted to change the build scripts LEAPSDK_LIB_PATH to the path of the libraries on linux, which were listed here:

The hand tracking client library, libLeapC.so, is installed to /usr/share/doc/ultraleap-hand-tracking-service with a symlink in /usr/lib/x86_64-linux-gnu/.
The corresponding header, LeapC.h, is installed to /usr/share/doc/ultraleap-hand-tracking-service/include, with a symlink in /usr/include.

Unfortunately, it keeps coming back with:

LEAPSDK_LIB_PATH='/usr/share/doc/ultraleap-hand-tracking-service' cargo build                  
   Compiling leaprs v0.1.1-dev (/mnt/x/GitHub/plule/leaprs)
error: could not find native static library `LeapC`, perhaps an -L flag is missing?

I am assuming there must be more to it than that. What exactly, I unfortunately do not know.

Thanks,
-MH

@plule
Copy link
Owner

plule commented Jan 30, 2023

Hello, yep, they just recently added the Linux support, unfortunately the old leap motion is not yet supported so I can't test myself.

Just for giggles I attempted to change the build scripts LEAPSDK_LIB_PATH to the path of the libraries on linux

Well it should actually work! The only Windows specific par of the crate is the default path for this var.

build.rs likely needs an update. Can you try removing the =static flag in cargo:rustc-link-lib=static=LeapC?

@MostHated
Copy link
Author

Awesome, that seems to have done the trick. It was able to recognize my camera and got to the "waiting for hand" message. Though, it did not detect one, but I believe I just need to figure out now to make sure it is aware of my setup. Running through the Web/Unity demos generated some json configs which contain orientation data and positioning values, since I am using the "above monitor" and "facing user" setup, it has the z-axis at -180 degrees and such. Not sure if that data is relevant with this?

TrackingConfig.json
{
  "Mask": {
    "Lower": 0.0,
    "Upper": 0.0,
    "Right": 0.0,
    "Left": 0.0
  },
  "AllowImages": true,
  "CameraReversed": true,
  "AnalyticsEnabled": true
PhysicalConfig.json
{
    "ScreenHeightM": 0.28821733593940737,
    "LeapPositionRelativeToScreenBottomM": {
        "x": -0.04785703495144844,
        "y": 0.378326952457428,
        "z": -0.037553731352090839
    },
    "LeapRotationD": {
        "x": -4.993865966796875,
        "y": 0.0,
        "z": 180.0
    },
    "ScreenRotationD": 0.0,
    "ScreenWidthPX": 2560,
    "ScreenHeightPX": 1080
}
InteractionConfig.json
{
    "UseScrollingOrDragging": true,
    "UseSwipeInteraction": false,
    "DeadzoneRadius": 0.003000000026077032,
    "InteractionZoneEnabled": false,
    "InteractionMinDistanceCm": 0.0,
    "InteractionMaxDistanceCm": 25.0,
    "InteractionType": 2,
    "AirPush": {
        "SpeedMin": 150.0,
        "SpeedMax": 500.0,
        "DistAtSpeedMinMm": 42.0,
        "DistAtSpeedMaxMm": 8.0,
        "HorizontalDecayDistMm": 50.0,
        "ThetaOne": 65.0,
        "ThetaTwo": 135.0,
        "UnclickThreshold": 0.9700000286102295,
        "UnclickThresholdDrag": 0.9700000286102295,
        "DecayForceOnClick": true,
        "ForceDecayTime": 0.10000000149011612,
        "UseTouchPlaneForce": true,
        "DistPastTouchPlaneMm": 20.0,
        "DragStartDistanceThresholdMm": 30.0,
        "DragDeadzoneShrinkRate": 0.8999999761581421,
        "DragDeadzoneShrinkDistanceThresholdMm": 10.0,
        "DeadzoneMaxSizeIncreaseMm": 20.0,
        "DeadzoneShrinkRate": 0.800000011920929
    },
    "HoverAndHold": {
        "HoverStartTimeS": 0.5,
        "HoverCompleteTimeS": 0.6000000238418579
    },
    "TouchPlane": {
        "TouchPlaneActivationDistanceCM": 5.0,
        "TouchPlaneTrackedPosition": 3
    },
    "VelocitySwipe": {
        "MinScrollVelocity_mmps": 625.0,
        "UpwardsMinVelocityDecrease_mmps": 50.0,
        "DownwardsMinVelocityIncrease_mmps": 50.0,
        "MaxReleaseVelocity_mmps": 200.0,
        "MaxLateralVelocity_mmps": 300.0,
        "MaxOpposingVelocity_mmps": 65.0,
        "ScrollDelayMs": 450.0,
        "MinSwipeLength": 10.0,
        "MaxSwipeWidth": 10.0,
        "SwipeWidthScaling": 0.20000000298023225,
        "AllowBidirectionalScroll": false,
        "AllowHorizontalScroll": true,
        "AllowVerticalScroll": true
    }
}

@plule
Copy link
Owner

plule commented Jan 30, 2023

Awesome, that seems to have done the trick.

Cool! I'll do an update so that it works with no modification. Maybe dynamic linking makes sense for windows too

For the setup, I've never seen these json. I usually do it from the control panel, it looks like it's installable on linux too, and once setup there, it is setup for all the application, including leaprs.

image

Make sure that the hand is detected there, if not change the camera inversion setting and/or the tracking mode, and try launching the example again.

@MostHated
Copy link
Author

Ah yes, I had set that up prior, but it seem that config was reset to default. I just changed it again and now all is well! This is great. I can't wait to play around with it. I am hoping to use it to issue key presses/run scripts based on hand gestures. This seems like it should allow me to do that.

Connected. Service state: (empty)Got the device LE3100040000004495-3610-693E822028 (3Di)Tracking mode: ScreenTopGot a hand
✔ The hand is closed
✔ The hand is opened
✔ Saved image.png
 *  Terminal will be reused by tasks, press any key to close it. 

@plule
Copy link
Owner

plule commented Jan 30, 2023

Looks good, glad to hear this actually work on Linux, I intend to use it as soon as the old leap motion is supported

@plule
Copy link
Owner

plule commented Jan 30, 2023

@MostHated Just to confirm, the path /usr/share/doc/ultraleap-hand-tracking-service is the default installation path? I can take that as a sensible default for Linux?

@MostHated
Copy link
Author

Yeah, though, that is symlinked to /usr/lib/ultraleap-hand-tracking-service upon install

@plule plule mentioned this issue Jan 30, 2023
@plule plule closed this as completed in #14 Jan 30, 2023
@plule
Copy link
Owner

plule commented Jan 30, 2023

Just released v0.1.1 with the fixed build.rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants