Skip to content

Commit 499ba06

Browse files
committed
add non-broken test
1 parent 7908a3b commit 499ba06

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/test_JointUSR_RRR.jl

+6-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ W(args...; kwargs...) = Multibody.world
1818
world = W()
1919
j1 = JointUSR(positive_branch=true, use_arrays=false)
2020
fixed = FixedTranslation(r=[1,0,0])
21-
b1 = Body(isroot=false, neg_w=true)
22-
p1 = Prismatic(state_priority=100)
21+
b1 = Body(m=1, isroot=false, neg_w=true)
22+
p1 = Prismatic(state_priority=100, n = [1, 0, 0])
2323
end
2424
@equations begin
2525
connect(world.frame_b, j1.frame_a, fixed.frame_a)
@@ -32,11 +32,13 @@ end
3232
@named model = TestUSR()
3333
model = complete(model)
3434
ssys = structural_simplify(IRSystem(model))
35+
@test length(unknowns(ssys)) == 2
3536
##
3637

37-
prob = ODEProblem(ssys, [model.b1.a_0[1]=>0.0, D(D(model.p1.s))=>0.0], (0.0, 1.0))
38+
prob = ODEProblem(ssys, [model.p1.v => 0.0], (0.0, 1.4))
3839
sol = solve(prob, FBDF(autodiff=true))
39-
@test_broken !all(iszero, sol(1.0))
40+
@test sol(1.0, idxs=model.p1.s) -2.8 rtol=0.01 # test vs. OpenModelica
41+
4042

4143
# NOTE: I was working on trying to register the compute_angle function so that there are no symbolic arguments left in the generated code
4244

0 commit comments

Comments
 (0)