示例#1
0
def main():
    # Instantiate our script class
    # We don't need to create a class, you could also store the connection object in a global variable
    QScript()

    # Start the processing loop
    qtm.start()
示例#2
0
def main():
    # Instantiate our script class
    # We don't need to create a class, you could also store the connection object in a global variable
    QScript()

    # Start the processing loop
    print("Sending data to pyBinSim now...")
    qtm.start()
                    (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()