release

This gesture is activated when the hand is reopened after grip was triggered. This gesture resembles the action of releasing the left button of the mouse.

Let’s see a simple example to understand how it works!

We are going to create a simple application which changes the text on the screen when an RELEASE action is captured by the sensors (which by design can only happen after grip was triggered, so you might need to refer to its link if in any doubt).

In order to trigger the function from Javascript we are going to create a message called “msg” in the HTML code, this by default is set to show on the top left of  the screen the text ‘Grip and then Release!’ and will change first when GRIP and then RELEASE are captured by the sensor.

The text in blue shows the line added onto the HTML code:

HTML

<html>

<head>
</head>

<body>
     <h1 id="msg">Grip and then Release!</h1>
  <canvas id="skeletonsCanvas" width="640" height="480"></canvas>


</body>

</html>

Now, within the grip function in JAVASCRIPT we are going to add the line which calls “msg” created on the HTML code, and will show on the screen the message “GRIP triggered successfully!” when a grip action is captured by the sensors.

Afterwards, release function has to be edited as well in a similar fashion, showing its corresponding message “RELEASE triggered successfully”.

JAVASCRIPT (UBOX EVENTS Tab)

function grip()() {
  console.debug('Grip! :)');
  //sendToArduino('1');
  document.getElementById("msg").innerHTML = "GRIP triggered successfully!";
}

function release() {
console.debug('Release');
document.getElementById("msg").innerHTML = "RELEASE triggered successfully!";
}

 

If you are not using the uboxPlayer on the PC with the Kinect sensor you can test it out on the web. For doing so, open the following link, right click on the mouse and select “New User” from the dropdown menu. It will change as mentioned.

Grid and Release App Link