Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
SCRainbow authored Apr 13, 2024
2 parents b1d353b + 77cccd0 commit 404b49f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
16 changes: 16 additions & 0 deletions Tools/autotest/arducopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10828,6 +10828,21 @@ def CameraLogMessages(self):
if abs(got - want) > 1:
raise NotAchievedException(f"Incorrect relalt {want=} {got=}")

def LoiterToGuidedHomeVSOrigin(self):
'''test moving from guided to loiter mode when home is a different alt
to origin'''
self.set_parameters({
"TERRAIN_ENABLE": 1,
"SIM_TERRAIN": 1,
})
self.takeoff(10, mode='GUIDED')
here = self.mav.location()
self.set_home(here)
self.change_mode('LOITER')
self.wait_altitude(here.alt-1, here.alt+1, minimum_duration=10)
self.disarm_vehicle(force=True)
self.reboot_sitl() # to "unstick" home

def tests2b(self): # this block currently around 9.5mins here
'''return list of all tests'''
ret = ([
Expand Down Expand Up @@ -10906,6 +10921,7 @@ def tests2b(self): # this block currently around 9.5mins here
self.PILOT_THR_BHV,
self.GPSForYawCompassLearn,
self.CameraLogMessages,
self.LoiterToGuidedHomeVSOrigin,
])
return ret

Expand Down
3 changes: 2 additions & 1 deletion Tools/autotest/default_params/sub-6dof.parm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
BARO_RND 0.02
BATT_MONITOR 4
BTN0_FUNCTION 0
BTN10_SFUNCTION 0
Expand Down Expand Up @@ -59,4 +58,6 @@ INS_ACC3OFFS_Z 0.000
INS_ACC3SCAL_X 1.000
INS_ACC3SCAL_Y 1.000
INS_ACC3SCAL_Z 1.000
LOG_BITMASK 180222
SIM_BARO_RND 0.02
FRAME_CONFIG 2.000
3 changes: 2 additions & 1 deletion Tools/autotest/default_params/sub.parm
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ BARO_EXT_BUS 1
PILOT_ACCEL_Z 200
PILOT_SPEED_UP 200
PSC_JERK_Z 8
LOG_BITMASK,180222
LOG_BITMASK 180222
SIM_BARO_RND 0.02
9 changes: 9 additions & 0 deletions Tools/autotest/vehicle_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -8993,6 +8993,15 @@ def monitor_groundspeed(self, want, tolerance=0.5, timeout=5):
self.progress("GroundSpeed OK (got=%f) (want=%f)" %
(m.groundspeed, want))

def set_home(self, loc):
'''set home to supplied loc'''
self.run_cmd_int(
mavutil.mavlink.MAV_CMD_DO_SET_HOME,
p5=int(loc.lat*1e7),
p6=int(loc.lng*1e7),
p7=loc.alt,
)

def SetHome(self):
'''Setting and fetching of home'''
if self.is_tracker():
Expand Down

0 comments on commit 404b49f

Please sign in to comment.