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
6 changes: 3 additions & 3 deletions dronekit/module/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ def clear(self):
'''Clears the command list'''
self.wait_valid()
self.__module.wploader.clear()
self.__module.vehicle.wpts_dirty = True
self.__module.api._FakeAPI__vehicle.wpts_dirty = True

def add(self, cmd):
'''Add a new command at the end of the command list'''
self.wait_valid()
self.__module.fix_targets(cmd)
self.__module.wploader.add(cmd, comment = 'Added by DroneAPI')
self.__module.vehicle.wpts_dirty = True
self.__module.api._FakeAPI__vehicle.wpts_dirty = True

@property
def count(self):
Expand All @@ -123,7 +123,7 @@ def __getitem__(self, index):

def __setitem__(self, index, value):
self.__module.wploader.set(value, index)
self.__module.vehicle.wpts_dirty = True
self.__module.api._FakeAPI__vehicle.wpts_dirty = True

class MPVehicle(Vehicle):
def __init__(self, module):
Expand Down
21 changes: 21 additions & 0 deletions tests/sitl/test_waypoints.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from dronekit import connect
import time
import math
from dronekit import connect
from dronekit.tools import with_sitl
from dronekit.lib import VehicleMode, LocationGlobal
import time
from nose.tools import assert_not_equals

# This test runs first!
@with_sitl
def test_parameter(connpath):
# Connect to the Vehicle
vehicle = connect(connpath, await_params=True)

cmds = vehicle.commands
cmds.download()
cmds.wait_valid()

vehicle.commands.clear()
vehicle.flush()