Skip to content

Commit af65924

Browse files
committed
autotest: proper FenceMargin test
1 parent f8b204c commit af65924

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Tools/autotest/arducopter.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -1914,7 +1914,7 @@ def FenceMargin(self, timeout=180):
19141914
self.set_parameters({
19151915
"FENCE_ENABLE": 1,
19161916
"FENCE_TYPE": 6, # polygon and circle fences
1917-
"FENCE_MARGIN" : 20,
1917+
"FENCE_MARGIN" : 30,
19181918
"FENCE_RADIUS" : 150,
19191919
"AVOID_ENABLE": 0,
19201920
"FENCE_OPTIONS": 4
@@ -1928,6 +1928,9 @@ def FenceMargin(self, timeout=180):
19281928

19291929
# 110m polyfence
19301930
home_loc = self.mav.location()
1931+
radius = self.get_parameter("FENCE_RADIUS")
1932+
self.mavproxy.send("map circle %f %f %f green\n" % (home_loc.lat, home_loc.lng, radius))
1933+
19311934
locs = [
19321935
self.offset_location_ne(home_loc, -110, -110),
19331936
self.offset_location_ne(home_loc, 110, -110),
@@ -1951,8 +1954,9 @@ def FenceMargin(self, timeout=180):
19511954
self.progress("flying forward (east) until we hit fence")
19521955
pitching_forward = True
19531956
self.set_rc(2, 1100)
1957+
self.wait_statustext("Polygon fence outside margin")
19541958

1955-
self.wait_statustext("Circle fence outside margin")
1959+
self.wait_statustext("Circle and Polygon fences outside margin")
19561960
self.progress("Waiting for fence breach")
19571961
tstart = self.get_sim_time()
19581962
while not self.mode_is("RTL"):

0 commit comments

Comments
 (0)