Skip to content

Commit

Permalink
mavproxy_fence.py: create apply_function_to_point
Browse files Browse the repository at this point in the history
... and a convenience push_to_vehicle method
  • Loading branch information
peterbarker committed May 10, 2024
1 parent 2fcadb8 commit 753f58f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions MAVProxy/modules/mavproxy_fence.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,15 @@ def add_polyfence(self, fence_type, points):
items.append(m)

self.append(items)
self.push_to_vehicle()

def apply_function_to_points(self, function):
if not self.check_have_list():
return
for i in range(self.wploader.count()):
function(i, self.wploader.item(i))

def push_to_vehicle(self):
self.send_all_items()
self.wploader.last_change = time.time()

Expand Down

0 comments on commit 753f58f

Please sign in to comment.