Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ufechner7 committed Aug 25, 2024
1 parent e0f6470 commit 227e3dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ cd("..")
include("test_parking.jl")

@testset "KiteViewers.jl" begin
segments=se().segments
segments=load_settings("system.yaml").segments
pos_kite = kps4.pos[segments+1] # well, this is the position of the pod...
elevation = calc_elevation(pos_kite)
@test isapprox(rad2deg(elevation), 69.51421682882923, rtol=1e-2)
@test isapprox(rad2deg(elevation), 48.24819715017064, rtol=1e-2)
azimuth = azimuth_east(pos_kite)
@test isapprox(rad2deg(azimuth), 0.1, rtol=2e-2, atol=10)
@test isapprox(rad2deg(azimuth), 46.73976775250815, rtol=2e-2, atol=10)
force = winch_force(kps4)
@test isapprox(force, 461.0137819702637, rtol=2e-2)
@test isapprox(force, 940.3393233392699, rtol=2e-2)
end
9 changes: 4 additions & 5 deletions test/test_parking.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ end

using KiteViewers, KiteModels, KitePodModels, Rotations, Timers

# change this to KPS3 or KPS4
const Model = KPS4
set_data_path()

if ! @isdefined kcu; const kcu = KCU(se()); end
if ! @isdefined kps4; const kps4 = Model(kcu); end
set = load_settings("system.yaml")
kcu::KCU = KCU(set);
kps4::KPS4 = KPS4(kcu)

# the following values can be changed to match your interest
dt = 0.05
Expand Down Expand Up @@ -45,7 +44,7 @@ function simulate(integrator, steps)
(integrator.p.iter - start) / steps
end

integrator = KiteModels.init_sim!(kps4, stiffness_factor=0.5, prn=STATISTIC)
integrator = KiteModels.init_sim!(kps4; stiffness_factor=0.5, prn=STATISTIC)

av_steps = simulate(integrator, STEPS)
nothing

0 comments on commit 227e3dc

Please sign in to comment.