Skip to content

Commit 68d0b89

Browse files
authored
Update makie extension and fix reposition (#155)
* Record multiple kites * Update reposition to match heading calc * Extra garbage collect * Use glmakie * Dont run without drivers * Remove non-existent * Fix examples * Correct skipping * Ifelse instead of return
1 parent 2177fb6 commit 68d0b89

23 files changed

+515
-68
lines changed

.github/workflows/CI.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ jobs:
4545
- os: ubuntu-latest
4646
version: '1.11'
4747
arch: x64
48+
prefix: xvfb-run -a
49+
- os: ubuntu-latest
50+
version: '1.12'
51+
arch: x64
52+
prefix: xvfb-run -a
4853
- os: macOS-latest
4954
version: '1.12'
5055
arch: aarch64
@@ -56,9 +61,17 @@ jobs:
5661
version: ${{ matrix.version }}
5762
arch: ${{ matrix.arch }}
5863

64+
- name: Install display dependencies for GLMakie
65+
if: runner.os == 'Linux'
66+
run: |
67+
sudo apt-get update
68+
sudo apt-get install -y xvfb libgl1-mesa-dri
69+
5970
- uses: julia-actions/cache@v2
6071
- uses: julia-actions/julia-buildpkg@v1
6172
- uses: julia-actions/julia-runtest@v1
73+
with:
74+
prefix: ${{ matrix.prefix }}
6275

6376
- name: Upload PNG plots as artifact
6477
if: always()

data/2plate_kite/aero_geometry.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ wing_sections:
77
headers: [airfoil_id, LE_x, LE_y, LE_z, TE_x, TE_y, TE_z]
88
data:
99
# Right section: points 2 (LE) and 3 (TE)
10-
- [1, -0.5, 1.0, 2.0, 0.5, 1.0, 2.3]
10+
- [1, -0.5, 1.0, 2.0, 0.5, 1.0, 2.2]
1111

1212
# Center section: points 4 (LE) and 5 (TE)
13-
- [1, -0.5, 0.0, 2.5, 0.5, 0.0, 2.8]
13+
- [1, -0.5, 0.0, 2.5, 0.5, 0.0, 2.7]
1414

1515
# Left section: points 6 (LE) and 7 (TE)
16-
- [1, -0.5, -1.0, 2.0, 0.5, -1.0, 2.3]
16+
- [1, -0.5, -1.0, 2.0, 0.5, -1.0, 2.2]
1717

1818
wing_airfoils:
1919
alpha_range: [-180, 180, 1] # deg

data/2plate_kite/settings.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
system:
22
log_file: "data/2plate" # filename without extension [replay only]
3-
# use / as path delimiter, even on Windows
3+
# use / as path delimiter, even on Windows
4+
sample_freq: 20 # sample frequency in Hz
45
g_earth: 9.81
56

67
initial:

examples/coupled_2plate_kite.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ update_aero_yaml_from_struc_yaml!(struc_yaml, aero_yaml)
2727
set = Settings("system.yaml")
2828
set.g_earth = 0.0
2929
vsm_set = VortexStepMethod.VSMSettings(
30-
joinpath(get_data_path(), "vsm_settings.yaml"))
30+
joinpath(get_data_path(), "vsm_settings.yaml");
31+
data_prefix=false)
3132

3233
sys = load_sys_struct_from_yaml(struc_yaml;
3334
system_name=MODEL_NAME, set, vsm_set)

examples/coupled_2plate_kite_linear_vsm.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ update_aero_yaml_from_struc_yaml!(struc_yaml, aero_yaml)
2323

2424
set = Settings("system.yaml")
2525
vsm_set = VortexStepMethod.VSMSettings(
26-
joinpath(get_data_path(), "vsm_settings.yaml"))
26+
joinpath(get_data_path(), "vsm_settings.yaml");
27+
data_prefix=false)
2728

2829
sys = load_sys_struct_from_yaml(struc_yaml;
2930
system_name=MODEL_NAME, set, vsm_set)

examples/coupled_linearize.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ update_aero_yaml_from_struc_yaml!(struc_yaml, aero_yaml)
1919

2020
set = Settings("system.yaml")
2121
vsm_set = VortexStepMethod.VSMSettings(
22-
joinpath(get_data_path(), "vsm_settings.yaml"))
22+
joinpath(get_data_path(), "vsm_settings.yaml");
23+
data_prefix=false)
2324

2425
sys = load_sys_struct_from_yaml(struc_yaml;
2526
system_name="2plate_kite", set, vsm_set)

