streamTime = 1 #***********************************************************************************# import time import threading import datetime import Queue import threespace as ts_api # device_list = ts_api.getComPorts(filter=ts_api.TSS_FIND_DNG) device_list = ts_api.getComPorts(ts_api.TSS_FIND_DNG) ## Only one 3-Space Sensor device is needed so we are just going to take the ## first one from the list. com_port = device_list[0] dng_device = ts_api.TSDongle(com_port=com_port) streaming = True dt = datetime.datetime dt = dt.now() #print dt.date() f = open('log' + str(dt.microsecond) + '.txt', 'w') streamQueue = Queue.Queue(0) f.write("Timestamp, Battery Level, Corrected Gyro X, Corrected Gyro Y, Corrected Gyro Z, Corrected Accel X, Corrected Accel Y, Corrected Accel Z, Corrected Compass X, Corrected Compass Y, Corrected Compass Z \n")
__author__ = 'Wall-e' import threespace as ts import time print 'hello!' ts_ports = ts.getComPorts(ts.TSS_FIND_DNG) print ts_ports dng = ts.TSDongle(com_port=ts_ports[0][0]) if dng is not None: s1 = dng[1] # quat = s1.getTaredOrientationAsQuaternion() s1.setStreamingTiming(500,0,0) print s1.getStreamingSlots() print s1.getStreamingTiming() s1.startStreaming() s1.startRecordingData() i = 0 while i < 10: # time.sleep(0.5) i += 1 print s1.getLatestStreamData(timeout=10) s1.stopStreaming() s1.stopRecordingData() dng.close()