Leap Motion: Try the Diagnostic Visualizer

Leap Motion: Try the Diagnostic Visualizer

With the integrated Diagnostic Visualizer it is easy to test all the features that the leap motion platform is offering. This application is included when you install the Leap Motion software. If you want to open this application yourself, then just follow the steps below.

1. Open the settings

Leap Motion options

2. Open the visualizer

In the Settings, go to the “Troubleshooting”-Tab and there is a button called “Diagnostic Visualizer”, which opens the Visualizer:Leap Motion settings-dialog

3. Try out some of the following commands

  • “j” –  for the cool looking visualisation, as shown in the screenshot on the top of this post
  • “y” – for better looking paths
  • “t” – to show the tracked fingers

Leap Motion: Try the Diagnostic Visualizer

Screen Shot 2014-01-18 at 16.57.25

With the integrated Diagnostic Visualizer it is easy to test all the features that the leap motion platform is offering. This application is included when you install the Leap Motion software. If you want to open this application yourself, then just follow the steps below: Screen Shot 2014-01-18 at 16.47.33In the Settings, go to the “Troubleshooting”-Tab and there is a button called “Diagnostic Visualizer”, which opens the Visualizer: Screen Shot 2014-01-18 at 16.49.54Try out some of the following commands:

  • “j” –  for the cool looking visualisation, as shown in the screenshot on the top of this post
  • “y” – for better looking paths
  • “t” – to show the tracked fingers

 

Leap Motion: Visualize vertical hand movement

Leap Motion: Visualize vertical hand movement

I finally had a bit of time to continue my work with the Leap Motion Framework. My goal this time is to visualize the positions and movements of the hands. To achieve this, I had to decide on a framework that I want to use for the application. I ended up with choosing the Swing-Framework, because it’s easy to draw figures on a canvas and I don’t need to care about platform specific things.

I then roughly wrote down some points I wanted to implement.

  • Display the actual distance between the controller and the hand
  • Display the amount of visible fingers of each hand
  • Either display 1  or 2 hands (according on how many are over the controller)
  • Display the vertical value of the y-axis for each hand
  • Handle a disconnected Leap Motion device correctly

Implementation

screenshot of the coordinate the fingers applicationThere are a few ways to get the relevant position data from the hands. For the application I decided to use the following line:

hand.palmPosition()

This returns a vector which has the values of the palm. Another possibility would be to use stabilizedPalmPosition(). The difference between the vectors of those two methods, is shown here:

palmPosition(): (10.4119, 252.632, 262.645)
stabilizedPalmPosition(): (18.7797, 247.261, 262.403)

The official API documentation described the difference to the normal palmPosition() as below:

Smoothing and stabilization is performed in order to make this value more suitable for interaction with 2D content. The stabilized position lags behind the palm position by a variable amount, depending primarily on the speed of movement. – Leap Motion API Documentation

This means, that for applications where the performance of the UI and the speed of the hands is very important, you better use the normal palmPosition(). But when it comes to accuracy of the data the usage of stabilizedPalmPosition() is recommended.

Vector(x, y, z)
x – Corresponds to the left to right dimension of the Leap Motion controller.
y – Corresponds to height above the device.
z – Corresponds to the front-back dimension of the Leap Motion controller.
Coordinate the fingers

The application is quite quick and very accurate with drawing the heights of the hands. It also displays the y-position and the amount of fingers the sensor recognizes. When the Leap Motion controller is connected correctly, then a green light shows up in the bottom right corner.

The next step for me is to work with the other two axes in another application. You can find the code for this application on GitHub. Keep in mind, that if you want to run it, you need to set up a Leap Motion project first. See this post for more information: Set up a Leap Motion project

Link to the GitHub project: https://github.com/mrwonderman/leap-motion-basics

Leap Motion: The first application

Finally I got my Leap Motion sensor today. I waited like ever for this little magical device. If you don’t know it, then check out the following video:

The package contains 2 USB cables (two different sizes), an information guide and the motion leap controller.

You can install the software and try some of the applications from Airspace, which all work pretty nice. But the most interesting part is of course the SDK. You can download the Java SDK here: https://developer.leapmotion.com/documentation/Languages/Java/Guides/Leap_Frames.html

It is quite easy to create a java project with the right libraries and start writing code. You can find more information about that here: https://developer.leapmotion.com/documentation/Languages/Java/Guides/Setup_Java.html

My first simple Java program simply counts the amount of fingers and hands the sensor detects. You can find the code on GitHub here: https://github.com/mrwonderman/leap-motion-basics. The result in the console looks like that and works quite well.