From aec7091faa5f78c97aa09d4dd5069c2b9d79fb45 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 29 Oct 2016 18:42:22 +1100 Subject: [PATCH] autotest: Add support for Sub in sim_vehicle.py --- Tools/autotest/default_params/sub.parm | 62 ++++++++++++++++++++++++++ Tools/autotest/sim_vehicle.py | 11 ++++- Tools/scripts/build_ci.sh | 2 +- 3 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 Tools/autotest/default_params/sub.parm diff --git a/Tools/autotest/default_params/sub.parm b/Tools/autotest/default_params/sub.parm new file mode 100644 index 0000000000..dfcd39abbc --- /dev/null +++ b/Tools/autotest/default_params/sub.parm @@ -0,0 +1,62 @@ +BTN0_FUNCTION 0 +BTN10_SFUNCTION 0 +BTN10_FUNCTION 22 +BTN10_SFUNCTION 0 +BTN11_FUNCTION 42 +BTN11_SFUNCTION 47 +BTN12_FUNCTION 43 +BTN12_SFUNCTION 46 +BTN13_FUNCTION 33 +BTN13_SFUNCTION 45 +BTN14_FUNCTION 32 +BTN14_SFUNCTION 44 +BTN15_FUNCTION 0 +BTN15_SFUNCTION 0 +BTN1_FUNCTION 6 +BTN1_SFUNCTION 0 +BTN2_FUNCTION 8 +BTN2_SFUNCTION 0 +BTN3_FUNCTION 7 +BTN3_SFUNCTION 0 +BTN4_FUNCTION 4 +BTN4_SFUNCTION 0 +BTN5_FUNCTION 1 +BTN5_SFUNCTION 0 +BTN6_FUNCTION 3 +BTN6_SFUNCTION 0 +BTN7_FUNCTION 21 +BTN7_SFUNCTION 0 +BTN8_FUNCTION 48 +BTN8_SFUNCTION 0 +BTN9_FUNCTION 23 +BTN9_SFUNCTION 0 +COMPASS_OFS_X 5 +COMPASS_OFS_Y 13 +COMPASS_OFS_Z -18 +COMPASS_OFS2_X 5 +COMPASS_OFS2_Y 13 +COMPASS_OFS2_Z -18 +INS_ACCOFFS_X 0.001 +INS_ACCOFFS_Y 0.001 +INS_ACCOFFS_Z 0.001 +INS_ACCSCAL_X 1.001 +INS_ACCSCAL_Y 1.001 +INS_ACCSCAL_Z 1.001 +INS_ACC2OFFS_X 0.001 +INS_ACC2OFFS_Y 0.001 +INS_ACC2OFFS_Z 0.001 +INS_ACC2SCAL_X 1.001 +INS_ACC2SCAL_Y 1.001 +INS_ACC2SCAL_Z 1.001 +INS_ACC3OFFS_X 0.000 +INS_ACC3OFFS_Y 0.000 +INS_ACC3OFFS_Z 0.000 +INS_ACC3SCAL_X 1.000 +INS_ACC3SCAL_Y 1.000 +INS_ACC3SCAL_Z 1.000 +FLTMODE1 19 +FLTMODE2 0 +FLTMODE3 2 +FLTMODE4 0 +FLTMODE5 0 +FLTMODE6 0 \ No newline at end of file diff --git a/Tools/autotest/sim_vehicle.py b/Tools/autotest/sim_vehicle.py index 5d517acc43..5b2384c4c4 100755 --- a/Tools/autotest/sim_vehicle.py +++ b/Tools/autotest/sim_vehicle.py @@ -150,6 +150,7 @@ def kill_tasks(): 'lt-JSBSim', 'ArduPlane.elf', 'ArduCopter.elf', + 'ArduSub.elf', 'APMrover2.elf', 'AntennaTracker.elf', 'JSBSIm.exe', @@ -352,6 +353,12 @@ _options_for_frame = { "waf_target": "bin/ardurover", "default_params_filename": "default_params/rover-skid.parm", }, + # SUB + "sub": { + "model": "vectored", + "waf_target": "bin/ardusub", + "default_params_filename": "default_params/sub.parm", + }, # SIM "gazebo-iris": { "waf_target": "bin/arducopter", @@ -376,6 +383,7 @@ _options_for_frame = { _default_waf_target = { "ArduPlane": "bin/arduplane", "ArduCopter": "bin/arducopter", + "ArduSub": "bin/ardusub", "APMrover2": "bin/ardurover", "AntennaTracker": "bin/antennatracker", } @@ -723,7 +731,7 @@ parser = CompatOptionParser("sim_vehicle.py", "you are simulating, for example, start in the ArduPlane directory to " \ "simulate ArduPlane") -parser.add_option("-v", "--vehicle", type='string', default=None, help="vehicle type (ArduPlane, ArduCopter or APMrover2)") +parser.add_option("-v", "--vehicle", type='string', default=None, help="vehicle type (ArduPlane, ArduCopter, APMrover2 or ArduSub)") parser.add_option("-f", "--frame", type='string', default=None, help="""set aircraft frame type for copters can choose +, X, quad or octa for planes can choose elevon or vtail""") @@ -818,6 +826,7 @@ default_frame_for_vehicle = { "APMrover2": "rover", "ArduPlane": "jsbsim", "ArduCopter": "quad", + "ArduSub": "vectored", "AntennaTracker": "tracker", } diff --git a/Tools/scripts/build_ci.sh b/Tools/scripts/build_ci.sh index d2eab59588..13dc5b38eb 100755 --- a/Tools/scripts/build_ci.sh +++ b/Tools/scripts/build_ci.sh @@ -68,7 +68,7 @@ for t in $CI_BUILD_TARGET; do # only do make-based builds for GCC when target is PX4 or when launched by a scheduled job if [[ "$cxx_compiler" != "clang++" && ( $t == "px4"* || -n ${CI_CRON_JOB+1} ) ]]; then echo "Starting make based build for target ${t}..." - for v in "ArduPlane" "ArduCopter" "APMrover2" "AntennaTracker"; do + for v in "ArduPlane" "ArduCopter" "APMrover2" "ArduSub" "AntennaTracker"; do echo "Building $v for ${t}..." pushd $v