def initQual(*args): with qtm.QTMClient() as qt: qt.setup() qt.getAttitude() currentX = qt.getBody(0)['linear_x'] currentY = qt.getBody(0)['linear_y'] currentZ = qt.getBody(0)['linear_z'] angularX = qt.getBody(0)['angular_x'] angularY = qt.getBody(0)['angular_y'] angularZ = qt.getBody(0)['angular_z']
def UpdateQualInfo(): with qtm.QTMClient() as qt: qt.setup() time.sleep(3) while(True): qt.getAttitude() currentX = qt.getBody(0)['linear_x'] currentY = qt.getBody(0)['linear_y'] currentZ = qt.getBody(0)['linear_z'] angularX = qt.getBody(0)['angular_x'] angularY = qt.getBody(0)['angular_y'] angularZ = qt.getBody(0)['angular_z']
def UpdateQualInfo(): global currentX global currentY global currentZ global angularX global angularY global angularZ with qtm.QTMClient() as qt: qt.setup() time.sleep(3) debug.info("Updating Info") while(True): qt.getAttitude() currentX = qt.getBody(0)['linear_x'] currentY = qt.getBody(0)['linear_y'] currentZ = qt.getBody(0)['linear_z'] angularX = qt.getBody(0)['angular_x'] angularY = qt.getBody(0)['angular_y'] angularZ = qt.getBody(0)['angular_z'] logging.debug("x, y, z, phi, theta, psi:" + linear_x + " " + linear_y + " " + linear_z + " " + angular_x + " " + angular_y + " " + angular_z)
Update motor output ''' import qtmLocal as qtm import Trajectory_Plannning from recieve import * bool Stay = False bool Take_Off = False bool Land = False def Plot_Route(): Stay = True #Check connection with Qualisys: with qtm.QTMClient() as qt: qt.setup() qt.getAttitude() currentX = qt.getBody(0)['linear_x'] currentY = qt.getBody(0)['linear_y'] currentZ = qt.getBody(0)['linear_z'] angularX = qt.getBody(0)['angular_x'] angularY = qt.getBody(0)['angular_y'] angularZ = qt.getBody(0)['angular_z'] #Check if error #display if nan #Log_data at some time #save to file? #Recieve Data