Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cflib/crazyflie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ class _IncomingPacketHandler(Thread):
"""Handles incoming packets and sends the data to the correct receivers"""

def __init__(self, cf):
Thread.__init__(self)
Thread.__init__(self, name='IncomingPacketHandlerThread')
self.daemon = True
self.cf = cf
self.cb = []

Expand Down
9 changes: 4 additions & 5 deletions cflib/crazyflie/param.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,6 @@ def __init__(self, crazyflie):
self.all_update_callback = Caller()
self.param_updater = None

self.param_updater = _ParamUpdater(self.cf, self._useV2, self._param_updated)
self.param_updater.start()

self.cf.disconnected.add_callback(self._disconnected)
self.cf.connection_requested.add_callback(self._connection_requested)

Expand Down Expand Up @@ -289,12 +286,15 @@ def refresh_done():

def _connection_requested(self, uri):
# Reset the internal state on connect to make sure we have a clean state
self.param_updater = _ParamUpdater(self.cf, self._useV2, self._param_updated)
self.param_updater.start()
self.is_updated = False
self.toc = Toc()
self.values = {}
self._initialized.clear()

def _disconnected(self, uri):
logger.info('Disconnected, cleaning up threads')
"""Disconnected callback from Crazyflie API"""
if self.param_updater is not None:
self.param_updater.close()
Expand All @@ -311,8 +311,7 @@ def request_param_update(self, complete_name):
Request an update of the value for the supplied parameter.
"""
if self.param_updater is None:
self.param_updater = _ParamUpdater(self.cf, self._useV2, self._param_updated)
self.param_updater.start()
raise Exception('Param updater not initialized, did you call open_connection?')
self.param_updater.request_param_update(
self.toc.get_element_id(complete_name))

Expand Down
1 change: 1 addition & 0 deletions cflib/crtp/radiodriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ def __init__(self, radio, inQueue, outQueue,

self._has_safelink = False
self._link = link
self.daemon = True

def stop(self):
""" Stop the thread """
Expand Down