From 70346cca2fa6d6cbe3f9f261a3d6d099e21e1abb Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlson Date: Tue, 6 Aug 2024 05:41:20 +0200 Subject: [PATCH] docs improvements --- docs/src/examples/pendulum.md | 2 +- src/joints.jl | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/docs/src/examples/pendulum.md b/docs/src/examples/pendulum.md index 905106d0..c1a9e049 100644 --- a/docs/src/examples/pendulum.md +++ b/docs/src/examples/pendulum.md @@ -139,7 +139,7 @@ nothing # hide ### Why do we need a joint? In the example above, we introduced a prismatic joint to model the oscillating motion of the mass-spring system. In reality, we can suspend a mass in a spring without any joint, so why do we need one here? The answer is that we do not, in fact, need the joint, but if we connect the spring directly to the world, we need to make the body (mass) the root object of the kinematic tree instead: ```@example pendulum -@named root_body = Body(; m = 1, isroot = true, r_cm = [0, 1, 0], phi0 = [0, 1, 0]) +@named root_body = Body(; m = 1, isroot = true, r_cm = [0, 1, 0], phi0 = [0, 1, 0], neg_w=false) @named multibody_spring = Multibody.Spring(c=10) connections = [connect(world.frame_b, multibody_spring.frame_a) diff --git a/src/joints.jl b/src/joints.jl index 44ef2d9f..eb3cdf35 100644 --- a/src/joints.jl +++ b/src/joints.jl @@ -891,6 +891,34 @@ vector `n` which is perpendicular to the plane and by vector `n_x`, which points in the direction of the x-axis of the plane. `frame_a` and `frame_b` coincide when `s_x=prismatic_x.s=0, s_y=prismatic_y.s=0` and `phi=revolute.phi=0`. + +# Structural parameters +- `n`: Axis orthogonal to unconstrained plane, resolved in `frame_a` (= same as in `frame_b`) +- `n_x`: Vector in direction of x-axis of plane, resolved in `frame_a` (`n_x` shall be orthogonal to `n`) + +# Connectors +- `frame_a`: Frame for the joint +- `frame_b`: Frame for the joint + +# Variables +- `s_x`: Relative distance along first prismatic joint starting at `frame_a` +- `s_y`: Relative distance along second prismatic joint starting at first prismatic joint +- `phi`: Relative rotation angle from `frame_a` to `frame_b` +- `v_x`: Relative velocity along first prismatic joint +- `v_y`: Relative velocity along second prismatic joint +- `w`: Relative angular velocity around revolute joint +- `a_x`: Relative acceleration along first prismatic joint +- `a_y`: Relative acceleration along second prismatic joint +- `wd`: Relative angular acceleration around revolute joint + +# Rendering parameters +- `cylinderlength`: Length of the revolute cylinder +- `cylinderdiameter`: Diameter of the revolute cylinder +- `cylindercolor`: (structural) Color of the revolute cylinder +- `boxwidth`: Width of the prismatic joint boxes +- `boxheight`: Height of the prismatic joint boxes +- `boxcolor`: (structural) Color of the prismatic joint boxes +- `radius`: (structural) Radius of the revolute cylinder """ @mtkmodel Planar begin @structural_parameters begin