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
12 changes: 8 additions & 4 deletions examples/motors/multiramp.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,14 @@ def _ramp_motors(self):
if thrust >= 25000:
thrust_mult = -1
thrust += thrust_step * thrust_mult
self._cf.commander.send_setpoint(0, 0, 0, 0)
# Make sure that the last packet leaves before the link is closed
# since the message queue is not flushed before closing
time.sleep(0.1)
for _ in range(30):
# Continuously send the zero setpoint until the drone is recognized as landed
# to prevent the supervisor from intervening due to missing regular setpoints
self._cf.commander.send_setpoint(0, 0, 0, 0)
time.sleep(0.1)
# Sleeping before closing the link makes sure the last
# packet leaves before the link is closed, since the
# message queue is not flushed before closing
self._cf.close_link()


Expand Down
12 changes: 8 additions & 4 deletions examples/motors/ramp.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ def _ramp_motors(self):
if thrust >= 25000:
thrust_mult = -1
thrust += thrust_step * thrust_mult
self._cf.commander.send_setpoint(0, 0, 0, 0)
# Make sure that the last packet leaves before the link is closed
# since the message queue is not flushed before closing
time.sleep(1)
for _ in range(30):
# Continuously send the zero setpoint until the drone is recognized as landed
# to prevent the supervisor from intervening due to missing regular setpoints
self._cf.commander.send_setpoint(0, 0, 0, 0)
time.sleep(0.1)
# Sleeping before closing the link makes sure the last
# packet leaves before the link is closed, since the
# message queue is not flushed before closing
self._cf.close_link()


Expand Down