Skip to content

Commit

Permalink
Tools: update cygwin_build script for Carbonix
Browse files Browse the repository at this point in the history
SW-241
  • Loading branch information
robertlong13 committed Jun 25, 2024
1 parent a515db1 commit 1d24520
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions Tools/scripts/cygwin_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,28 @@ rm -rf artifacts
mkdir artifacts

(
python ./waf --color yes --toolchain $TOOLCHAIN --board sitl configure 2>&1
python ./waf --color yes --toolchain $TOOLCHAIN --board sitl configure --define CARBOPILOT=1 2>&1
python ./waf plane 2>&1
) | tee artifacts/build.txt
# python ./waf copter 2>&1
# python ./waf heli 2>&1
# python ./waf rover 2>&1
# python ./waf sub 2>&1

# Get Carbonix version number to name the exe file
FIRMWARE_VERSION=$(grep -oP '#define AP_CUSTOM_FIRMWARE_STRING "\K(.*)(?=")' libraries/AP_Common/CxVersion.h)

# copy both with exe and without to cope with differences
# between windows versions in CI
cp -v build/sitl/bin/arduplane artifacts/ArduPlane.elf.exe
cp -v build/sitl/bin/arduplane artifacts/${FIRMWARE_VERSION}.exe

# cp -v build/sitl/bin/arduplane artifacts/ArduPlane.elf.exe
# cp -v build/sitl/bin/arducopter artifacts/ArduCopter.elf.exe
# cp -v build/sitl/bin/arducopter-heli artifacts/ArduHeli.elf.exe
# cp -v build/sitl/bin/ardurover artifacts/ArduRover.elf.exe
# cp -v build/sitl/bin/ardusub artifacts/ArduSub.elf.exe

cp -v build/sitl/bin/arduplane artifacts/ArduPlane.elf
# cp -v build/sitl/bin/arduplane artifacts/ArduPlane.elf
# cp -v build/sitl/bin/arducopter artifacts/ArduCopter.elf
# cp -v build/sitl/bin/arducopter-heli artifacts/ArduHeli.elf
# cp -v build/sitl/bin/ardurover artifacts/ArduRover.elf
Expand All @@ -54,5 +59,25 @@ for exe in artifacts/*.exe; do
done
done

# Process Carbonix SITL parameters
for file in libraries/AP_HAL_ChibiOS/hwdef/CarbonixCommon/sitl_params/*.parm
do
destfolder=artifacts/$(basename $file .parm)-${FIRMWARE_VERSION}
mkdir -p $destfolder
outfile=$destfolder/defaults.parm
echo "Processing $(basename $file)"

# Run parse_sitl_params.py script passing full path to .parm file and output folder
python Tools/Carbonix_scripts/process_sitl_defaults.py $file $outfile

# Create batch script to launch SITL with the correct parameters
if [[ $file == *"realflight"* ]]; then
model="flightaxis"
else
model="quadplane"
fi
printf "rem Launch at Eli Field\r\n..\\${FIRMWARE_VERSION}.exe -O 40.0594626,-88.5513292,206.0,0 --serial0 tcp:0 -M ${model} --defaults defaults.parm\r\n" > $destfolder/launch.bat
done

git log -1 > artifacts/git.txt
ls -l artifacts/

0 comments on commit 1d24520

Please sign in to comment.