Skip to content

Commit

Permalink
autotest: correctly test FENCE_AUTOENABLE=3
Browse files Browse the repository at this point in the history
  • Loading branch information
andyp1per committed Feb 28, 2024
1 parent 9b975da commit ed2e91f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Tools/autotest/arduplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -3703,21 +3703,27 @@ def FenceAltCeilFloor(self):
self.fly_home_land_and_disarm(timeout=150)

def FenceMinAltAutoEnable(self):
'''Tests autoenablement of the alt min fence'''
'''Tests autoenablement of the alt min fence and fences on arming'''
fence_bit = mavutil.mavlink.MAV_SYS_STATUS_GEOFENCE
self.set_parameters({
"FENCE_TYPE": 8, # Set fence type to min alt
"FENCE_TYPE": 9, # Set fence type to min alt and max alt
"FENCE_ACTION": 1, # Set action to RTL
"FENCE_ALT_MIN": 25,
"FENCE_ALT_MAX": 100,
"FENCE_AUTOENABLE": 3,
"FENCE_ENABLE" : 1,
"FENCE_ENABLE" : 0,
})

# Grab Home Position
self.mav.recv_match(type='HOME_POSITION', blocking=True)
self.homeloc = self.mav.location()

self.wait_ready_to_arm()
self.takeoff(alt=50)
self.arm_vehicle()
# max alt fence should now be enabled
self.assert_fence_enabled()

self.takeoff(alt=50, mode='TAKEOFF')
self.change_mode("FBWA")
self.set_rc(3, 1100) # lower throttle

Expand Down

0 comments on commit ed2e91f

Please sign in to comment.