Skip to content

Commit a6b4dee

Browse files
committed
simplify by removing freemotion
1 parent 80656a0 commit a6b4dee

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

docs/src/examples/free_motion.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ eqs = [connect(bar2.frame_a, world.frame_b)
6868
spring1,
6969
spring2,
7070
])
71+
model = complete(model)
7172
ssys = structural_simplify(IRSystem(model))
7273
prob = ODEProblem(ssys, [
7374
collect(body.body.v_0 .=> 0);

docs/src/examples/quad.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,16 @@ function RotorCraft(; closed_loop = true, addload=true)
8282
end
8383
8484
thrusters = [Thruster(name = Symbol("thruster$i")) for i = 1:num_arms]
85-
@named body = Body(m = body_mass, state_priority = 0, I_11=0.01, I_22=0.01, I_33=0.01, air_resistance=1)
86-
@named freemotion = FreeMotion(state=true, isroot=true, quat=false) # We use Euler angles to describe the orientation of the rotorcraft.
85+
@named body = Body(m = body_mass, state_priority = 0, I_11=0.01, I_22=0.01, I_33=0.01, air_resistance=1, isroot=true)
8786
8887
connections = [
89-
connect(world.frame_b, freemotion.frame_a)
90-
connect(freemotion.frame_b, body.frame_a)
9188
y_alt ~ body.r_0[2]
92-
y_roll ~ freemotion.phi[3]
93-
y_pitch ~ freemotion.phi[1]
89+
y_roll ~ body.phi[3]
90+
y_pitch ~ body.phi[1]
9491
[connect(body.frame_a, arms[i].frame_a) for i = 1:num_arms]
9592
[connect(arms[i].frame_b, thrusters[i].frame_b) for i = 1:num_arms]
9693
]
97-
systems = [world; arms; body; thrusters; freemotion]
94+
systems = [world; arms; body; thrusters]
9895
if addload
9996
@named load = Body(m = load_mass, air_resistance=0.1)
10097
@named cable = Rope(
@@ -142,15 +139,16 @@ function RotorCraft(; closed_loop = true, addload=true)
142139
# append!(connections, [feedback_gain.input.u[i] ~ arms[i].frame_b.r_0[2] for i = 1:num_arms ]) # Connect positions to controller
143140
# append!(connections, [feedback_gain.input.u[i+num_arms] ~ D(arms[i].frame_b.r_0[2]) for i = 1:num_arms]) # Connect velocities to controller
144141
# append!(connections, [feedback_gain.input.u[i+2num_arms] ~ Ie[i] for i = 1:num_arms]) #
145-
# append!(connections, [feedback_gain.input.u[i] ~ freemotion.phi[[1,3][i]] for i = 1:2 ]) # Connect positions to controller
146-
# append!(connections, [feedback_gain.input.u[i+2] ~ freemotion.phid[[1,3][i]] for i = 1:2]) # Connect velocities to controller
142+
# append!(connections, [feedback_gain.input.u[i] ~ body.phi[[1,3][i]] for i = 1:2 ]) # Connect positions to controller
143+
# append!(connections, [feedback_gain.input.u[i+2] ~ body.phid[[1,3][i]] for i = 1:2]) # Connect velocities to controller
147144
# push!(systems, feedback_gain)
148145
=#
149146
end
150147
@named model = ODESystem(connections, t; systems)
151148
complete(model)
152149
end
153150
model = RotorCraft(closed_loop=true, addload=true)
151+
model = complete(model)
154152
ssys = structural_simplify(IRSystem(model))
155153
156154
op = [

0 commit comments

Comments
 (0)