|
25 | 25 | "cell_type": "markdown",
|
26 | 26 | "metadata": {},
|
27 | 27 | "source": [
|
28 |
| - "We'll be using `RigidBodyDynamics` and `StaticArrays` for the simulation part." |
| 28 | + "We'll be using `LinearAlgebra`, `RigidBodyDynamics`, and `StaticArrays` for the simulation part." |
29 | 29 | ]
|
30 | 30 | },
|
31 | 31 | {
|
|
34 | 34 | "metadata": {},
|
35 | 35 | "outputs": [],
|
36 | 36 | "source": [
|
| 37 | + "using LinearAlgebra\n", |
37 | 38 | "using RigidBodyDynamics\n",
|
38 | 39 | "using StaticArrays"
|
39 | 40 | ]
|
|
160 | 161 | "source": [
|
161 | 162 | "# link1 and joint1\n",
|
162 | 163 | "joint1 = Joint(\"joint1\", Revolute(axis))\n",
|
163 |
| - "inertia1 = SpatialInertia(CartesianFrame3D(\"inertia1_centroidal\"), I_1*axis*axis', zeros(SVector{3, T}), m_1)\n", |
| 164 | + "inertia1 = SpatialInertia(CartesianFrame3D(\"inertia1_centroidal\"), I_1*axis*axis', zero(SVector{3, T}), m_1)\n", |
164 | 165 | "link1 = RigidBody(inertia1)\n",
|
165 | 166 | "before_joint1_to_world = eye(Transform3D, frame_before(joint1), default_frame(world))\n",
|
166 | 167 | "c1_to_joint = Transform3D(inertia1.frame, frame_after(joint1), SVector(c_1, 0, 0))\n",
|
167 | 168 | "attach!(fourbar, world, link1, joint1, joint_pose = before_joint1_to_world, successor_pose = c1_to_joint)\n",
|
168 | 169 | "\n",
|
169 | 170 | "# link2 and joint2\n",
|
170 | 171 | "joint2 = Joint(\"joint2\", Revolute(axis))\n",
|
171 |
| - "inertia2 = SpatialInertia(CartesianFrame3D(\"inertia2_centroidal\"), I_2*axis*axis', zeros(SVector{3, T}), m_2)\n", |
| 172 | + "inertia2 = SpatialInertia(CartesianFrame3D(\"inertia2_centroidal\"), I_2*axis*axis', zero(SVector{3, T}), m_2)\n", |
172 | 173 | "link2 = RigidBody(inertia2)\n",
|
173 | 174 | "before_joint2_to_after_joint1 = Transform3D(frame_before(joint2), frame_after(joint1), SVector(l_1, 0., 0.))\n",
|
174 | 175 | "c2_to_joint = Transform3D(inertia2.frame, frame_after(joint2), SVector(c_2, 0, 0))\n",
|
175 | 176 | "attach!(fourbar, link1, link2, joint2, joint_pose = before_joint2_to_after_joint1, successor_pose = c2_to_joint)\n",
|
176 | 177 | "\n",
|
177 | 178 | "# link3 and joint3\n",
|
178 | 179 | "joint3 = Joint(\"joint3\", Revolute(axis))\n",
|
179 |
| - "inertia3 = SpatialInertia(CartesianFrame3D(\"inertia3_centroidal\"), I_3*axis*axis', zeros(SVector{3, T}), m_3)\n", |
| 180 | + "inertia3 = SpatialInertia(CartesianFrame3D(\"inertia3_centroidal\"), I_3*axis*axis', zero(SVector{3, T}), m_3)\n", |
180 | 181 | "link3 = RigidBody(inertia3)\n",
|
181 | 182 | "before_joint3_to_world = Transform3D(frame_before(joint3), default_frame(world), SVector(l_0, 0., 0.))\n",
|
182 | 183 | "c3_to_joint = Transform3D(inertia3.frame, frame_after(joint3), SVector(c_3, 0, 0))\n",
|
|
0 commit comments