Skip to content

Commit 78e3721

Browse files
committed
move docstrings from index page to separate pages
1 parent f2e76f7 commit 78e3721

File tree

10 files changed

+140
-110
lines changed

10 files changed

+140
-110
lines changed

docs/make.jl

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,41 @@ makedocs(;
2020
prettyurls = get(ENV, "CI", nothing) == "true",
2121
edit_link = nothing),
2222
pages = [
23-
"Home" => "index.md",
24-
"Tutorials" => [
25-
"Getting started: Pendulum" => "examples/pendulum.md",
26-
],
27-
"Examples" => [
28-
"Spring-damper system" => "examples/spring_damper_system.md",
29-
"Spring-mass system" => "examples/spring_mass_system.md",
30-
"Three springs (series forces)" => "examples/three_springs.md",
31-
"Sensors" => "examples/sensors.md",
32-
"Spherical pendulum" => "examples/spherical_pendulum.md",
33-
"Gearbox" => "examples/gearbox.md",
34-
"Free motions" => "examples/free_motion.md",
35-
"Prescribed motions" => "examples/prescribed_pose.md",
36-
"Kinematic loops" => "examples/kinematic_loops.md",
37-
"Industrial robot" => "examples/robot.md",
38-
"Ropes, cables and chains" => "examples/ropes_and_cables.md",
39-
"Swing" => "examples/swing.md",
40-
"Bodies in space" => "examples/space.md",
41-
"Gyroscopic effects" => "examples/gyroscopic_effects.md",
42-
"Wheels" => "examples/wheel.md",
43-
"Suspension systems" => "examples/suspension.md",
44-
"Quadrotor with cable-suspended load" => "examples/quad.md",
45-
],
46-
"Rotations and orientation" => "rotations.md",
47-
"3D rendering" => "rendering.md",
48-
"URDF import" => "urdf.md",
23+
"Home" => "index.md",
24+
"Tutorials" => [
25+
"Getting started: Pendulum" => "examples/pendulum.md",
26+
],
27+
"Examples" => [
28+
"Spring-damper system" => "examples/spring_damper_system.md",
29+
"Spring-mass system" => "examples/spring_mass_system.md",
30+
"Three springs (series forces)" => "examples/three_springs.md",
31+
"Sensors" => "examples/sensors.md",
32+
"Spherical pendulum" => "examples/spherical_pendulum.md",
33+
"Gearbox" => "examples/gearbox.md",
34+
"Free motions" => "examples/free_motion.md",
35+
"Prescribed motions" => "examples/prescribed_pose.md",
36+
"Kinematic loops" => "examples/kinematic_loops.md",
37+
"Industrial robot" => "examples/robot.md",
38+
"Ropes, cables and chains" => "examples/ropes_and_cables.md",
39+
"Swing" => "examples/swing.md",
40+
"Bodies in space" => "examples/space.md",
41+
"Gyroscopic effects" => "examples/gyroscopic_effects.md",
42+
"Wheels" => "examples/wheel.md",
43+
"Suspension systems" => "examples/suspension.md",
44+
"Quadrotor with cable-suspended load" => "examples/quad.md",
45+
],
46+
"Components" => [
47+
"Frames" => "frames.md",
48+
"Joints" => "joints.md",
49+
"Components" => "components.md",
50+
"Forces" => "forces.md",
51+
"Sensors" => "sensors.md",
52+
"Trajectory planning" => "trajectory_planning.md",
53+
"Interfaces" => "interfaces.md",
54+
],
55+
"Rotations and orientation" => "rotations.md",
56+
"3D rendering" => "rendering.md",
57+
"URDF import" => "urdf.md",
4958
])
5059

