Skip to content

Commit

Permalink
autotest: move Copter implementation of far_from_EKF_origin up to AP_…
Browse files Browse the repository at this point in the history
…Vehicle, use it

the Sub and Blimp implementations were buggy and no-longer in-line with Copter's.

In particular, several years ago Copter's horizontal distance limit was removed, and the checking of the vertical limit was fixed.

The old vertical distance check was wrong, it was in m rather than km, and Sub/Blimp still have that problem before this patch.
  • Loading branch information
peterbarker committed Apr 9, 2024
1 parent 86bf14b commit e3eec64
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions Tools/autotest/blimp.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ def tests(self):
self.FlyManual,
self.FlyLoiter,
self.PREFLIGHT_Pressure,
self.far_from_EKF_origin,
])
return ret

Expand Down
12 changes: 12 additions & 0 deletions Tools/autotest/vehicle_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -13554,6 +13554,18 @@ def MSP_DJI(self):
if dist < 1:
break

def far_from_EKF_origin(self):
'''test that we get a failure if home is set far from the EKF origin'''
self.wait_ready_to_arm()
here = self.poll_home_position()
self.run_cmd_int(
mavutil.mavlink.MAV_CMD_DO_SET_HOME,
p5=here.latitude,
p6=here.longitude,
p7=6000000,
want_result=mavutil.mavlink.MAV_RESULT_DENIED,
)

def CRSF(self):
'''Test RC CRSF'''
self.context_push()
Expand Down

0 comments on commit e3eec64

Please sign in to comment.