From 289aab06bc8c008b41e9b517510b0cc43e92151b Mon Sep 17 00:00:00 2001 From: Jacob Walser Date: Fri, 24 Feb 2017 18:25:50 -0500 Subject: [PATCH] scripts: Add Sub --- Tools/scripts/build_all.sh | 9 ++++++ Tools/scripts/build_all_vrbrain.sh | 7 ++++- Tools/scripts/build_binaries.sh | 49 +++++++++++++++++++++++++++++- Tools/scripts/generate-manifest.py | 5 +-- 4 files changed, 66 insertions(+), 4 deletions(-) diff --git a/Tools/scripts/build_all.sh b/Tools/scripts/build_all.sh index d90a9eaa50..ecdbbdd618 100755 --- a/Tools/scripts/build_all.sh +++ b/Tools/scripts/build_all.sh @@ -47,6 +47,15 @@ for b in sitl; do done popd +echo "Testing ArduSub build" +pushd ArduSub +for b in sitl linux; do + pwd + make clean + make $b -j4 +done +popd + pushd Tools/Replay make clean make diff --git a/Tools/scripts/build_all_vrbrain.sh b/Tools/scripts/build_all_vrbrain.sh index 92b16c4653..863c6c909a 100755 --- a/Tools/scripts/build_all_vrbrain.sh +++ b/Tools/scripts/build_all_vrbrain.sh @@ -8,7 +8,7 @@ set -e set -x -for d in ArduPlane ArduCopter APMrover2; do +for d in ArduPlane ArduCopter APMrover2 ArduSub; do pushd $d make vrbrain-clean popd @@ -29,4 +29,9 @@ pushd APMrover2 make vrbrain popd +echo "Testing ArduSub build" +pushd ArduSub +make vrbrain +popd + exit 0 diff --git a/Tools/scripts/build_binaries.sh b/Tools/scripts/build_binaries.sh index 7fce52b67b..ad927c801d 100755 --- a/Tools/scripts/build_binaries.sh +++ b/Tools/scripts/build_binaries.sh @@ -501,6 +501,52 @@ build_antennatracker() { popd } +# build ardusub binaries +build_ardusub() { + tag="$1" + echo "Building ArduSub $tag binaries from $(pwd)" + for b in erlebrain2 navio navio2 pxf pxfmini; do + echo "Building ArduSub $tag $b binaries" + checkout ArduSub $tag $b "" || continue + skip_board_waf $b && continue + ddir=$binaries/Sub/$hdate/$b + skip_build $tag $ddir && continue + waf configure --board $b --out $BUILDROOT clean sub || { + echo "Failed build of ArduSub $b $tag" + error_count=$((error_count+1)) + continue + } + copyit $BUILDROOT/$b/bin/ardusub $ddir $tag "ArduSub" + touch $binaries/Sub/$tag + done + pushd ArduSub + echo "Building ArduSub $tag PX4 binaries" + ddir=$binaries/Sub/$hdate/PX4 + checkout ArduSub $tag PX4 "" || { + checkout ArduSub "latest" "" "" + popd + return + } + skip_build $tag $ddir || { + for v in v1 v2 v3 v4; do + make px4-clean + make px4-$v -j2 || { + echo "Failed build of ArduSub PX4 $tag" + error_count=$((error_count+1)) + checkout ArduSub "latest" "" "" + popd + return + } + done + copyit ArduSub-v1.px4 $binaries/Sub/$hdate/PX4 $tag && + copyit ArduSub-v2.px4 $binaries/Sub/$hdate/PX4 $tag && + test ! -f ArduSub-v3.px4 || copyit ArduSub-v3.px4 $binaries/Sub/$hdate/PX4 $tag && + test ! -f ArduSub-v4.px4 || copyit ArduSub-v4.px4 $binaries/Sub/$hdate/PX4 $tag + } + checkout ArduSub "latest" "" "" + popd +} + [ -f .gitmodules ] && { git submodule init git submodule update --recursive -f @@ -510,7 +556,7 @@ export BUILDROOT="$TMPDIR/binaries.build" rm -rf $BUILDROOT # make sure PX4 is rebuilt from scratch -for d in ArduPlane ArduCopter APMrover2 AntennaTracker; do +for d in ArduPlane ArduCopter APMrover2 AntennaTracker ArduSub; do pushd $d make px4-clean || exit 1 popd @@ -521,6 +567,7 @@ for build in stable beta latest; do build_arducopter $build build_rover $build build_antennatracker $build + build_ardusub $build done rm -rf $TMPDIR diff --git a/Tools/scripts/generate-manifest.py b/Tools/scripts/generate-manifest.py index 39ec840b42..cbbd3fc21e 100755 --- a/Tools/scripts/generate-manifest.py +++ b/Tools/scripts/generate-manifest.py @@ -46,6 +46,7 @@ class ManifestGenerator(): "AntennaTracker": "ANTENNA_TRACKER", "Rover": "GROUND_ROVER", "PX4IO": "ARDUPILOT_PX4IO", + "Sub": "SUBMARINE" } if frame in frame_to_mavlink_dict: return frame_to_mavlink_dict[frame] @@ -60,7 +61,7 @@ class ManifestGenerator(): def looks_like_binaries_directory(self, dir): '''returns True if dir looks like it is a build_binaries.sh output directory''' for entry in os.listdir(dir): - if entry in {"AntennaTracker", "Copter", "Plane", "Rover"}: + if entry in {"AntennaTracker", "Copter", "Plane", "Rover", "Sub"}: return True return False @@ -201,7 +202,7 @@ class ManifestGenerator(): xfirmwares = dict() # used to listdir basedir here, but since this is also a web document root, there's a lot of other stuff accumulated... - vehicletypes = [ 'AntennaTracker', 'Copter', 'Plane', 'PX4IO', 'Rover' ] + vehicletypes = [ 'AntennaTracker', 'Copter', 'Plane', 'PX4IO', 'Rover', 'Sub' ] for vehicletype in vehicletypes: vdir = os.listdir(os.path.join(basedir, vehicletype)) for firstlevel in vdir: