Skip to content

Commit b1674d7

Browse files
committed
All tests enabled
1 parent d0cae40 commit b1674d7

File tree

3 files changed

+36
-49
lines changed

3 files changed

+36
-49
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ version = "1.0.0-DEV"
66
[deps]
77
DiscretePIDs = "c1363496-6848-4723-8758-079b737f6baf"
88
KiteModels = "b94af626-7959-4878-9336-2adc27959007"
9+
KiteUtils = "90980105-b163-44e5-ba9f-8b1c83bb0533"
910
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
1011

1112
[compat]
1213
DiscretePIDs = "0.1.6"
1314
KiteModels = "0.8.1"
15+
KiteUtils = "0.10.13"
1416
Parameters = "0.12.3"
1517
julia = "1.6.7"
1618

src/SimpleKiteControllers.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module SimpleKiteControllers
22

3-
using DiscretePIDs, Parameters
3+
using DiscretePIDs, Parameters, KiteUtils
44

55
export ParkingController, ParkingControllerSettings
6-
export linearize
6+
export linearize, calc_steering, navigate
77

88
@with_kw mutable struct ParkingControllerSettings @deftype Float64
99
dt

test/runtests.jl

Lines changed: 32 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using SimpleKiteControllers
22
using Test
33

4-
@testset "SimpleKiteControllers.jl" begin
4+
@testset verbose=true "SimpleKiteControllers.jl" begin
55
@testset "test_linearize" begin
66
# set the parameters of the parking controller
77
pcs = ParkingControllerSettings(dt=0.05)
@@ -25,52 +25,37 @@ using Test
2525
@test ndi_gain 4.166666666666667
2626
end
2727

28+
@testset "test_calc_steering" begin
29+
# set the parameters of the parking controller
30+
pcs = ParkingControllerSettings(dt=0.05)
31+
pcs.kp_tr=1.05
32+
pcs.ki_tr=0.012
33+
# create the parking controller
34+
pc = ParkingController(pcs)
35+
# set the heading
36+
heading = deg2rad(1.0)
37+
elevation = deg2rad(70.0)
38+
chi_set = deg2rad(34.0)
39+
u_s, ndi_gain, psi_dot, psi_dot_set = calc_steering(pc, heading, chi_set; elevation)
40+
@test u_s 18.135061759003584
41+
@test ndi_gain 2.0833333333333335
42+
@test psi_dot 0.3490658503988659
43+
@test psi_dot_set 8.639379797371932
44+
end
2845

29-
# function test_calc_steering()
30-
# @testset "test_calc_steering" begin
31-
# # set the parameters of the parking controller
32-
# pcs = ParkingControllerSettings(dt=0.05)
33-
# pcs.kp_tr=1.05
34-
# pcs.ki_tr=0.012
35-
# # create the parking controller
36-
# pc = ParkingController(pcs)
37-
# # set the heading
38-
# heading = deg2rad(1.0)
39-
# elevation = deg2rad(70.0)
40-
# chi_set = deg2rad(34.0)
41-
# u_s, ndi_gain, psi_dot, psi_dot_set = calc_steering(pc, heading, chi_set; elevation)
42-
# @test u_s ≈ 18.135061759003584
43-
# @test ndi_gain ≈ 2.0833333333333335
44-
# @test psi_dot ≈ 0.3490658503988659
45-
# @test psi_dot_set ≈ 8.639379797371932
46-
# end
47-
# nothing
48-
# end
49-
50-
# function test_navigate()
51-
# @testset "test_navigate" begin
52-
# # set the parameters of the parking controller
53-
# pcs = ParkingControllerSettings(dt=0.05)
54-
# pcs.kp=1.05
55-
# pcs.ki=0.012
56-
# # create the parking controller
57-
# pc = ParkingController(pcs)
58-
# # set the azimuth
59-
# azimuth = deg2rad(90.0)
60-
# # set the elevation
61-
# elevation = deg2rad(70.0)
62-
# chi_set = navigate(pc, azimuth, elevation)
63-
# @test chi_set ≈ -deg2rad(34.019878734151234)
64-
# end
65-
# nothing
66-
# end
46+
@testset "test_navigate" begin
47+
# set the parameters of the parking controller
48+
pcs = ParkingControllerSettings(dt=0.05)
49+
pcs.kp=1.05
50+
pcs.ki=0.012
51+
# create the parking controller
52+
pc = ParkingController(pcs)
53+
# set the azimuth
54+
azimuth = deg2rad(90.0)
55+
# set the elevation
56+
elevation = deg2rad(70.0)
57+
chi_set = navigate(pc, azimuth, elevation)
58+
@test chi_set -deg2rad(34.019878734151234)
59+
end
6760

68-
# function test_parking_controller()
69-
# @testset verbose=true "test_parking_controller" begin
70-
# test_calc_steering()
71-
# test_linearize()
72-
# test_navigate()
73-
# end
74-
# nothing
75-
# end
7661
end

0 commit comments

Comments
 (0)