Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
crazyflie-lib-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lukas Wegmann
crazyflie-lib-python
Commits
020a3529
Commit
020a3529
authored
7 years ago
by
Kristoffer Richardsson
Browse files
Options
Downloads
Patches
Plain Diff
#58 Added function for setting nr of lost packets before disconnect
parent
47196d72
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cflib/crtp/radiodriver.py
+9
-5
9 additions, 5 deletions
cflib/crtp/radiodriver.py
with
9 additions
and
5 deletions
cflib/crtp/radiodriver.py
+
9
−
5
View file @
020a3529
...
@@ -55,6 +55,8 @@ __all__ = ['RadioDriver']
...
@@ -55,6 +55,8 @@ __all__ = ['RadioDriver']
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
_nr_of_retries
=
100
DEFAULT_ADDR_A
=
[
0xe7
,
0xe7
,
0xe7
,
0xe7
,
0xe7
]
DEFAULT_ADDR_A
=
[
0xe7
,
0xe7
,
0xe7
,
0xe7
,
0xe7
]
DEFAULT_ADDR
=
0xE7E7E7E7E7
DEFAULT_ADDR
=
0xE7E7E7E7E7
...
@@ -389,8 +391,6 @@ class _RadioDriverThread(threading.Thread):
...
@@ -389,8 +391,6 @@ class _RadioDriverThread(threading.Thread):
Radio link receiver thread used to read data from the
Radio link receiver thread used to read data from the
Crazyradio USB driver.
"""
Crazyradio USB driver.
"""
TRIES_BEFORE_DISCON
=
100
def
__init__
(
self
,
radio_manager
,
inQueue
,
outQueue
,
def
__init__
(
self
,
radio_manager
,
inQueue
,
outQueue
,
link_quality_callback
,
link_error_callback
,
link
):
link_quality_callback
,
link_error_callback
,
link
):
"""
Create the object
"""
"""
Create the object
"""
...
@@ -401,7 +401,7 @@ class _RadioDriverThread(threading.Thread):
...
@@ -401,7 +401,7 @@ class _RadioDriverThread(threading.Thread):
self
.
_sp
=
False
self
.
_sp
=
False
self
.
_link_error_callback
=
link_error_callback
self
.
_link_error_callback
=
link_error_callback
self
.
_link_quality_callback
=
link_quality_callback
self
.
_link_quality_callback
=
link_quality_callback
self
.
_retry_before_disconnect
=
_
RadioDriverThread
.
TRIES_BEFORE_DISCON
self
.
_retry_before_disconnect
=
_
nr_of_retries
self
.
_retries
=
collections
.
deque
()
self
.
_retries
=
collections
.
deque
()
self
.
_retry_sum
=
0
self
.
_retry_sum
=
0
...
@@ -497,8 +497,7 @@ class _RadioDriverThread(threading.Thread):
...
@@ -497,8 +497,7 @@ class _RadioDriverThread(threading.Thread):
self
.
_link_error_callback
is
not
None
):
self
.
_link_error_callback
is
not
None
):
self
.
_link_error_callback
(
'
Too many packets lost
'
)
self
.
_link_error_callback
(
'
Too many packets lost
'
)
continue
continue
self
.
_retry_before_disconnect
=
\
self
.
_retry_before_disconnect
=
_nr_of_retries
_RadioDriverThread
.
TRIES_BEFORE_DISCON
data
=
ackStatus
.
data
data
=
ackStatus
.
data
...
@@ -536,3 +535,8 @@ class _RadioDriverThread(threading.Thread):
...
@@ -536,3 +535,8 @@ class _RadioDriverThread(threading.Thread):
dataOut
.
append
(
ord
(
X
))
dataOut
.
append
(
ord
(
X
))
else
:
else
:
dataOut
.
append
(
0xFF
)
dataOut
.
append
(
0xFF
)
def
set_retries_before_disconnect
(
nr_of_retries
):
global
_nr_of_retries
_nr_of_retries
=
nr_of_retries
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment