Skip to content

Commit

Permalink
add autopilot scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Mar 31, 2024
1 parent ffc9c36 commit 2d7113f
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
13 changes: 13 additions & 0 deletions bin/autopilot
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
cd ..

julia_version=$(julia --version | awk '{print($3)}')
julia_major=${julia_version:0:3}

echo "Lauching KiteViewer..."
if test -f "bin/kps-image-${julia_major}.so"; then
julia --startup-file=no -t auto -J bin/kps-image-${julia_major}.so --optimize=1 --project -e "include(\"./examples/autopilot.jl\");"
else
julia --startup-file=no -t auto --optimize=2 --project -e "include(\"./examples/autopilot.jl\");"
fi
15 changes: 15 additions & 0 deletions bin/autopilot.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@echo off
REM determine basename of current directory
for /F "delims=" %%i in ("%cd%") do set basename=%%~ni

if %basename%==bin cd ..
for /f "delims=" %%i in ('julia --version') do set version_string=%%i
for /f "tokens=3 delims= " %%a in ("%version_string%") do set version=%%a

set julia_major=%version:~0,3%
set image=kps-image-%julia_major%.dll

echo Lauching KiteViewer...
IF EXIST "bin/%image%" (
julia --startup-file=no -t auto -J bin/kps-image-%julia_major%.so --optimize=1 --project -e "include(\"./examples/autopilot.jl\");"
) else julia --startup-file=no -t auto --optimize=2 --project -e "include(\"./examples/autopilot.jl\");"
3 changes: 2 additions & 1 deletion src/KiteSimulators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ In addition it copies the README.md file, the default settings in
the folder data and helper scripts in the folder test.
"""
function init_project()
bin_files = ["create_sys_image", "create_sys_image.bat", "run_julia", "run_julia.bat", "joystick", "joystick.bat"]
bin_files = ["create_sys_image", "create_sys_image.bat", "run_julia", "run_julia.bat", "joystick", "joystick.bat",
"autopilot", "autopilot.bat"]
test_files = ["create_sys_image.jl", "test_for_precompile.jl", "update_packages.jl"]
docs_files = ["Installation.md", "PackageInstallation.md", "kite_power_tools.png", "kite_4p.png", "dir_structure.png",
"vscode.png", "logging.md", "plotting.md", "2d_plot.png"]
Expand Down

0 comments on commit 2d7113f

Please sign in to comment.