MCPcopy Create free account
hub / github.com/bitcraze/crazyflie-lib-python / __init__

Method __init__

examples/erase-ow.py:47–65  ·  view source on GitHub ↗

Initialize and run the example with the specified link_uri

(self, link_uri)

Source from the content-addressed store, hash-verified

45 """
46
47 def __init__(self, link_uri):
48 """ Initialize and run the example with the specified link_uri """
49
50 # Create a Crazyflie object without specifying any cache dirs
51 self._cf = Crazyflie()
52
53 # Connect some callbacks from the Crazyflie API
54 self._cf.connected.add_callback(self._connected)
55 self._cf.disconnected.add_callback(self._disconnected)
56 self._cf.connection_failed.add_callback(self._connection_failed)
57 self._cf.connection_lost.add_callback(self._connection_lost)
58
59 print('Connecting to %s' % link_uri)
60
61 # Try to connect to the Crazyflie
62 self._cf.open_link(link_uri)
63
64 # Variable used to keep main loop occupied until disconnect
65 self.is_connected = True
66
67 def _connected(self, link_uri):
68 """ This callback is called form the Crazyflie API when a Crazyflie

Callers

nothing calls this directly

Calls 3

CrazyflieClass · 0.90
add_callbackMethod · 0.80
open_linkMethod · 0.45

Tested by

no test coverage detected