From 7366f7c18ae57a337b0a2acbcb799a8def157c2e Mon Sep 17 00:00:00 2001 From: franckgaga Date: Wed, 6 May 2026 17:10:00 -0400 Subject: [PATCH 1/2] doc: longer sampling time in jldoctest To avoid `TIME_LIMIT` status --- src/estimator/manual.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/estimator/manual.jl b/src/estimator/manual.jl index c18b11838..7b13288bb 100644 --- a/src/estimator/manual.jl +++ b/src/estimator/manual.jl @@ -100,7 +100,7 @@ ManualEstimator estimator with a sample time Ts = 0.5 s: julia> function man_sim() f(x,u,_,_) = 0.5*sin.(x + u) h(x,_,_) = x - model = NonLinModel(f, h, 10.0, 1, 1, 1, solver=nothing) + model = NonLinModel(f, h, 100.0, 1, 1, 1, solver=nothing) linModel = linearize(model, x=[0], u=[0]) man = ManualEstimator(linModel, nint_u=[1]) mpc = LinMPC(man) From 869df04a77c5481e92cc5b1a70bb6f82a9ff87be Mon Sep 17 00:00:00 2001 From: franckgaga Date: Thu, 7 May 2026 15:10:52 -0400 Subject: [PATCH 2/2] test: less flaky real-time verifications The test was too sensible on windows Co-authored-by: Copilot --- test/1_test_sim_model.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/1_test_sim_model.jl b/test/1_test_sim_model.jl index cb630a610..51f5cecef 100644 --- a/test/1_test_sim_model.jl +++ b/test/1_test_sim_model.jl @@ -144,7 +144,7 @@ end updatestate!(linmodel1, [1]) periodsleep(linmodel1) end - @test all(isapprox.(diff(times1[2:end]), 0.25, atol=0.01)) + @test all(isapprox.(diff(times1[2:end]), 0.25, atol=0.025)) linmodel2 = LinModel(tf(2, [0.1, 1]), 0.25) times2 = zeros(5) for i=1:5 @@ -390,7 +390,7 @@ end @testitem "NonLinModel real time simulations" setup=[SetupMPCtests] begin using .SetupMPCtests, ControlSystemsBase, LinearAlgebra - linmodel1 = LinModel(tf(2, [10, 1]), 0.1) + linmodel1 = LinModel(tf(2, [10, 1]), 0.25) nonlinmodel1 = NonLinModel( (x,u,_,_)->linmodel1.A*x + linmodel1.Bu*u, (x,_,_)->linmodel1.C*x, @@ -402,8 +402,8 @@ end updatestate!(nonlinmodel1, [1]) periodsleep(nonlinmodel1) end - @test all(isapprox.(diff(times1[2:end]), 0.1, atol=0.01)) - linmodel2 = LinModel(tf(2, [0.1, 1]), 0.001) + @test all(isapprox.(diff(times1[2:end]), 0.25, atol=0.025)) + linmodel2 = LinModel(tf(2, [0.1, 1]), 0.25) nonlinmodel2 = NonLinModel( (x,u,_,_)->linmodel2.A*x + linmodel2.Bu*u, (x,_,_)->linmodel2.C*x, @@ -415,5 +415,5 @@ end updatestate!(nonlinmodel2, [1]) periodsleep(nonlinmodel2, true) end - @test all(isapprox.(diff(times2[2:end]), 0.001, atol=0.0001)) + @test all(isapprox.(diff(times2[2:end]), 0.25, atol=0.0001)) end \ No newline at end of file