You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* mention some additional joints
* add BodyBox component
* add "see also" in docstring
* some progress
something weird left in either rendering or dynamics
* update rendering
* tweak tol
Copy file name to clipboardExpand all lines: docs/src/examples/gyroscopic_effects.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ In this example, we demonstrate how a rotating body creates a reaction torque wh
7
7
The system consists of a pendulum suspended in a spherical joint, a joint without any rotational constraints. The tip of the pendulum is a cylinder that is rotating around a revolute joint in its center. When the pendulum swings, the rotation axis of the rotating tip is changed, this causes the entire pendulum to rotate around the axis through the pendulum rod.
Copy file name to clipboardExpand all lines: docs/src/examples/spherical_pendulum.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3

4
4
5
-
This example models a spherical pendulum. The pivot point is modeled using a [`Spherical`](@ref) joint, the pendulum rod is modeled using a [`FixedTranslation`](@ref)and the mass is modeled using a [`Body`](@ref). In this example, we choose the joint to be the root (joints are often better root objects than bodies).
5
+
This example models a spherical pendulum. The pivot point is modeled using a [`Spherical`](@ref) joint, this lets the pendulum rotate in three directions. The pendulum rod is modeled using a [`FixedTranslation`](@ref), a component without inertial properties, and the mass of the tip is modeled using a [`Body`](@ref). To model a rod with inertial properties, see, e.g., [`BodyShape`](@ref) or [`BodyCylinder`](@ref), In this example, we choose the joint to be the root (joints are often better root objects than bodies).
Copy file name to clipboardExpand all lines: docs/src/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -179,7 +179,7 @@ Pages = ["frames.jl"]
179
179
180
180
A joint restricts the number of degrees of freedom (DOF) of a body. For example, a free floating body has 6 DOF, but if it is attached to a [`Revolute`](@ref) joint, the joint restricts all but one rotational degree of freedom (a revolute joint acts like a hinge). Similarily, a [`Prismatic`](@ref) joint restricts all but one translational degree of freedom (a prismatic joint acts like a slider).
181
181
182
-
A [`Spherical`](@ref) joints restricts all translational degrees of freedom, but allows all rotational degrees of freedom. It thus transmits no torque.
182
+
A [`Spherical`](@ref) joints restricts all translational degrees of freedom, but allows all rotational degrees of freedom. It thus transmits no torque. A [`Planar`](@ref) joint moves in a plane, i.e., it restricts one translational DOF and two rotational DOF. A [`Universal`](@ref) joint has two rotational DOF.
183
183
184
184
Some joints offer the option to add 1-dimensional components to them by providing the keyword `axisflange = true`. This allows us to add, e.g., springs, dampers, sensors, and actuators to the joint.
Copy file name to clipboardExpand all lines: src/Multibody.jl
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ Create a 3D animation of a multibody system
26
26
- `loop`: The animation will be looped this many times. Please note: looping the animation using this argument is only recommended when `display = true` for camera manipulation purposes. When the camera is not manipulated, looping the animation by other means is recommended to avoid an increase in the file size.
27
27
- `filename` controls the name and the file type of the resulting animation
28
28
- `traces`: An optional array of frames to show the trace of.
29
+
- `show_axis = false`: Whether or not to show the plot axes, including background grid.
29
30
30
31
# Camera control
31
32
The following keyword arguments are available to control the camera pose:
Copy file name to clipboardExpand all lines: src/components.jl
+239-5Lines changed: 239 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -357,6 +357,8 @@ The `BodyShape` component is similar to a [`Body`](@ref), but it has two frames
357
357
- `r`: Vector from `frame_a` to `frame_b` resolved in `frame_a`
358
358
- All `kwargs` are passed to the internal `Body` component.
359
359
- `shapefile`: A path::String to a CAD model that can be imported by MeshIO for 3D rendering. If none is provided, a cylinder shape is rendered.
360
+
361
+
See also [`BodyCylinder`](@ref) and [`BodyBox`](@ref) for body components with predefined shapes and automatically computed inertial properties based on geometry and density.
360
362
"""
361
363
@componentfunctionBodyShape(; name, m =1, r = [0, 0, 0], r_cm =0.5*r, r_0 =0, radius =0.08, color=purple, shapefile="", kwargs...)
iszero(r_shape) ||error("non-zero r_shape not supported")
679
+
width_dir =collect(width_dir)
680
+
length_dir =collect(length_dir)
681
+
end
682
+
683
+
@parametersbegin
684
+
# r[1:3]=r, [ # MTKs symbolic language is too weak to handle this as a symbolic parameter in from_nxy
685
+
# description = "Vector from frame_a to frame_b resolved in frame_a",
686
+
# ]
687
+
# r_shape[1:3]=zeros(3), [
688
+
# description = "Vector from frame_a to box origin, resolved in frame_a",
689
+
# ]
690
+
# length = _norm(r - r_shape), [
691
+
# description = "Length of box",
692
+
# ]
693
+
# length_dir[1:3] = _norm(r - r_shape), [
694
+
# description = "Vector in length direction of box, resolved in frame_a",
695
+
# ]
696
+
697
+
# width_dir[1:3] = width_dir0, [
698
+
# description = "Vector in width direction of box, resolved in frame_a",
699
+
# ]
700
+
701
+
# NOTE: these are workarounds to allow rendering of this component. Unfortunately, MTK/JSCompiler cannot handle parameter arrays well enough to let these be actual parameters
702
+
render_r[1:3]=r, [description="For internal use only"]
703
+
render_r_shape[1:3]=r_shape, [description="For internal use only"]
704
+
render_length = length, [description="For internal use only"]
705
+
render_length_dir[1:3] = length_dir, [description="For internal use only"]
706
+
render_width_dir[1:3] = width_dir, [description="For internal use only"]
0 commit comments