diff --git a/docs/make.jl b/docs/make.jl index e953a052..e793fd34 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -20,32 +20,41 @@ makedocs(; prettyurls = get(ENV, "CI", nothing) == "true", edit_link = nothing), pages = [ - "Home" => "index.md", - "Tutorials" => [ - "Getting started: Pendulum" => "examples/pendulum.md", - ], - "Examples" => [ - "Spring-damper system" => "examples/spring_damper_system.md", - "Spring-mass system" => "examples/spring_mass_system.md", - "Three springs (series forces)" => "examples/three_springs.md", - "Sensors" => "examples/sensors.md", - "Spherical pendulum" => "examples/spherical_pendulum.md", - "Gearbox" => "examples/gearbox.md", - "Free motions" => "examples/free_motion.md", - "Prescribed motions" => "examples/prescribed_pose.md", - "Kinematic loops" => "examples/kinematic_loops.md", - "Industrial robot" => "examples/robot.md", - "Ropes, cables and chains" => "examples/ropes_and_cables.md", - "Swing" => "examples/swing.md", - "Bodies in space" => "examples/space.md", - "Gyroscopic effects" => "examples/gyroscopic_effects.md", - "Wheels" => "examples/wheel.md", - "Suspension systems" => "examples/suspension.md", - "Quadrotor with cable-suspended load" => "examples/quad.md", - ], - "Rotations and orientation" => "rotations.md", - "3D rendering" => "rendering.md", - "URDF import" => "urdf.md", + "Home" => "index.md", + "Tutorials" => [ + "Getting started: Pendulum" => "examples/pendulum.md", + ], + "Examples" => [ + "Spring-damper system" => "examples/spring_damper_system.md", + "Spring-mass system" => "examples/spring_mass_system.md", + "Three springs (series forces)" => "examples/three_springs.md", + "Sensors" => "examples/sensors.md", + "Spherical pendulum" => "examples/spherical_pendulum.md", + "Gearbox" => "examples/gearbox.md", + "Free motions" => "examples/free_motion.md", + "Prescribed motions" => "examples/prescribed_pose.md", + "Kinematic loops" => "examples/kinematic_loops.md", + "Industrial robot" => "examples/robot.md", + "Ropes, cables and chains" => "examples/ropes_and_cables.md", + "Swing" => "examples/swing.md", + "Bodies in space" => "examples/space.md", + "Gyroscopic effects" => "examples/gyroscopic_effects.md", + "Wheels" => "examples/wheel.md", + "Suspension systems" => "examples/suspension.md", + "Quadrotor with cable-suspended load" => "examples/quad.md", + ], + "Components" => [ + "Frames" => "frames.md", + "Joints" => "joints.md", + "Components" => "components.md", + "Forces" => "forces.md", + "Sensors" => "sensors.md", + "Trajectory planning" => "trajectory_planning.md", + "Interfaces" => "interfaces.md", + ], + "Rotations and orientation" => "rotations.md", + "3D rendering" => "rendering.md", + "URDF import" => "urdf.md", ]) deploydocs(; diff --git a/docs/src/components.md b/docs/src/components.md new file mode 100644 index 00000000..77796658 --- /dev/null +++ b/docs/src/components.md @@ -0,0 +1,15 @@ +# Components + +The perhaps most fundamental component is a [`Body`](@ref), this component has a single flange, `frame_a`, which is used to connect the body to other components. This component has a mass, a vector `r_cm` from `frame_a` to the center of mass, and a moment of inertia tensor `I` in the center of mass. The body can be thought of as a point mass with a moment of inertia tensor. + +A mass with a shape can be modeled using a [`BodyShape`](@ref). The primary difference between a [`Body`](@ref) and a [`BodyShape`](@ref) is that the latter has an additional flange, `frame_b`, which is used to connect the body to other components. The translation between `flange_a` and `flange_b` is determined by the vector `r`. The [`BodyShape`](@ref) is suitable to model, e.g., cylinders, rods, and boxes. + +A rod without a mass (just a translation), is modeled using [`FixedTranslation`](@ref). + +```@index +``` + +```@autodocs +Modules = [Multibody, Multibody.PlanarMechanics] +Pages = ["components.jl", "wheels.jl", "PlanarMechanics/components.jl"] +``` diff --git a/docs/src/forces.md b/docs/src/forces.md new file mode 100644 index 00000000..fea7a490 --- /dev/null +++ b/docs/src/forces.md @@ -0,0 +1,10 @@ +# Forces + +```@index +``` + + +```@autodocs +Modules = [Multibody, Multibody.PlanarMechanics] +Pages = ["forces.jl"] +``` \ No newline at end of file diff --git a/docs/src/frames.md b/docs/src/frames.md new file mode 100644 index 00000000..2bbb1a40 --- /dev/null +++ b/docs/src/frames.md @@ -0,0 +1,10 @@ +# Frames + +## Docstrings +```@index +``` + +```@autodocs +Modules = [Multibody, Multibody.PlanarMechanics] +Pages = ["frames.jl", "PlanarMechanics/utils.jl"] +``` diff --git a/docs/src/index.md b/docs/src/index.md index f1fca0e2..3d971042 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -175,85 +175,3 @@ Multibody.jl offers components for modeling in both 2D and 3D. 2D modeling, ofte The components from [`ModelingToolkitStandardLibrary.Mechanical`](https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/API/mechanical/) are 1D, i.e., a single degree of freedom only. These components can be used in both 2D and 3D modeling together with Multibody components that have support for attaching 1D components, such as joints supporting the `axisflange` keyword. - -## Index -```@index -``` - - -## Frames -```@autodocs -Modules = [Multibody, Multibody.PlanarMechanics] -Pages = ["frames.jl", "PlanarMechanics/utils.jl"] -``` - -## Joints - -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). - -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. - -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. - -```@autodocs -Modules = [Multibody, Multibody.PlanarMechanics] -Pages = ["joints.jl", "fancy_joints.jl", "PlanarMechanics/joints.jl"] -``` - -## Components - -The perhaps most fundamental component is a [`Body`](@ref), this component has a single flange, `frame_a`, which is used to connect the body to other components. This component has a mass, a vector `r_cm` from `frame_a` to the center of mass, and a moment of inertia tensor `I` in the center of mass. The body can be thought of as a point mass with a moment of inertia tensor. - -A mass with a shape can be modeled using a [`BodyShape`](@ref). The primary difference between a [`Body`](@ref) and a [`BodyShape`](@ref) is that the latter has an additional flange, `frame_b`, which is used to connect the body to other components. The translation between `flange_a` and `flange_b` is determined by the vector `r`. The [`BodyShape`](@ref) is suitable to model, e.g., cylinders, rods, and boxes. - -A rod without a mass (just a translation), is modeled using [`FixedTranslation`](@ref). - - -```@autodocs -Modules = [Multibody, Multibody.PlanarMechanics] -Pages = ["components.jl", "wheels.jl", "PlanarMechanics/components.jl"] -``` - -## Forces -```@autodocs -Modules = [Multibody] -Pages = ["forces.jl"] -``` - -## Sensors -A sensor is an object that translates quantities in the mechanical domain into causal signals which can interact with causal components from [ModelingToolkitStandardLibrary.Blocks](https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/API/blocks/), such as control systems etc. - -```@autodocs -Modules = [Multibody, Multibody.PlanarMechanics] -Pages = ["sensors.jl", "PlanarMechanics/sensors.jl"] -``` - -## Orientation utilities -```@autodocs -Modules = [Multibody, Multibody.PlanarMechanics] -Pages = ["orientation.jl"] -``` - -## Interfaces -```@autodocs -Modules = [Multibody] -Pages = ["interfaces.jl"] -``` - -## Trajectory planning -Two methods of planning trajectories are available -- [`point_to_point`](@ref): Generate a minimum-time point-to-point trajectory with specified start and endpoints, not exceeding specified speed and acceleration limits. -- [`traj5`](@ref): Generate a 5:th order polynomial trajectory with specified start and end points. Additionally allows specification of start and end values for velocity and acceleration. - -Components that make use of these trajectory generators is provided: -- [`KinematicPTP`](@ref) -- [`Kinematic5`](@ref) - -These both have output connectors of type `RealOutput` called `q, qd, qdd` for positions, velocities and accelerations. - -See [Industrial robot](@ref) for an example making use of the [`point_to_point`](@ref) planner. - -```@autodocs -Modules = [Multibody] -Pages = ["path_planning.jl", "ptp.jl"] -``` \ No newline at end of file diff --git a/docs/src/interfaces.md b/docs/src/interfaces.md new file mode 100644 index 00000000..88096950 --- /dev/null +++ b/docs/src/interfaces.md @@ -0,0 +1,7 @@ +# Interfaces + +## Docstrings +```@autodocs +Modules = [Multibody] +Pages = ["interfaces.jl"] +``` \ No newline at end of file diff --git a/docs/src/joints.md b/docs/src/joints.md new file mode 100644 index 00000000..c600bc9b --- /dev/null +++ b/docs/src/joints.md @@ -0,0 +1,16 @@ +# Joints + +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). + +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. + +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. + +## Docstrings +```@index +``` + +```@autodocs +Modules = [Multibody, Multibody.PlanarMechanics] +Pages = ["joints.jl", "fancy_joints.jl", "PlanarMechanics/joints.jl"] +``` diff --git a/docs/src/rotations.md b/docs/src/rotations.md index a7864505..24773c83 100644 --- a/docs/src/rotations.md +++ b/docs/src/rotations.md @@ -62,5 +62,12 @@ rotation_axis(R), rotation_angle(R) # Get an axis-angle representation See [Orientations and directions](@ref) -## Orientation API -See [Orientation utilities](@ref) \ No newline at end of file + +## Docstrings +```@index +``` + +```@autodocs +Modules = [Multibody, Multibody.PlanarMechanics] +Pages = ["orientation.jl"] +``` \ No newline at end of file diff --git a/docs/src/sensors.md b/docs/src/sensors.md new file mode 100644 index 00000000..900c9194 --- /dev/null +++ b/docs/src/sensors.md @@ -0,0 +1,14 @@ +# Sensors + + +## Docstrings +```@index +``` + + +A sensor is an object that translates quantities in the mechanical domain into causal signals which can interact with causal components from [ModelingToolkitStandardLibrary.Blocks](https://docs.sciml.ai/ModelingToolkitStandardLibrary/stable/API/blocks/), such as control systems etc. + +```@autodocs +Modules = [Multibody, Multibody.PlanarMechanics] +Pages = ["sensors.jl", "PlanarMechanics/sensors.jl"] +``` diff --git a/docs/src/trajectory_planning.md b/docs/src/trajectory_planning.md new file mode 100644 index 00000000..8e24408c --- /dev/null +++ b/docs/src/trajectory_planning.md @@ -0,0 +1,24 @@ +# Trajectory_planning + +Two methods of planning trajectories are available +- [`point_to_point`](@ref): Generate a minimum-time point-to-point trajectory with specified start and endpoints, not exceeding specified speed and acceleration limits. +- [`traj5`](@ref): Generate a 5:th order polynomial trajectory with specified start and end points. Additionally allows specification of start and end values for velocity and acceleration. + +Components that make use of these trajectory generators is provided: +- [`KinematicPTP`](@ref) +- [`Kinematic5`](@ref) + +These both have output connectors of type `RealOutput` called `q, qd, qdd` for positions, velocities and accelerations. + +See [Industrial robot](@ref) for an example making use of the [`point_to_point`](@ref) planner. + +## Docstrings + +```@index +``` + + +```@autodocs +Modules = [Multibody] +Pages = ["path_planning.jl", "ptp.jl"] +``` \ No newline at end of file