Close

Leap Motion CHOP

Summary

The Leap Motion CHOP reads hand, finger, tool and gesture data from the Leap Motion controller. It outputs hand, finger and tool positions, rotations and 'tracking' channels that indicate if these values are currently being detected and updated. Currently only 1 Leap Motion device can be connected at a time.

See also Leap Motion, Leap Motion TOP

To use it you will need to install the Leap Motion software which is available here: https://developer.leapmotion.com/releases

  • API Version 4 Orion - Download Orion Beta v4.1.0
  • API Version 2 Tracking - Download Orion Beta v3.2.1

PythonIcon.pngleapmotionCHOP_Class


Parameters - Setup Page

Active active - When 'On' data is captured from the Leap Motion sensor.

API api - - Select between Leap Motion V2 or V4 SDKs for tracking. V4 offers the latest and most stable tracking, V2 offers some legacy features like gestures.

HMD Mode hmd - - Switches the device to Head Mounted Display mode.

  • Default default -
  • On on -
  • Off off -

Debug Channels debugchannels - If set, the following channels will be included:

  • connected - 1 if the Leap Motion sensor is connected, 0 otherwise.
  • sequence_id - Unique id corresponding to the current frame.

Status Channels statuschannels - If set, the following channels will be included:

  • hands - Number of hands detected by the sensor.
  • fingers - Number of fingers detected by the sensor.
  • tools - Number of tools detected by the sensor.
  • gestures - Number of gestures detected by the sensor.
  • [hand / finger / tool / circle / swipe / keytap / screeptap]:tracking - 1 if the data for the hand, finger, tool or gesture is actively being tracked, 0 otherwise.

Named Hands namedhands - This names the hand channels as either right (r) or left (l) hands.

Hands hands - Number of hands. The following channels will be included for each detected hand:

  • hand*:t[xyz] - Coordinates of the hand relative to the sensor.
  • hand*:r[xyz] - Rotation of the detected hand.

Left Hands lefthands - When using 'Named Hands', specify how many left hands will be tracked.

Right Hands righthands - When using 'Named Hands', specify how many right hands will be tracked.

Hand Velocity handvelocity - If set, the following channels will be included for each hand, in addition to any others:

  • hand*:v[xyz] - Velocity of the detected hand.

Hand Sphere handsphere - This is only available when using API = Version 2 Tracking. It adds the following channels to tracking hands:

  • hand*/sphere:t[xyz] - Position of the detected hand sphere.
  • hand*/sphere:radius - Radius size of the detected hand sphere.

Pinch Strength pinchstrength - Pinch is defined as the distance between the thumb and first finger.

  • hand*:pinch - How much pinch is detected between the thumb and first finger.

Grab Strength grabstrength - Grab is defined as how close a hand is to being a fist.

  • hand*:grab - How much grab is detected, strength is 0 for a flat hand and 1 for a fist.

Named Fingers namedfingers - Instead of simply using a finger index number for each finger tracked, when On this names the finger channels as thumb, index, middle, ring, and pinky.

Fingers per Hand fingersperhand - When not using 'Named Fingers', specify how many fingers to track per hand.

Finger Rotation fingerrotation - Track the rotation for all fingers.

  • hand*/finger*:r[xyz] - The rotation of the finger.

Finger Size fingersize - If set, the following channels will be included for each finger, in addition to any others:

  • hand*/finger*:length - Length of the detected finger.
  • hand*/finger*:width - Width of the detected finger.

Finger Extended fingerextended - Track how straight the fingers are, a finger is considered extended when it is straight as if pointing.

  • hand*/finger*:extended - How straight the finger is.

Finger Joints fingerjoints - Tracks the position of every joint of every finger.

  • hand*/finger*/joint_mcp:t[xyz] - The mcp joint position of the finger.
  • hand*/finger*/joint_pip:t[xyz] - The pip joint position of the finger.
  • hand*/finger*/joint_dip:t[xyz] - The dip joint position of the finger.
  • hand*/finger*/joint_tip:t[xyz] - The finger tip position.