examples/coupled_realtime_visualization.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ update_aero_yaml_from_struc_yaml!(struc_yaml, aero_yaml)
3434
set = Settings("system.yaml")
3535
set.profile_law = 3
3636
vsm_set = VortexStepMethod.VSMSettings(
37-
joinpath(get_data_path(), "vsm_settings.yaml"))
37+
joinpath(get_data_path(), "vsm_settings.yaml");
38+
data_prefix=false)
3839
sys = load_sys_struct_from_yaml(struc_yaml;
3940
system_name="2plate_kite", set, vsm_set)
4041
sam = SymbolicAWEModel(set, sys)

examples/coupled_simple_lin_model.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ update_aero_yaml_from_struc_yaml!(struc_yaml, aero_yaml)
2727

2828
set = Settings("system.yaml")
2929
vsm_set = VortexStepMethod.VSMSettings(
30-
joinpath(get_data_path(), "vsm_settings.yaml"))
30+
joinpath(get_data_path(), "vsm_settings.yaml");
31+
data_prefix=false)
3132

3233
sys = load_sys_struct_from_yaml(struc_yaml;
3334
system_name="2plate_kite", set, vsm_set)

examples/sam_tutorial.jl

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ end
6969

7070
# --- STEP 3: Add a pulley ---
7171

72-
push!(points, Point(22, [0, 0, set.l_tether + 5], DYNAMIC))
72+
push!(points, Point(22, [0, 0, set.l_tether + 5], DYNAMIC; extra_mass=0.1))
7373
push!(points, Point(23, [1, 0, set.l_tether + 5], STATIC))
7474
push!(segments, Segment(21, 21, 22,
7575
seg_stiffness, seg_damping, seg_diameter))
@@ -94,13 +94,26 @@ end
9494

9595
# --- STEP 4: Add a kite ---
9696

97-
vsm_wing = VortexStepMethod.Wing(set; prn=false)
97+
vsm_set = VortexStepMethod.VSMSettings(
98+
joinpath(get_data_path(), "vsm_settings.yaml");
99+
data_prefix=false)
100+
vsm_wing = VortexStepMethod.Wing(set, vsm_set; prn=false)
98101
vsm_aero = BodyAerodynamics([vsm_wing])
99102
vsm_solver = Solver(vsm_aero;
100103
solver_type=NONLIN, atol=2e-8, rtol=2e-8)
101104
wings = [SymbolicAWEModels.Wing(1, vsm_aero, vsm_wing,
102105
vsm_solver, [], I(3), [0.5, 0, set.l_tether + 6])]
103106

107+
# WING-type points: 3 LE/TE pairs matching the 3 aero sections
108+
wing_z = set.l_tether + 6
109+
for (i, y) in enumerate([-1.0, 0.0, 1.0])
110+
n = length(points)
111+
push!(points, Point(n + 1, [-0.5, y, wing_z],
112+
WING; wing=1, transform=1, extra_mass=0.1))
113+
push!(points, Point(n + 2, [0.5, y, wing_z],
114+
WING; wing=1, transform=1, extra_mass=0.1))
115+
end
116+
104117
sys = SystemStructure("wing", set;
105118
points, segments, tethers, winches, pulleys,
106119
wings, transforms)

examples/static_load_2plate_kite.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ kite structure and simulate a few steps under those loads.
77
"""
88

99
using GLMakie
10-
using SymbolicAWEModels, KiteUtils
10+
using SymbolicAWEModels, VortexStepMethod, KiteUtils
1111
using LinearAlgebra
1212
using SymbolicAWEModels: Point
1313

@@ -30,10 +30,16 @@ set_data_path(joinpath(pkg_root, "data", MODEL_NAME))
3030

3131
struc_yaml = joinpath(get_data_path(),
3232
"quat_struc_geometry.yaml")
33+
aero_yaml = joinpath(get_data_path(), "aero_geometry.yaml")
34+
update_aero_yaml_from_struc_yaml!(struc_yaml, aero_yaml)
35+
3336
set = Settings("system.yaml")
37+
vsm_set = VSMSettings(joinpath(get_data_path(),
38+
"vsm_settings.yaml"); data_prefix=false)
3439

3540
sys = load_sys_struct_from_yaml(struc_yaml;
36-
system_name=MODEL_NAME, set, aero_mode=AERO_NONE)
41+
system_name=MODEL_NAME, set, vsm_set,
42+
aero_mode=AERO_NONE)
3743

3844
function apply_loads!(points, F)
3945
for (i, point) in enumerate(points)

0 commit comments

Comments
 (0)