Exemple #1
0
    def __init__(self):
        self.qrt = qtm.QRT("127.0.0.1", 22223)  # Qualysis Port
        self.qrt.connect(on_connect=self.on_connect,
                         on_disconnect=self.on_disconnect,
                         on_event=self.on_event)

        # Vectors to enter available filter data
        self.nChannels = 6
        self.yawVectorAvailableData = range(0, 360, 5)
        self.xPositionAvailableData = range(1, 17)
        self.YPositionAvailableData = range(1, 17)
        self.xPositionOffset = -225
        self.yPositionOffset = -225
        self.yawOffset = 0

        # one step relates to 25cm
        self.stepSize = 25

        # Create OSC client
        self.client = OSCMultiClient()
        self.client.setOSCTarget((ip, port))

        # Defaults
        self.posX, self.posY, self.posZ, self.roll, self.pitch, self.yaw = [
            0, 0, 0, 0, 0, 0
        ]
Exemple #2
0
 def __init__(self):
     self.qrt = qtm.QRT("127.0.0.1", 22223)
     self.qrt.connect(on_connect=self.on_connect,
                      on_disconnect=self.on_disconnect,
                      on_event=self.on_event)
     self.init = False
     self.connection = None
 def __init__(self):
     self.qrt = qtm.QRT(
         "192.168.10.2", 22223
     )  ## set to the IP address of the computer running Qualisys (can be this one)
     self.qrt.connect(on_connect=self.on_connect,
                      on_disconnect=self.on_disconnect,
                      on_event=self.on_event)
    def __init__(self):
        global g

        print("Connecting to QTM...")
        self.qrt = qtm.QRT("127.0.0.1", g.QTM_RT_PORT)
        self.qrt.connect(
                on_connect=self.on_connect,
                on_disconnect=self.on_disconnect,
                on_event=self.on_event)
Exemple #5
0
    def __init__(self):
        self.qrt = qtm.QRT("10.100.20.174", 22223)
        self.qrt.connect(on_connect=self.on_connect,
                         on_disconnect=self.on_disconnect,
                         on_event=self.on_event)
        self.init = False
        self.connection = None

        #sonification script
        self.son_model = son.generate_random_son_model()
        enc_model_name = "cross_fit_enc_60_markers_test.pth"

        self.enc_model = son.load_enc_model(enc_model_name)
        self.frames = []
        self.client = son.init_sonification()
                print_status("Following {} with offset ()...".format(
                    (TARGET_RIGIDBODY_NAME, FOLLOW_OFFSET)))
                target = follow_position
            else:
                print_status("Going home to ({})...".format(HOME_POSITION))
                target = HOME_POSITION
            target = convert_coords_to_setpoint(target)
            cf.commander.send_setpoint(*target)
        else:
            cf.commander.send_stop_setpoint()
            print("Tracking lost, terminating.")
            os._exit(1)


if __name__ == '__main__':
    print("~ Qualisys x CrazyFlie ~")

    # Initialize the low-level drivers (don't list the debug drivers)
    cflib.crtp.init_drivers(enable_debug_driver=False)

    # Connect to QTM on a specific ip
    qrt = qtm.QRT(QTM_IP, 22223, version='1.17')
    qrt.connect(on_connect=on_qtm_connect,
                on_disconnect=on_qtm_disconnect,
                on_event=on_qtm_event)

    # Start Crazyflie flight controller on a new thread
    threads.deferToThread(crazyflie_controller)

    # Start running the processes
    qtm.start()
Exemple #7
0
 def __init__(self):
     self.qrt = qtm.QRT("10.100.20.174", 22223)
     self.qrt.connect(on_connect=self.on_connect, on_disconnect=self.on_disconnect, on_event=self.on_event)