Skip to content

Commit 1001e03

Browse files
authored
Add default_turbulence (#61)
- [x] Add functions get_default_turbulence() and set_default_turbulence() - [x] Add default_turbulence to gui.yaml file - [x] Add support for Kaimon.jl in run_julia and in copilot_instructions.md - [x] Add the menu entry set_turbulence to menu.jl - [x] run_julia uses `Revise` now by default; Revise must be installed globally - [x] the example parking_wind_dir and all other relevant examples using the default turbulence now - [x] the install script now installs Revise globally - [x] add script install_kaimon_database
1 parent 7e991c6 commit 1001e03

22 files changed

Lines changed: 485 additions & 61 deletions

‎.github/copilot-instructions.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ include("test/runtests.jl")
6161
```
6262
Tests include Aqua.jl quality checks.
6363

64+
## Documentation
65+
To test if building the docs works locally, use:
66+
```
67+
using Pkg; Pkg.activate("docs"); include("docs/make.jl"); Pkg.activate(".")
68+
```
69+
6470
## System Image
6571
A precompiled system image can be built with:
6672
```bash

‎CHANGELOG.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## Unreleased
4+
### Added
5+
- the functions set_default_turbulence and get_default_turbulence
6+
- the menu entry set_turbulence
7+
- run_julia uses `Revise` now by default; Revise must be installed globally
8+
9+
### Changed
10+
- the example parking_wind_dir is using the default turbulence now
11+
- the install script now installs Revise globally
12+
313
## KiteControllers v0.2.24 - 2026-05-02
414
### Added
515
- the function `menu_learning()` and the script `menu_learning.jl`

‎bin/install‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,22 @@ juliaup default "${_desired_julia}"
7474
echo "Julia ${_desired_julia} is now the default."
7575
echo
7676

77+
echo "Checking whether Revise is installed in the global Julia environment..."
78+
julia -e '
79+
using Pkg
80+
81+
shared_env = Base.load_path_expand("@v#.#")
82+
Pkg.activate(shared_env; io=devnull)
83+
84+
if haskey(Pkg.project().dependencies, "Revise")
85+
println("Revise is already installed in $(shared_env).")
86+
else
87+
println("Installing Revise in $(shared_env)...")
88+
Pkg.add("Revise")
89+
end
90+
'
91+
echo
92+
7793
# Detect Julia version
7894
julia_version=$(julia --version | awk '{print($3)}')
7995
julia_major=${julia_version:0:3}

‎bin/install_kaimon_database‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# This script starts the Qdrant vector database in a Docker container. It creates a Docker
4+
# volume named "qdrant_data" to persist the data and runs the container with the appropriate
5+
# port mapping and restart policy.
6+
7+
# It needs to be executed only once. After that, the Qdrant container will automatically
8+
# restart on system reboot or if it crashes.
9+
10+
# The data is stored in /var/lib/docker/volumes/qdrant_data/_data/collections
11+
12+
if docker volume inspect qdrant_data &>/dev/null; then
13+
echo "Volume 'qdrant_data' already exists, skipping setup."
14+
exit 0
15+
fi
16+
17+
docker volume create qdrant_data
18+
19+
docker run -d \
20+
--name qdrant \
21+
--restart unless-stopped \
22+
-p 6333:6333 \
23+
-v qdrant_data:/qdrant/storage \
24+
qdrant/qdrant

‎bin/run_julia‎

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ fi
77
export NO_AT_BRIDGE=1
88
export JULIA_PKG_SERVER_REGISTRY_PREFERENCE=eager
99

10+
USE_KAIMON=false
11+
if command -v ss &> /dev/null; then
12+
if ss -ltn '( sport = :2828 )' | grep -q ':2828'; then
13+
USE_KAIMON=true
14+
fi
15+
elif command -v lsof &> /dev/null; then
16+
if lsof -nP -iTCP:2828 -sTCP:LISTEN &> /dev/null; then
17+
USE_KAIMON=true
18+
fi
19+
fi
20+
1021
if [[ "$(uname -s)" == "Darwin" ]]; then
1122
# Avoid Tk backend issues on macOS (e.g. non-responsive close button in PyPlot windows).
1223
# Keep user override if MPLBACKEND is already set.
@@ -46,11 +57,6 @@ fi
4657
if [[ $HOSTNAME == "ufryzen" || $HOSTNAME == "framework" ]]; then
4758
export NO_MTK=true
4859
fi
49-
if [ -d ".git" ]; then
50-
branch=$(git rev-parse --abbrev-ref HEAD)
51-
else
52-
branch=""
53-
fi
5460

5561
script_file=""
5662
if [[ $# -gt 0 ]]; then
@@ -62,18 +68,24 @@ if [[ $# -gt 0 ]]; then
6268
fi
6369
fi
6470

71+
julia_init='using Revise; '
72+
if [[ "$USE_KAIMON" == "true" ]]; then
73+
julia_init+='using Kaimon; Gate.serve(); '
74+
fi
75+
julia_init+='using KiteControllers; test_menu() = Base.include(Main, joinpath(pkgdir(KiteControllers), "test", "test_menu.jl")); menu_learning() = Base.include(Main, joinpath(pkgdir(KiteControllers), "examples", "menu_learning.jl"))'
76+
6577
if test -f "bin/kps-image-${julia_major}.so"; then
6678
echo "Found system image!"
6779
if [[ -n "$script_file" ]]; then
6880
PLOT=1 julia -J bin/kps-image-${julia_major}.so -t 1 $GCT --project "$script_file" "$@"
6981
else
70-
PLOT=1 julia -J bin/kps-image-${julia_major}.so -t 1 $GCT --project -i -e 'using KiteControllers; test_menu() = Base.include(Main, joinpath(pkgdir(KiteControllers), "test", "test_menu.jl")); menu_learning() = Base.include(Main, joinpath(pkgdir(KiteControllers), "examples", "menu_learning.jl"))'
82+
PLOT=1 julia -J bin/kps-image-${julia_major}.so -t 1 $GCT --project -i -e "$julia_init"
7183
fi
7284
else
7385
if [[ -n "$script_file" ]]; then
7486
PLOT=1 julia --project -t 1 $GCT "$script_file" "$@"
7587
else
76-
PLOT=1 julia --project -t 1 $GCT -i -e 'using KiteControllers; test_menu() = Base.include(Main, joinpath(pkgdir(KiteControllers), "test", "test_menu.jl")); menu_learning() = Base.include(Main, joinpath(pkgdir(KiteControllers), "examples", "menu_learning.jl"))'
88+
PLOT=1 julia --project -t 1 $GCT -i -e "$julia_init"
7789
fi
7890
# julia --project
7991
fi

‎data/gui.yaml.default‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
gui:
2-
project: hydra20_600.yml # or hydra20_600.yml
2+
project: hydra20_600.yml # or hydra20_600.yml
3+
default_turbulence: 0.0 # default turbulence level for simulations, between 0.0 and 1.0
34

‎docs/make.jl‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ makedocs(
1313
"Types" => "types.md",
1414
"Functions" => "functions.md",
1515
"Examples" => "examples.md",
16+
"Projects and Turbulence" => "projects.md",
1617
"Learning Control" => "learning.md",
1718
],
1819
checkdocs = :exports,

‎docs/src/functions.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ get_depower(::SystemStateControl)
2121

2222
```@docs
2323
read_project()
24+
get_default_turbulence()
25+
get_use_turbulence
26+
set_default_turbulence
2427
```
2528

2629
## FlightPathPlanner

‎docs/src/parking_wind_dir_T0.png‎

76.5 KB
Loading

‎docs/src/parking_wind_dir_T1.png‎

156 KB
Loading

0 commit comments

Comments
 (0)