mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 18:08:30 -04:00
AutoTest: wait 1sec when saving wp
This commit is contained in:
parent
4cf06aaae5
commit
67c9178cc5
@ -49,6 +49,12 @@ def get_bearing(loc1, loc2):
|
|||||||
bearing += 360.00
|
bearing += 360.00
|
||||||
return bearing;
|
return bearing;
|
||||||
|
|
||||||
|
def wait_seconds(seconds_to_wait):
|
||||||
|
tstart = time.time();
|
||||||
|
tnow = tstart
|
||||||
|
while tstart + seconds_to_wait > tnow:
|
||||||
|
tnow = time.time()
|
||||||
|
|
||||||
def wait_altitude(mav, alt_min, alt_max, timeout=30):
|
def wait_altitude(mav, alt_min, alt_max, timeout=30):
|
||||||
climb_rate = 0
|
climb_rate = 0
|
||||||
previous_alt = 0
|
previous_alt = 0
|
||||||
@ -208,10 +214,15 @@ def wait_waypoint(mav, wpnum_start, wpnum_end, allow_skip=True, max_dist=2, time
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def save_wp(mavproxy, mav):
|
def save_wp(mavproxy, mav):
|
||||||
mavproxy.send('rc 7 2000\n')
|
|
||||||
mav.recv_match(condition='RC_CHANNELS_RAW.chan7_raw==2000', blocking=True)
|
|
||||||
mavproxy.send('rc 7 1000\n')
|
mavproxy.send('rc 7 1000\n')
|
||||||
mav.recv_match(condition='RC_CHANNELS_RAW.chan7_raw==1000', blocking=True)
|
mav.recv_match(condition='RC_CHANNELS_RAW.chan7_raw==1000', blocking=True)
|
||||||
|
wait_seconds(1)
|
||||||
|
mavproxy.send('rc 7 2000\n')
|
||||||
|
mav.recv_match(condition='RC_CHANNELS_RAW.chan7_raw==2000', blocking=True)
|
||||||
|
wait_seconds(1)
|
||||||
|
mavproxy.send('rc 7 1000\n')
|
||||||
|
mav.recv_match(condition='RC_CHANNELS_RAW.chan7_raw==1000', blocking=True)
|
||||||
|
wait_seconds(1)
|
||||||
|
|
||||||
def wait_mode(mav, mode, timeout=None):
|
def wait_mode(mav, mode, timeout=None):
|
||||||
print("Waiting for mode %s" % mode)
|
print("Waiting for mode %s" % mode)
|
||||||
|
Loading…
Reference in New Issue
Block a user