@@ -10,7 +10,7 @@ abstract type AbstractFrameCache{T} end
1010struct FrameKinematicsCache{T} <: AbstractFrameCache{T}
1111 transforms:: Vector{Transform{T}}
1212 function FrameKinematicsCache {T} (Nframes) where T
13- transforms = Vector { Transform{T}} (undef , Nframes)
13+ transforms = zeros ( Transform{T}, Nframes)
1414 new {T} (transforms)
1515 end
1616end
@@ -19,7 +19,7 @@ struct FrameJacobiansCache{T} <: AbstractFrameCache{T}
1919 transforms:: Vector{Transform{T}}
2020 jacobians:: Array{T, 3}
2121 function FrameJacobiansCache {T} (Nframes, NDOF) where T
22- transforms = Vector { Transform{T}} (undef , Nframes)
22+ transforms = zeros ( Transform{T}, Nframes)
2323 jacobians = zeros (T, 6 , NDOF, Nframes)
2424 new {T} (transforms, jacobians)
2525 end
2828struct FrameRBStatesCache{T} <: AbstractFrameCache{T}
2929 rbstates:: Vector{RigidBodyState{T}}
3030 function FrameRBStatesCache {T} (Nframes) where T
31- rbstates = Vector { RigidBodyState{T}} (undef , Nframes)
31+ rbstates = zeros ( RigidBodyState{T}, Nframes)
3232 new {T} (rbstates)
3333 end
3434end
@@ -37,7 +37,7 @@ struct FrameRBStatesJacobianCache{T} <: AbstractFrameCache{T}
3737 rbstates:: Vector{RigidBodyState{T}}
3838 jacobians:: Array{T, 3}
3939 function FrameRBStatesJacobianCache {T} (Nframes, NDOF) where T
40- rbstates = Vector { RigidBodyState{T}} (undef , Nframes)
40+ rbstates = zeros ( RigidBodyState{T}, Nframes)
4141 jacobians = zeros (T, 6 , NDOF, Nframes)
4242 new {T} (rbstates, jacobians)
4343 end
@@ -48,9 +48,9 @@ struct FrameRBStatesWrenchesCache{T} <: AbstractFrameCache{T}
4848 forces:: Vector{SVector{3, T}}
4949 torques:: Vector{SVector{3, T}}
5050 function FrameRBStatesWrenchesCache {T} (Nframes) where T
51- rbstates = Vector { RigidBodyState{T}} (undef , Nframes)
52- forces = Vector { SVector{3, T}} (undef , Nframes)
53- torques = Vector { SVector{3, T}} (undef , Nframes)
51+ rbstates = zeros ( RigidBodyState{T}, Nframes)
52+ forces = zeros ( SVector{3 , T}, Nframes)
53+ torques = zeros ( SVector{3 , T}, Nframes)
5454 new {T} (rbstates, forces, torques)
5555 end
5656end
@@ -99,7 +99,7 @@ struct MechKinematicsCache{T} <: MechanismCache{T}
9999 end
100100 function MechKinematicsCache {T} (NDOF, Nf, Nc) where T
101101 t = Base. RefValue {T} (0.0 )
102- q = Vector {T} (undef , NDOF)
102+ q = zeros (T , NDOF)
103103 fcache = FrameKinematicsCache {T} (Nf)
104104 ccache = CoordKinematicsCache {T} (Nc)
105105 MechKinematicsCache (t, q, fcache, ccache)
@@ -126,7 +126,7 @@ struct MechJacobiansCache{T} <: MechanismCache{T}
126126 end
127127 function MechJacobiansCache {T} (NDOF, Nf, Nc) where T
128128 t = Base. RefValue {T} (0.0 )
129- q = Vector {T} (undef , NDOF)
129+ q = zeros (T , NDOF)
130130 fcache = FrameJacobiansCache {T} (Nf, NDOF)
131131 ccache = CoordJacobiansCache {T} (Nc, NDOF)
132132 MechJacobiansCache (t, q, fcache, ccache)
@@ -160,9 +160,9 @@ struct MechRBStatesCache{T} <: MechanismCache{T}
160160 end
161161 function MechRBStatesCache {T} (NDOF, Nf, Nc) where T
162162 t = Base. RefValue {T} (0.0 )
163- q = Vector {T} (undef , NDOF)
164- q̇ = Vector {T} (undef , NDOF)
165- q̈ = Vector {T} (undef , NDOF)
163+ q = zeros (T , NDOF)
164+ q̇ = zeros (T , NDOF)
165+ q̈ = zeros (T , NDOF)
166166 gravity = Base. RefValue (zero (SVector{3 , T}))
167167 fcache = FrameRBStatesCache {T} (Nf)
168168 ccache = CoordRBStatesCache {T} (Nc)
@@ -213,15 +213,15 @@ struct MechDynamicsCache{T} <: MechanismCache{T}
213213 end
214214 function MechDynamicsCache {T} (NDOF, Nf, Nc) where T
215215 t = Base. RefValue {T} (0.0 )
216- q = Vector {T} (undef , NDOF)
217- q̇ = Vector {T} (undef , NDOF)
218- q̈ = Vector {T} (undef , NDOF)
219- u = Vector {T} (undef , NDOF)
216+ q = zeros (T , NDOF)
217+ q̇ = zeros (T , NDOF)
218+ q̈ = zeros (T , NDOF)
219+ u = zeros (T , NDOF)
220220 gravity = Base. RefValue (zero (SVector{3 , T}))
221221 inertance_matrix = zeros (T, NDOF, NDOF)
222222 inertance_matrix_workspace = zeros (T, NDOF, NDOF)
223- generalized_force = Vector {T} (undef , NDOF)
224- generalized_force_workspace = Vector {T} (undef , NDOF)
223+ generalized_force = zeros (T , NDOF)
224+ generalized_force_workspace = zeros (T , NDOF)
225225 fcache = FrameRBStatesJacobianCache {T} (Nf, NDOF)
226226 ccache = CoordRBStatesJacobianCache {T} (Nc, NDOF)
227227 MechDynamicsCache (t, q, q̇, q̈, gravity, u, inertance_matrix, inertance_matrix_workspace,
@@ -265,10 +265,10 @@ struct MechRNECache{T} <: MechanismCache{T}
265265 end
266266 function MechRNECache {T} (NDOF, Nf, Nc) where T
267267 t = Base. RefValue {T} (0.0 )
268- q = Vector {T} (undef , NDOF)
269- q̇ = Vector {T} (undef , NDOF)
270- q̈ = Vector {T} (undef , NDOF)
271- u = Vector {T} (undef , NDOF)
268+ q = zeros (T , NDOF)
269+ q̇ = zeros (T , NDOF)
270+ q̈ = zeros (T , NDOF)
271+ u = zeros (T , NDOF)
272272 gravity = Base. RefValue (zero (SVector{3 , T}))
273273 generalized_force = Vector {T} (undef, NDOF)
274274 generalized_force_workspace = Vector {T} (undef, NDOF)
@@ -722,8 +722,8 @@ struct VMSKinematicsCache{T} <: VirtualMechanismSystemCache{T}
722722 end
723723 function VMSKinematicsCache {T} (NDOF_robot, NDOF_vm, Nf_robot, Nf_vm, Nc_robot, Nc_vm, Nc) where T
724724 t = Base. RefValue {T} (0.0 )
725- qʳ = Vector {T} (undef , NDOF_robot)
726- qᵛ = Vector {T} (undef , NDOF_vm)
725+ qʳ = zeros (T , NDOF_robot)
726+ qᵛ = zeros (T , NDOF_vm)
727727 q = (qʳ, qᵛ)
728728 robot_frame_cache = FrameKinematicsCache {T} (Nf_robot)
729729 robot_coord_cache = CoordKinematicsCache {T} (Nc_robot)
@@ -802,20 +802,20 @@ struct VMSDynamicsCache{T} <: VirtualMechanismSystemCache{T}
802802 function VMSDynamicsCache {T} (NDOF_robot, NDOF_vm, Nf_robot, Nf_vm, Nc_robot, Nc_vm, Nc) where T
803803 t = Base. RefValue {T} (0.0 )
804804 NDOF = NDOF_robot + NDOF_vm
805- q = (Vector {T} (undef , NDOF_robot), Vector {T} (undef, NDOF_vm))
806- q̇ = (Vector {T} (undef , NDOF_robot), Vector {T} (undef, NDOF_vm))
807- q̈ = (Vector {T} (undef , NDOF_robot), Vector {T} (undef, NDOF_vm))
808- u = (Vector {T} (undef , NDOF_robot), Vector {T} (undef, NDOF_vm))
805+ q = (zeros (T , NDOF_robot), zeros ( NDOF_vm))
806+ q̇ = (zeros (T , NDOF_robot), zeros ( NDOF_vm))
807+ q̈ = (zeros (T , NDOF_robot), zeros ( NDOF_vm))
808+ u = (zeros (T , NDOF_robot), zeros ( NDOF_vm))
809809 gravity = Base. RefValue (zero (SVector{3 , T}))
810810 robot_frame_cache = FrameRBStatesJacobianCache {T} (Nf_robot, NDOF_robot)
811811 robot_coord_cache = CoordRBStatesJacobianCache {T} (Nc_robot, NDOF_robot)
812812 vm_frame_cache = FrameRBStatesJacobianCache {T} (Nf_vm, NDOF_vm)
813813 vm_coord_cache = CoordRBStatesJacobianCache {T} (Nc_vm, NDOF_vm)
814814 coord_cache = CoordRBStatesJacobianCache {T} (Nc, NDOF) # TODO generalize
815- inertance_matrix = (Matrix {T} (undef , NDOF_robot, NDOF_robot), Matrix {T} (undef , NDOF_vm, NDOF_vm))
815+ inertance_matrix = (zeros (T , NDOF_robot, NDOF_robot), zeros (T , NDOF_vm, NDOF_vm))
816816 inertance_matrix_workspace = (Matrix {T} (undef, NDOF_robot, NDOF_robot), Matrix {T} (undef, NDOF_vm, NDOF_vm))
817- generalized_force = (Vector {T} (undef , NDOF_robot), Vector {T} (undef , NDOF_vm))
818- generalized_force_workspace = (Vector {T} (undef , NDOF_robot), Vector {T} (undef , NDOF_vm))
817+ generalized_force = (zeros (T , NDOF_robot), zeros (T , NDOF_vm))
818+ generalized_force_workspace = (zeros (T , NDOF_robot), zeros (T , NDOF_vm))
819819 new {T} (t, q, q̇, q̈, u, gravity, inertance_matrix, inertance_matrix_workspace,
820820 generalized_force, generalized_force_workspace, robot_frame_cache,
821821 vm_frame_cache, robot_coord_cache, vm_coord_cache, coord_cache)
0 commit comments