I use Leap motion controller for hand gesture data acquisition. I use below python code but faced some problems. First, Leap library only works for python 2 therefor, I made an environment of version 2 in my anaconda to use my code. secondly, it just save a frame.data file which I think is empty. because it does not takes any time. also I don't think that my program even connects to LMC device.
import sys
import os
import Leap
import ctypes
controller = Leap.Controller()
frame = controller.frame()
hands = frame.hands
pointables = frame.pointables
fingers = frame.fingers
tools = frame.tools
serialized_tuple = frame.serialize
serialized_data = serialized_tuple[0]
serialized_length = serialized_tuple[1]
data_address = serialized_data.cast().__long__()
buffer = (ctypes.c_ubyte * serialized_length).from_address(data_address)
with open(os.path.realpath('frame.data'), 'wb') as data_file:
data_file.write(buffer)