scripts: Add Sub

This commit is contained in:
Jacob Walser 2017-02-24 18:25:50 -05:00 committed by Andrew Tridgell
parent 25663f5740
commit 289aab06bc
4 changed files with 66 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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: