Skip to content

Commit

Permalink
workaround for buggy symbolic arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Apr 3, 2024
1 parent b740c38 commit eb25951
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/orientation.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Rotations

_norm(x) = sqrt(sum(abs2.(x)))
_norm(x) = sqrt(sum(abs2(x) for x in x)) # Workaround for buggy symbolic arrays
_normalize(x) = x ./ _norm(x)

const R3{T} = RotMatrix{3, T}
Expand Down
11 changes: 5 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -655,14 +655,13 @@ defs = [
# collect(D.(cwheel.rollingWheel.angles)) .=> [0, 5, 1]
]

ssys = structural_simplify(IRSystem(wheel))
prob = ODEProblem(ssys, defs, (0, 10))


# prob.u0 .+= 0.001 .* randn.()
@test_skip begin # Does not initialize
sol = solve(prob, Rodas5P(autodiff=false), u0 = prob.u0 .+ 1e-6 .* randn.())
@info "Write tests"
ssys = structural_simplify(IRSystem(wheel))
prob = ODEProblem(ssys, defs, (0, 10))
sol = solve(prob, Rodas5P(autodiff=false), u0 = prob.u0 .+ 1e-6 .* randn.())
@info "Write tests"
end

end
Expand Down Expand Up @@ -711,7 +710,7 @@ eqs = [connect(world.frame_b, freeMotion.frame_a)
body])
# ssys = structural_simplify(model, allow_parameters = false)
ssys = structural_simplify(IRSystem(model))
@test_broken length(unknowns(ssys)) == 12 # This test passes when the body states are used, but not with joint states
@test length(unknowns(ssys)) == 12

prob = ODEProblem(ssys, [collect(body.w_a .=> [0, 1, 0]); collect(body.v_0 .=> [0, 0, 0]); ], (0, 10))

Expand Down

0 comments on commit eb25951

Please sign in to comment.