crazyflie

The Crazyflie module is used to easily connect/send/receive data from a Crazyflie.

Each function in the Crazyflie has a class in the module that can be used to access that functionality. The same design is then used in the Crazyflie firmware which makes the mapping 1:1 in most cases.


Sub-modules

Classes

Crazyflie

Crazyflie(link=None, ro_cache=None, rw_cache=None)

The Crazyflie class

Create the objects from this module and register callbacks.

Parameters

Name Description
ro_cache Path to read-only cache (string)
rw_cache Path to read-write cache (string)

Methods

def add_port_callback(self, port, cb)

Add a callback to cb on port


def close_link(self)

Close the communication link.


def is_called_by_incoming_handler_thread(self)

def is_connected(self)

def open_link(self, link_uri)

Open the communication link to a copter at the given URI and setup the connection (download log/parameter TOC).


def remove_port_callback(self, port, cb)

Remove the callback cb on port


def send_packet(self, pk, expected_reply=(), resend=False, timeout=0.2)

Send a packet through the link interface.

Parameters

Name Description
pk Packet to send
expect_answer True if a packet from the Crazyflie is expected to be sent back, otherwise false