File tree 2 files changed +16
-8
lines changed
2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -101,10 +101,14 @@ def _ramp_motors(self):
101
101
if thrust >= 25000 :
102
102
thrust_mult = - 1
103
103
thrust += thrust_step * thrust_mult
104
- self ._cf .commander .send_setpoint (0 , 0 , 0 , 0 )
105
- # Make sure that the last packet leaves before the link is closed
106
- # since the message queue is not flushed before closing
107
- time .sleep (0.1 )
104
+ for _ in range (30 ):
105
+ # Continuously send the zero setpoint until the drone is recognized as landed
106
+ # to prevent the supervisor from intervening due to missing regular setpoints
107
+ self ._cf .commander .send_setpoint (0 , 0 , 0 , 0 )
108
+ time .sleep (0.1 )
109
+ # Sleeping before closing the link makes sure the last
110
+ # packet leaves before the link is closed, since the
111
+ # message queue is not flushed before closing
108
112
self ._cf .close_link ()
109
113
110
114
Original file line number Diff line number Diff line change @@ -99,10 +99,14 @@ def _ramp_motors(self):
99
99
if thrust >= 25000 :
100
100
thrust_mult = - 1
101
101
thrust += thrust_step * thrust_mult
102
- self ._cf .commander .send_setpoint (0 , 0 , 0 , 0 )
103
- # Make sure that the last packet leaves before the link is closed
104
- # since the message queue is not flushed before closing
105
- time .sleep (1 )
102
+ for _ in range (30 ):
103
+ # Continuously send the zero setpoint until the drone is recognized as landed
104
+ # to prevent the supervisor from intervening due to missing regular setpoints
105
+ self ._cf .commander .send_setpoint (0 , 0 , 0 , 0 )
106
+ time .sleep (0.1 )
107
+ # Sleeping before closing the link makes sure the last
108
+ # packet leaves before the link is closed, since the
109
+ # message queue is not flushed before closing
106
110
self ._cf .close_link ()
107
111
108
112
You can’t perform that action at this time.
0 commit comments