@@ -82,19 +82,16 @@ function RotorCraft(; closed_loop = true, addload=true)
82
82
end
83
83
84
84
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)
87
86
88
87
connections = [
89
- connect(world.frame_b, freemotion.frame_a)
90
- connect(freemotion.frame_b, body.frame_a)
91
88
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]
94
91
[connect(body.frame_a, arms[i].frame_a) for i = 1:num_arms]
95
92
[connect(arms[i].frame_b, thrusters[i].frame_b) for i = 1:num_arms]
96
93
]
97
- systems = [world; arms; body; thrusters; freemotion ]
94
+ systems = [world; arms; body; thrusters]
98
95
if addload
99
96
@named load = Body(m = load_mass, air_resistance=0.1)
100
97
@named cable = Rope(
@@ -142,15 +139,16 @@ function RotorCraft(; closed_loop = true, addload=true)
142
139
# append!(connections, [feedback_gain.input.u[i] ~ arms[i].frame_b.r_0[2] for i = 1:num_arms ]) # Connect positions to controller
143
140
# 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
144
141
# 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
147
144
# push!(systems, feedback_gain)
148
145
=#
149
146
end
150
147
@named model = ODESystem(connections, t; systems)
151
148
complete(model)
152
149
end
153
150
model = RotorCraft(closed_loop=true, addload=true)
151
+ model = complete(model)
154
152
ssys = structural_simplify(IRSystem(model))
155
153
156
154
op = [
0 commit comments