< GeeXLab Reference Guide />

> Back to Reference Guide Index


gh_leap library

Description

gh_leap is the module that manages the Leap Motion device.


Number of functions: 11

  1. gh_leap.get_device_name ()
  2. gh_leap.get_finger_bone_direction ()
  3. gh_leap.get_finger_bone_position ()
  4. gh_leap.get_hand_palm_angles ()
  5. gh_leap.get_hand_palm_normal ()
  6. gh_leap.get_hand_palm_position ()
  7. gh_leap.get_num_devices ()
  8. gh_leap.get_num_fingers ()
  9. gh_leap.get_num_hands ()
  10. gh_leap.is_connected ()
  11. gh_leap.update ()



get_device_name

Description

Returns the name of a particular device.


Syntax

dev_name = gh_leap.get_device_name(
 dev_index
)

Languages


Parameters


Return Values


Code sample


name = gh_leap.get_device_name(0)
			


get_finger_bone_direction

Description

Gets the vector direction of a bone of a particular finger.


Syntax

dir_x, dir_y, dir_z = gh_leap.get_finger_bone_direction(
 hand_index,
 fing_index,
 bone_index
)

Languages


Parameters


Return Values


Code sample


dir_x, dir_y, dir_z = gh_leap.get_finger_bone_direction(hand_index, finger_index, bone_index)
			


get_finger_bone_position

Description

Gets the position of a bone of a particular finger.


Syntax

end_x, end_y, end_z, start_x, start_y, start_z = gh_leap.get_finger_bone_position(
 hand_index,
 fing_index,
 bone_index
)

Languages


Parameters


Return Values


Code sample


start_x, start_y, start_z, end_x, end_y, end_z = gh_leap.get_finger_bone_position(hand_index, finger_index, bone_index)
			


get_hand_palm_angles

Description

Gets the plam euler angles for a particular hand.


Syntax

pitch, yaw, roll = gh_leap.get_hand_palm_angles(
 hand_index
)

Languages


Parameters


Return Values


Code sample


pitch, yaw, roll = gh_leap.get_hand_palm_angles(hand)
			


get_hand_palm_normal

Description

Gets the plam normal vector for a particular hand.


Syntax

x, y, z = gh_leap.get_hand_palm_normal(
 hand_index
)

Languages


Parameters


Return Values


Code sample


x,y,z = gh_leap.get_hand_palm_normal(hand)
			


get_hand_palm_position

Description

Gets the plam position for a particular hand.


Syntax

x, y, z = gh_leap.get_hand_palm_position(
 hand_index
)

Languages


Parameters


Return Values


Code sample


x,y,z = gh_leap.get_hand_palm_position(hand)
			


get_num_devices

Description

Returns the number of devices.


Syntax

num_devices = gh_leap.get_num_devices()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


n = gh_leap.get_num_devices()
			


get_num_fingers

Description

Returns the numbers of fingers for a particular hand.


Syntax

num_fingers = gh_leap.get_num_fingers(
 hand_index
)

Languages


Parameters


Return Values


Code sample


fingers = gh_leap.get_num_fingers(hand)
			


get_num_hands

Description

Returns the numbers of hands.


Syntax

num_hands = gh_leap.get_num_hands()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


hands = gh_leap.get_num_hands()
			


is_connected

Description

Checks if a LeapMotion device is connected.


Syntax

ret = gh_leap.is_connected()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


state = gh_leap.is_connected()
			


update

Description

Updates the Leap Motion engine. Call it once per frame.


Syntax

gh_leap.update()

Languages


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_leap.update()
			






GeeXLab Rootard Guide | Downloads | Contact | Newsletter