5160
deploydocs(;

docs/src/components.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Components
2+
3+
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.
4+
5+
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.
6+
7+
A rod without a mass (just a translation), is modeled using [`FixedTranslation`](@ref).
8+
9+
```@index
10+
```
11+
12+
```@autodocs
13+
Modules = [Multibody, Multibody.PlanarMechanics]
14+
Pages = ["components.jl", "wheels.jl", "PlanarMechanics/components.jl"]
15+
```

docs/src/forces.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Forces
2+
3+
```@index
4+
```
5+
6+
7+
```@autodocs
8+
Modules = [Multibody, Multibody.PlanarMechanics]
9+
Pages = ["forces.jl"]
10+
```

docs/src/frames.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Frames
2+
3+
## Docstrings
4+
```@index
5+
```
6+
7+
```@autodocs
8+
Modules = [Multibody, Multibody.PlanarMechanics]
9+
Pages = ["frames.jl", "PlanarMechanics/utils.jl"]
10+
```

docs/src/index.md

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -175,85 +175,3 @@ Multibody.jl offers components for modeling in both 2D and 3D. 2D modeling, ofte
175175

176176
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.
177177

178-
179-
## Index
180-
```@index
181-
```
182-
183-
184-
## Frames
185-
```@autodocs
186-
Modules = [Multibody, Multibody.PlanarMechanics]
187-
Pages = ["frames.jl", "PlanarMechanics/utils.jl"]
188-
```
189-
190-
## Joints
191-
192-
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).
193-
194-
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.
195-
196-
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.
197-
198-
```@autodocs
199-
Modules = [Multibody, Multibody.PlanarMechanics]
200-
Pages = ["joints.jl", "fancy_joints.jl", "PlanarMechanics/joints.jl"]
201-
```
202-
203-
## Components
204-
205-
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.
206-
207-
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.
208-
209-
A rod without a mass (just a translation), is modeled using [`FixedTranslation`](@ref).
210-
211-
212-
```@autodocs
213-
Modules = [Multibody, Multibody.PlanarMechanics]
214-
Pages = ["components.jl", "wheels.jl", "PlanarMechanics/components.jl"]
215-
```
216-
217-
## Forces
218-
```@autodocs
219-
Modules = [Multibody]
220-
Pages = ["forces.jl"]
221-
```
222-
223-
## Sensors
224-
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.
225-
226-
```@autodocs
227-
Modules = [Multibody, Multibody.PlanarMechanics]
228-
Pages = ["sensors.jl", "PlanarMechanics/sensors.jl"]
229-
```
230-
231-
## Orientation utilities
232-
```@autodocs
233-
Modules = [Multibody, Multibody.PlanarMechanics]
234-
Pages = ["orientation.jl"]
235-
```
236-
237-
## Interfaces
238-
```@autodocs
239-
Modules = [Multibody]
240-
Pages = ["interfaces.jl"]
241-
```
242-
243-
## Trajectory planning
244-
Two methods of planning trajectories are available
245-
- [`point_to_point`](@ref): Generate a minimum-time point-to-point trajectory with specified start and endpoints, not exceeding specified speed and acceleration limits.
246-
- [`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.
247-
248-
Components that make use of these trajectory generators is provided:
249-
- [`KinematicPTP`](@ref)
250-
- [`Kinematic5`](@ref)
251-
252-
These both have output connectors of type `RealOutput` called `q, qd, qdd` for positions, velocities and accelerations.
253-
254-
See [Industrial robot](@ref) for an example making use of the [`point_to_point`](@ref) planner.
255-
256-
```@autodocs
257-
Modules = [Multibody]
258-
Pages = ["path_planning.jl", "ptp.jl"]
259-
```

docs/src/interfaces.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Interfaces
2+
3+
## Docstrings
4+
```@autodocs
5+
Modules = [Multibody]
6+
Pages = ["interfaces.jl"]
7+
```

docs/src/joints.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Joints
2+
3+
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).
4+
5+
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.
6+
7+
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.
8+
9+
## Docstrings
10+
```@index
11+
```
12+
13+
```@autodocs
14+
Modules = [Multibody, Multibody.PlanarMechanics]
15+
Pages = ["joints.jl", "fancy_joints.jl", "PlanarMechanics/joints.jl"]
16+
```

docs/src/rotations.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,12 @@ rotation_axis(R), rotation_angle(R) # Get an axis-angle representation
6262
See [Orientations and directions](@ref)
6363

6464

65-
## Orientation API
66-
See [Orientation utilities](@ref)
65+
66+
## Docstrings
67+
```@index
68+
```
69+
70+
```@autodocs
71+
Modules = [Multibody, Multibody.PlanarMechanics]
72+
Pages = ["orientation.jl"]
73+
```

docs/src/sensors.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Sensors
2+
3+
4+
## Docstrings
5+
```@index
6+
```
7+
8+
9+
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.
10+
11+
```@autodocs
12+
Modules = [Multibody, Multibody.PlanarMechanics]
13+
Pages = ["sensors.jl", "PlanarMechanics/sensors.jl"]
14+
```

docs/src/trajectory_planning.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Trajectory_planning
2+
3+
Two methods of planning trajectories are available
4+
- [`point_to_point`](@ref): Generate a minimum-time point-to-point trajectory with specified start and endpoints, not exceeding specified speed and acceleration limits.
5+
- [`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.
6+
7+
Components that make use of these trajectory generators is provided:
8+
- [`KinematicPTP`](@ref)
9+
- [`Kinematic5`](@ref)
10+
11+
These both have output connectors of type `RealOutput` called `q, qd, qdd` for positions, velocities and accelerations.
12+
13+
See [Industrial robot](@ref) for an example making use of the [`point_to_point`](@ref) planner.
14+
15+
## Docstrings
16+
17+
```@index
18+
```
19+
20+
21+
```@autodocs
22+
Modules = [Multibody]
23+
Pages = ["path_planning.jl", "ptp.jl"]
24+
```

0 commit comments

Comments
 (0)