Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT MERGE Windows crash example #164

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add windows crash test
baggepinnen committed Oct 7, 2024
commit 34d4b0e1b0557b20a81dab1ddbfb038fc981a216
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include("windows_crash.jl")

using ModelingToolkit
using Multibody
using Test
31 changes: 31 additions & 0 deletions test/windows_crash.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using ModelingToolkit
using Multibody
using Test
using JuliaSimCompiler
using OrdinaryDiffEq
t = Multibody.t
D = Differential(t)

@named robot = Multibody.Robot6DOF()
robot = complete(robot)
println("complete")

ssys = structural_simplify(IRSystem(robot))
println("structural_simplify")


prob = ODEProblem(ssys, [
robot.mechanics.r1.phi => deg2rad(-60)
robot.mechanics.r2.phi => deg2rad(20)
robot.mechanics.r3.phi => deg2rad(90)
robot.mechanics.r4.phi => deg2rad(0)
robot.mechanics.r5.phi => deg2rad(-110)
robot.mechanics.r6.phi => deg2rad(0)

robot.axis1.motor.Jmotor.phi => deg2rad(-60) * (-105) # Multiply by gear ratio
robot.axis2.motor.Jmotor.phi => deg2rad(20) * (210)
robot.axis3.motor.Jmotor.phi => deg2rad(90) * (60)
], (0.0, 2.0))
println("ODEProblem done, calling solve")

sol = solve(prob, Rodas5P(autodiff=false));