Skip to content

Commit

Permalink
move docstrings from index page to separate pages
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Sep 24, 2024
1 parent f2e76f7 commit 78e3721
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 110 deletions.
61 changes: 35 additions & 26 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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(;
Expand Down
15 changes: 15 additions & 0 deletions docs/src/components.md
Original file line number Diff line number Diff line change
@@ -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"]
```
10 changes: 10 additions & 0 deletions docs/src/forces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Forces

```@index
```


```@autodocs
Modules = [Multibody, Multibody.PlanarMechanics]
Pages = ["forces.jl"]
```
10 changes: 10 additions & 0 deletions docs/src/frames.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Frames

## Docstrings
```@index
```

```@autodocs
Modules = [Multibody, Multibody.PlanarMechanics]
Pages = ["frames.jl", "PlanarMechanics/utils.jl"]
```
82 changes: 0 additions & 82 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
```
7 changes: 7 additions & 0 deletions docs/src/interfaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Interfaces

## Docstrings
```@autodocs
Modules = [Multibody]
Pages = ["interfaces.jl"]
```
16 changes: 16 additions & 0 deletions docs/src/joints.md
Original file line number Diff line number Diff line change
@@ -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"]
```
11 changes: 9 additions & 2 deletions docs/src/rotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

## Docstrings
```@index
```

```@autodocs
Modules = [Multibody, Multibody.PlanarMechanics]
Pages = ["orientation.jl"]
```
14 changes: 14 additions & 0 deletions docs/src/sensors.md
Original file line number Diff line number Diff line change
@@ -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"]
```
24 changes: 24 additions & 0 deletions docs/src/trajectory_planning.md
Original file line number Diff line number Diff line change
@@ -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"]
```

0 comments on commit 78e3721

Please sign in to comment.