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
- cflib.crazyflie.appchannel
- cflib.crazyflie.commander
- cflib.crazyflie.console
- cflib.crazyflie.extpos
- cflib.crazyflie.high_level_commander
- cflib.crazyflie.link_statistics
- cflib.crazyflie.localization
- cflib.crazyflie.log
- cflib.crazyflie.mem
- cflib.crazyflie.param
- cflib.crazyflie.platformservice
- cflib.crazyflie.swarm
- cflib.crazyflie.syncCrazyflie
- cflib.crazyflie.syncLogger
- cflib.crazyflie.toc
- cflib.crazyflie.toccache
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) |
Instance variables
link_quality_updated
Methods
def add_header_callback(self, cb, port, channel, port_mask=255, channel_mask=255)
Add a callback to cb on port and channel
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_header_callback(self, cb, port, channel, port_mask=255, channel_mask=255)
Remove the callback cb on port and channel
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 |