Initialize and run the example with the specified link_uri
(self, link_uri)
| 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 |
nothing calls this directly
no test coverage detected