Tools: add mission command to turn sprayer on and off

This commit is contained in:
Peter Barker 2020-07-03 09:04:28 +10:00 committed by Peter Barker
parent c3b005e1d9
commit b14dcf4bae
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,7 @@
QGC WPL 110
0 0 0 16 0.000000 0.000000 0.000000 0.000000 40.071375 -105.229789 -0.020000 1
1 0 3 16 0.000000 0.000000 0.000000 0.000000 40.071364 -105.230440 100.000000 1
2 0 0 216 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1
3 0 3 16 0.000000 0.000000 0.000000 0.000000 40.071319 -105.230331 100.000000 1
4 0 0 216 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1
5 0 3 16 0.000000 0.000000 0.000000 0.000000 40.071319 -105.230331 100.000000 1

View File

@ -5,6 +5,7 @@ from __future__ import print_function
import copy
import math
import operator
import os
import shutil
import sys
@ -295,6 +296,20 @@ class AutoTestRover(AutoTest):
# this is somewhat empirical...
self.wait_servo_channel_value(pump_ch, 1695, timeout=60)
self.progress("Turning it off again")
self.set_rc(rc_ch, 1000)
self.wait_servo_channel_value(spinner_ch, spinner_ch_min)
self.wait_servo_channel_value(pump_ch, pump_ch_min)
self.start_subtest("Sprayer Mission")
self.load_mission("sprayer-mission.txt")
self.change_mode("AUTO")
# self.send_debug_trap()
self.progress("Waiting for sprayer to start")
self.wait_servo_channel_value(pump_ch, 1300, timeout=60, comparator=operator.gt)
self.progress("Waiting for sprayer to stop")
self.wait_servo_channel_value(pump_ch, pump_ch_min, timeout=120)
self.progress("Sprayer OK")
except Exception as e:
self.progress("Caught exception: %s" %