Leap Motion CHOP

From TouchDesigner 099 Wiki

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

To use it you will need to install the Leap Motion software which is available here:


PythonIcon.png leapmotionCHOP_Class

Parameters - Setup Page

Active - If set, this CHOP will update the values in its channels.

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

Debug Channels - 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 - 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.

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.

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

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

Fingers Per Hand - Number of fingers per hand. The following channels will be included for each detected finger (if selected). NOTE: The hand and finger channel names are formatted in a way that can be used to Exported to parameters in a hand-finger Object hierarchy:

  • hand*/finger*:t[xyz] - Coordinates of the finger relative to the sensor.

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

  • hand*/finger*:r[xyz] - Rotation of the detected finger.

Finger Size - 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.

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 - 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 - 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 - 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 - Number of key tap gestures. 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.