Skip to content

Commit 4a26e30

Browse files
committed
rm extra complete
1 parent 0268bbd commit 4a26e30

File tree

1 file changed

+23
-27
lines changed

1 file changed

+23
-27
lines changed

test/test_robot.jl

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,13 @@ end
5555
m = multibody(motorTest)
5656
# @test length(unknowns(m)) == 3
5757
# D(motorTest.motor.gear.bearingFriction.w) => 0
58-
cm = complete(motorTest)
5958

6059
prob = ODEProblem(m, [
61-
D(D(cm.motor.Jmotor.phi)) => 0,
60+
D(D(m.motor.Jmotor.phi)) => 0,
6261
], (0.0, 5.0))
6362
sol = solve(prob, Rodas4())
6463
@test successful_retcode(sol)
65-
doplot() && plot(sol, idxs=cm.motor.phi.phi.u)
64+
doplot() && plot(sol, idxs=m.motor.phi.phi.u)
6665

6766
##
6867

@@ -93,16 +92,15 @@ end
9392

9493
@named gearTest = GearTest()
9594
m = multibody(gearTest)
96-
cm = complete(gearTest)
9795

9896
prob = ODEProblem(m, [
99-
cm.motor.Rd4.i => 0,
100-
cm.gear.gear.phi_b => 0,
101-
D(cm.gear.gear.phi_b) => 0,
97+
m.motor.Rd4.i => 0,
98+
m.gear.gear.phi_b => 0,
99+
D(m.gear.gear.phi_b) => 0,
102100
], (0.0, 5.0))
103101
sol = solve(prob, Rodas4())
104102
@test successful_retcode(sol)
105-
doplot() && plot(sol, idxs=cm.motor.phi.phi.u)
103+
doplot() && plot(sol, idxs=m.motor.phi.phi.u)
106104

107105

108106
@component function GearTest1(; name)
@@ -156,7 +154,6 @@ m = multibody(gearTest)
156154
end
157155

158156
@named controllerTest = ControllerTest()
159-
m = structural_simplify(controllerTest)
160157
m = multibody(controllerTest)
161158

162159

@@ -200,35 +197,34 @@ end
200197
# m = structural_simplify(axisTest)
201198
m = multibody(axisTest)
202199

203-
cm = complete(axisTest)
204200
tspan = (0.0, 5.0)
205201
prob = ODEProblem(m, [
206202
# ModelingToolkit.missing_variable_defaults(m);
207-
# D(cm.axis2.gear.bearingFriction.w) => 0
208-
cm.axis2.motor.flange_motor.phi => deg2rad(20) * 0,
209-
D(cm.axis2.motor.flange_motor.phi) => 0,
210-
cm.axis2.motor.Jmotor.phi => deg2rad(20) * 0,
211-
cm.axis2.gear.gear.phi_b => 0,
212-
D(cm.axis2.gear.gear.phi_b) => 0,
203+
# D(m.axis2.gear.bearingFriction.w) => 0
204+
m.axis2.motor.flange_motor.phi => deg2rad(20) * 0,
205+
D(m.axis2.motor.flange_motor.phi) => 0,
206+
m.axis2.motor.Jmotor.phi => deg2rad(20) * 0,
207+
m.axis2.gear.gear.phi_b => 0,
208+
D(m.axis2.gear.gear.phi_b) => 0,
213209
], tspan)
214210
sol = solve(prob, Rodas4())
215211
@test SciMLBase.successful_retcode(sol)
216212

217-
@test sol(0.0, idxs=cm.axis2.motor.emf.phi) == 0
218-
# @test sol(tspan[2], idxs=cm.axis2.motor.emf.phi) == 0
213+
@test sol(0.0, idxs=m.axis2.motor.emf.phi) == 0
214+
# @test sol(tspan[2], idxs=m.axis2.motor.emf.phi) == 0
219215

220216
doplot() && plot(sol, layout=length(unknowns(m)))
221217
doplot() && plot(sol, idxs=[
222-
cm.axis2.gear.gear.phi_a
223-
cm.axis2.gear.gear.phi_b
224-
cm.axis2.gear.gear.flange_b.phi
225-
# cm.axis2.gear.bearingFriction.flange_a.phi
226-
cm.axis2.gear.flange_b.phi
227-
cm.axis2.gear.gear.phi_support
228-
cm.axis2.angleSensor.phi.u
229-
cm.axis2.motor.phi.phi.u
218+
m.axis2.gear.gear.phi_a
219+
m.axis2.gear.gear.phi_b
220+
m.axis2.gear.gear.flange_b.phi
221+
# m.axis2.gear.bearingFriction.flange_a.phi
222+
m.axis2.gear.flange_b.phi
223+
m.axis2.gear.gear.phi_support
224+
m.axis2.angleSensor.phi.u
225+
m.axis2.motor.phi.phi.u
230226
], layout=8, size=(800, 800))
231-
u = cm.axis2.controller.PI.ctr_output.u
227+
u = m.axis2.controller.PI.ctr_output.u
232228
@test abs(sol(prob.tspan[2], idxs=u)) < 1e-6 # test control output is zero at the end of simulation
233229

234230
##

0 commit comments

Comments
 (0)