Tools tools - Number of tools. The following channels will be included for each detected tool:

  • tool*:t[xyz] - Coordinates of the tool relative to the sensor.
  • tool*:length - Length of the detected tool.
  • tool*:width - Width of the detected tool.

Circle Gestures circlegestures - Number of circle gestures. The following channels will be included for each detected Circle Gesture:

  • circle*:handindex - Index of the hand associated with the gesture. See Notes.
  • circle*:t[xyz] - Coordinates of the center of the Circle Gesture relative to the sensor.
  • circle*:radius - Radius of the circle in the gesture.
  • circle*:progress - Number of cycles done in the gesture.

Swipe Gestures swipegestures - Number of swipe gestures. The following channels will be included for each detected Swipe Gesture:

  • swipe*:handindex - Index of the hand associated with the gesture. See Notes.
  • swipe*:fingerindex - Index of the finger associated with the gesture. See Notes.
  • swipe*:t[xyz] - Coordinates of the Swipe Gesture relative to the sensor.
  • swipe*:start[xyz] - Coordinates of the start of the Swipe Gesture relative to the sensor.
  • swipe*:speed - Speed of the swipe.

Key Tap Gestures keytapgestures - Number of key tap gestures. The following channels will be included for each detected Key Tap Gesture:

  • keytap*:handindex - Index of the hand associated with the gesture. See Notes.
  • keytap*:fingerindex - Index of the finger associated with the gesture. See Notes.
  • keytap*:t[xyz] - Coordinates of the Key Tap Gesture relative to the sensor.

Screen Tap Gestures screentapgestures - Number of screen tap gestures, which is recognized as a quick forward tapping movement by a tool or finger. The following channels will be included for each detected screen tap gesture:

  • screentap*:handindex - Index of the hand associated with the gesture. See Notes.
  • screentap*:fingerindex - Index of the finger associated with the gesture. See Notes.
  • screentap*:t[xyz] - Coordinates of the Screen Tap Gesture relative to the sensor.

NOTES: Rotation order is Rx Ry Rz. All vectors are given in the following coordinate system.

For gestures, if handindex is 1, then channels with the prefix hand1 contain the data for the hand associated with the gesture. If handindex is -1 it means there are no channels available for the hand associated with the gesture. The same follows for fingerindex.

Data for all indexed prefixes (hand*, hand/finger*, etc.) will continue to correspond to the same hand/finger/tool/gesture as long as the Leap Motion sensor is detecting it.

Limits for hands/fingers/tools/gestures will filter data from the Leap Motion sensor if there are more than the specified limit detected.


Parameters - Common Page

Time Slice timeslice - Turning this on forces the channels to be "Time Sliced". A Time Slice is the time between the last cook frame and the current cook frame.

Scope scope - To determine which channels get affected, some CHOPs use a Scope string on the Common page.

Sample Rate Match srselect - - Handle cases where multiple input CHOPs' sample rates are different. When Resampling occurs, the curves are interpolated according to the Interpolation Method Option, or "Linear" if the Interpolate Options are not available.

  • Resample At First Input's Rate first - Use rate of first input to resample others.
  • Resample At Maximum Rate max - Resample to the highest sample rate.
  • Resample At Minimum Rate min - Resample to the lowest sample rate.
  • Error If Rates Differ err - Doesn't accept conflicting sample rates.

Export Method exportmethod - - This will determine how to connect the CHOP channel to the parameter. Refer to the Export article for more information.

  • DAT Table by Index datindex - Uses the docked DAT table and references the channel via the index of the channel in the CHOP.
  • DAT Table by Name datname - Uses the docked DAT table and references the channel via the name of the channel in the CHOP.
  • Channel Name is Path:Parameter autoname - The channel is the full destination of where to export to, such has geo1/transform1:tx.

Export Root autoexportroot - This path points to the root node where all of the paths that exporting by Channel Name is Path:Parameter are relative to.

Export Table exporttable - The DAT used to hold the export information when using the DAT Table Export Methods (See above).

TouchDesigner Build: