mirror of https://github.com/ArduPilot/ardupilot
autotest: sub: fix altitude-hold for being below target altitude
This commit is contained in:
parent
78e432af0c
commit
5881692e4f
|
@ -102,8 +102,14 @@ class AutoTestSub(AutoTest):
|
||||||
self.mavproxy.send('mode ALT_HOLD\n')
|
self.mavproxy.send('mode ALT_HOLD\n')
|
||||||
self.wait_mode('ALT_HOLD')
|
self.wait_mode('ALT_HOLD')
|
||||||
|
|
||||||
|
msg = self.mav.recv_match(type='GLOBAL_POSITION_INT', blocking=True, timeout=5)
|
||||||
self.set_rc(Joystick.Throttle, 1000)
|
if msg is None:
|
||||||
|
raise NotAchievedException("Did not get GLOBAL_POSITION_INT")
|
||||||
|
pwm = 1000
|
||||||
|
if msg.relative_alt/1000.0 < -5.5:
|
||||||
|
# need to g`o up, not down!
|
||||||
|
pwm = 2000
|
||||||
|
self.set_rc(Joystick.Throttle, pwm)
|
||||||
self.wait_altitude(altitude_min=-6, altitude_max=-5)
|
self.wait_altitude(altitude_min=-6, altitude_max=-5)
|
||||||
self.set_rc(Joystick.Throttle, 1500)
|
self.set_rc(Joystick.Throttle, 1500)
|
||||||
|
|
||||||
|
@ -191,8 +197,7 @@ class AutoTestSub(AutoTest):
|
||||||
|
|
||||||
self.arm_vehicle()
|
self.arm_vehicle()
|
||||||
|
|
||||||
self.mavproxy.send('mode auto\n')
|
self.change_mode('AUTO')
|
||||||
self.wait_mode('AUTO')
|
|
||||||
|
|
||||||
self.wait_waypoint(1, 5, max_dist=5)
|
self.wait_waypoint(1, 5, max_dist=5)
|
||||||
|
|
||||||
|
@ -214,8 +219,7 @@ class AutoTestSub(AutoTest):
|
||||||
self.mavproxy.send('mode loiter\n')
|
self.mavproxy.send('mode loiter\n')
|
||||||
self.wait_ready_to_arm()
|
self.wait_ready_to_arm()
|
||||||
self.arm_vehicle()
|
self.arm_vehicle()
|
||||||
self.mavproxy.send('mode auto\n')
|
self.change_mode('AUTO')
|
||||||
self.wait_mode('AUTO')
|
|
||||||
self.mavproxy.expect("Gripper Grabbed")
|
self.mavproxy.expect("Gripper Grabbed")
|
||||||
self.mavproxy.expect("Gripper Released")
|
self.mavproxy.expect("Gripper Released")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
Loading…
Reference in New Issue