From 578c1789c16ee55a8edaaa4459591a8dbc5128a5 Mon Sep 17 00:00:00 2001 From: Bob Long Date: Tue, 25 Jun 2024 11:46:43 +1000 Subject: [PATCH] Tools: update cygwin_build script for Carbonix SW-241 --- .github/workflows/cygwin_build.yml | 2 +- Tools/scripts/cygwin_build.sh | 31 +++++++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cygwin_build.yml b/.github/workflows/cygwin_build.yml index 296f937aef..0d664a2aca 100644 --- a/.github/workflows/cygwin_build.yml +++ b/.github/workflows/cygwin_build.yml @@ -211,7 +211,7 @@ jobs: id: check_files uses: andstor/file-existence-action@v2 with: - files: "artifacts/ArduPlane.elf.exe" + files: "artifacts/*.exe" fail: true - name: Archive build diff --git a/Tools/scripts/cygwin_build.sh b/Tools/scripts/cygwin_build.sh index b0a4895033..11cad8e43c 100755 --- a/Tools/scripts/cygwin_build.sh +++ b/Tools/scripts/cygwin_build.sh @@ -23,7 +23,7 @@ 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 @@ -31,15 +31,20 @@ mkdir artifacts # 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 @@ -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/