MCPcopy
hub / github.com/dronekit/dronekit-python / clear

Method clear

dronekit/__init__.py:2670–2687  ·  view source on GitHub ↗

Clear the command list. This command will be sent to the vehicle only after you call :py:func:`upload() `.

(self)

Source from the content-addressed store, hash-verified

2668 return self._vehicle.wait_ready('commands', **kwargs)
2669
2670 def clear(self):
2671 '''
2672 Clear the command list.
2673
2674 This command will be sent to the vehicle only after you call :py:func:`upload() <Vehicle.commands.upload>`.
2675 ''&#x27;
2676
2677 # Add home point again.
2678 self.wait_ready()
2679 home = None
2680 try:
2681 home = self._vehicle._wploader.wp(0)
2682 except:
2683 pass
2684 self._vehicle._wploader.clear()
2685 if home:
2686 self._vehicle._wploader.add(home, comment='Added by DroneKit')
2687 self._vehicle._wpts_dirty = True
2688
2689 def add(self, cmd):
2690 ''&#x27;

Callers 7

overridesMethod · 0.80
listenerMethod · 0.80
test_empty_clearFunction · 0.80
test_parameterFunction · 0.80
flight_replay.pyFile · 0.80
upload_missionFunction · 0.80
adds_square_missionFunction · 0.80

Calls 2

wait_readyMethod · 0.95
addMethod · 0.80

Tested by 2

test_empty_clearFunction · 0.64
test_parameterFunction · 0.64