Skip to content

Commit

Permalink
add non-broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Aug 12, 2024
1 parent 8e09e60 commit 342038e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/test_JointUSR_RRR.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ W(args...; kwargs...) = Multibody.world
world = W()
j1 = JointUSR(positive_branch=true, use_arrays=false)
fixed = FixedTranslation(r=[1,0,0])
b1 = Body(isroot=false, neg_w=true)
p1 = Prismatic(state_priority=100)
b1 = Body(m=1, isroot=false, neg_w=true)
p1 = Prismatic(state_priority=100, n = [1, 0, 0])
end
@equations begin
connect(world.frame_b, j1.frame_a, fixed.frame_a)
Expand All @@ -32,11 +32,13 @@ end
@named model = TestUSR()
model = complete(model)
ssys = structural_simplify(IRSystem(model))
@test length(unknowns(ssys)) == 2
##

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


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

Expand Down

0 comments on commit 342038e

Please sign in to comment.