Skip to content

Commit 811d0aa

Browse files
committed
fix align formating in docs
1 parent 2a3f3ea commit 811d0aa

12 files changed

+143
-108
lines changed

docs/make.jl

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,11 @@ makedocs(
1010
##############################################
1111
## MAKE SURE TO SYNC WITH docs/src/index.md ##
1212
##############################################
13-
"Basics" => [
14-
"index.md",
15-
"install.md",
16-
"get_started.md",
17-
"notations.md",
18-
],
13+
"index.md",
1914

2015
"Creating a Mechanism" => [
2116
"define_mechanism.md",
2217
"load_mechanism.md",
23-
"mechanism_interfaces.md",
2418
],
2519

2620
"Creating a Simulation" => [
@@ -47,7 +41,6 @@ makedocs(
4741

4842
"Examples" => [
4943
"simulation.md",
50-
"control.md",
5144
"trajectory_optimization.md",
5245
"reinforcement_learning.md",
5346
"system_identification.md",

docs/src/contact_models.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Overview
22

3-
### Models
4-
Impact and friction behaviors are modeled, along with the system’s dynamics, as an NCP. This model simulates hard contact without requiring system-specific solver tuning. Additionally, contacts between a system and the environment are treated as a single graph node connected to a rigid body (see below). As a result, the simulator retains efficient linear-time complexity for open-chain mechanical systems.
3+
Impact and friction behaviors are modeled, along with the system’s dynamics, as a nonlinear complementarity problem (NCP). This model simulates hard contact without requiring system-specific solver tuning. Additionally, contacts between a system and the environment are treated as a single graph node connected to a rigid body (see below). As a result, the simulator retains efficient linear-time complexity for open-chain mechanical systems.
54

65
![graph](./assets/graph.png)
76

@@ -14,7 +13,6 @@ Three contact models are implemented in Dojo:
1413

1514
All 3 of these contact models implement hard contact i.e. no interpenetration. This means that for both the nonlinear and linearized cones, we concatenate the constraints resulting from friction with the impact constraints.
1615

17-
1816
### Implementation
1917
Dojo currently supports contact constraints occurring between a sphere and the ground i.e. a horizontal half-space of altitude 0.0. Each spherical contact is attached to a single [`Body`](@ref).
2018

@@ -23,7 +21,6 @@ To create a new point of contact, we need to define:
2321
- radius of the sphere defining the spherical contact
2422
- coefficient of friction (except for [`ImpactContact`](@ref))
2523

26-
2724
### Example
2825
For the Quadruped model shown in the picture below, we defined 12 contacts spheres show in red:
2926
- 4 for the feet,

docs/src/control.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/src/impact.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,26 @@
33
### Mathematical Model
44
We model hard contact via constraints on the system’s configuration and the applied contact forces. For a system with $P$ contact points, we define a signed-distance function,
55

6-
$$\phi : \mathbf{Z} \rightarrow \mathbf{R}^P$$
6+
```math
7+
\phi : \mathbf{Z} \rightarrow \mathbf{R}^P
8+
```
79

810
subject to the following element-wise constraint:
911

10-
$$ϕ(z) > 0,$$
12+
```math
13+
ϕ(z) > 0,
14+
```
1115

12-
Impact forces with magnitude $\gamma \in \mathbf{R}^P$ are applied to the bodies’ contact points in the direction of their surface normals in order to enforce (5) and prevent interpenetration. A non-negative constraint,
16+
Impact forces with magnitude ``\gamma \in \mathbf{R}^P`` are applied to the bodies’ contact points in the direction of their surface normals in order to enforce (5) and prevent interpenetration. A non-negative constraint,
1317

14-
$$\gamma \geq 0,$$
18+
```math
19+
\gamma \geq 0,
20+
```
1521

1622
enforces physical behavior that impulses are repulsive (e.g., the floor does not attract bodies), and the complementarity condition,
1723

18-
$$\gamma \circ \phi(z) = 0,$$
24+
```math
25+
\gamma \circ \phi(z) = 0,
26+
```
1927

20-
where $\circ$ is an element-wise product operator, enforces zero force if the body is not in contact and allows non-zero force during contact.
21-
22-
23-
### Constructor
24-
[`ImpactContact`](@ref)
28+
where ``\circ`` is an element-wise product operator, enforces zero force if the body is not in contact and allows non-zero force during contact.

docs/src/index.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# [Dojo](https://github.com/dojo-sim/Dojo.jl)
2-
A differentiable simulator for robotics
1+
# Get Started
2+
3+
__[Dojo](https://github.com/dojo-sim/Dojo.jl) is a differentiable simulator for robotics__, prioritizing accurate physics and useful gradients. The simulator is written in pure Julia in order to be both performant and easy to use.
34

45
## Features
5-
* __Maximal-Coordinates Representation__
6-
* __Smooth Gradients__
7-
* __Open Source__: Our code is available on [GitHub](https://github.com/dojo-sim/Dojo.jl) and distributed under the MIT Licence.
6+
* __Maximal-Coordinates Representation__: Fast and efficient conversion between [maximal](maximal_representation.md) and [minimal](minimal_representation.md) representations
7+
* __Smooth Gradients__: Simulation with [hard contact](impact.md) and useful [gradients](gradients.md) through contact events
8+
* __Open Source__: Code is available on [GitHub](https://github.com/dojo-sim/Dojo.jl) and distributed under the MIT Licence.
89
* __Python Interface__: [dojopy](https://github.com/dojo-sim/dojopy)
910

1011
## Installation
@@ -22,11 +23,16 @@ If you want to install the latest version from main run
2223
## Credits
2324

2425
The following people are involved in the development of Dojo:
26+
27+
__Primary Development__
2528
* [Simon Le Cleac'h](https://simon-lc.github.io/) (main developement, contact modeling, interior-point solver, gradients)
2629
* [Taylor Howell](https://thowell.github.io/) (main developement, contact modeling, interior-point solver, gradients)
2730
* [Jan Bruedigam](https://github.com/janbruedigam) (main developemnt, maximal representation and graph-based solver)
28-
* [Zico Kolter](https://zicokolter.com/) (implicit differentiation)
29-
* [Zachary Manchester](https://www.ri.cmu.edu/ri-faculty/zachary-manchester/) (principal investigator, physics and algorithms)
31+
32+
33+
* [Zico Kolter](https://zicokolter.com/)
34+
* [Mac Schwager](https://web.stanford.edu/~schwager/)
35+
* [Zachary Manchester](https://www.ri.cmu.edu/ri-faculty/zachary-manchester/)
3036

3137
Development by the [Robotic Exploration Lab](https://roboticexplorationlab.org/).
3238

docs/src/interior_point.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,46 @@ The primary advantages of this algorithm are the correction to the classic Newto
88
### Problem formulation
99
The solver aims to satisfy instantiations of the following problem:
1010

11-
$$\text{find}\quad x, y, z \\
12-
\text{subject to}\quad c(x, y, z; \theta) = 0, \\
13-
y^{(i)} \circ z^{(i)} = \kappa \mathbf{e}, \quad i = 1,\dots,n, \\
14-
y^{(i)}, z^{(i)} \in \mathcal{K}, \quad i = 1,\dots, n,$$
11+
```math
12+
\begin{align*}
13+
\text{find} & \quad x, y, z \\
14+
\text{subject to} & \quad c(x, y, z; \theta) = 0, \\
15+
& \quad y^{(i)} \circ z^{(i)} = \kappa \mathbf{e}, && \quad i = 1,\dots,n, \\
16+
& \quad y^{(i)}, z^{(i)} \in \mathcal{K}, && \quad i = 1,\dots, n,
17+
\end{align*}
18+
```
1519

16-
with decision variables $x \in \mathbf{R}^k$ and $y, z \in \mathbf{R}^m$, equality-constraint set $c : \mathbf{R}^k \times \mathbf{R}^m \times \mathbf{R}^m \times \mathbf{R}^l \rightarrow \mathbf{R}^h$, problem data $\theta \in \mathbf{R}^l$; and where $\mathcal{K}$ is the Cartesian product of $n$ total positive-orthant and second-order cones. The variables are partitioned: $x = (x^{(1)}, \dots, x^{(p)})$, where $i = 1$ are Euclidean variables and $i = 2, \dots, p$ are each quaternion variables; and $y = (y^{(1)}, \dots, y^{(n)})$, $z = (z^{(1)}, \dots, z^{(n)})$, where $j = 1$ is the positive-orthant and the remaining $j = 2, \dots, n$ are second-order cones. For convenience, we denote $w = (x, y, z)$.
20+
with decision variables ``x \in \mathbf{R}^k`` and ``y, z \in \mathbf{R}^m``, equality-constraint set ``c : \mathbf{R}^k \times \mathbf{R}^m \times \mathbf{R}^m \times \mathbf{R}^l \rightarrow \mathbf{R}^h``, problem data ``\theta \in \mathbf{R}^l``; and where ``\mathcal{K}`` is the Cartesian product of ``n`` total positive-orthant and second-order cones. The variables are partitioned: ``x = (x^{(1)}, \dots, x^{(p)})``, where ``i = 1`` are Euclidean variables and ``i = 2, \dots, p`` are each quaternion variables; and ``y = (y^{(1)}, \dots, y^{(n)})``, ``z = (z^{(1)}, \dots, z^{(n)})``, where ``j = 1`` is the positive-orthant and the remaining ``j = 2, \dots, n`` are second-order cones. For convenience, we denote ``w = (x, y, z)``.
1721

18-
The algorithm aims to satisfy a sequence of relaxed problems with $\kappa > 0$ and $\kappa \rightarrow 0$ in order to reliably converge to a solution of the original problem (i.e., $\kappa = 0$). This continuation approach helps avoid premature ill-conditioning and is the basis for numerous convex and non-convex general-purpose interior-point solvers.
22+
The algorithm aims to satisfy a sequence of relaxed problems with ``\kappa > 0`` and ``\kappa \rightarrow 0`` in order to reliably converge to a solution of the original problem (i.e., ``\kappa = 0``). This continuation approach helps avoid premature ill-conditioning and is the basis for numerous convex and non-convex general-purpose interior-point solvers.
1923

2024
### Violation metrics:
2125
Two metrics are used to measure progress:
2226
The constraint violation,
2327

24-
$$r_{\text{vio}} = \| c(w; \theta) \|_{\infty},$$
28+
```math
29+
r_{\text{vio}} = \| c(w; \theta) \|_{\infty},
30+
```
2531

2632
and complementarity violation,
2733

28-
$$b_{\text{vio}} = {\text{max}}_i \{\| y^{(i)} \circ z^{(i)} \|_{\infty}\}.$$
34+
```math
35+
b_{\text{vio}} = {\text{max}}_i \{\| y^{(i)} \circ z^{(i)} \|_{\infty}\}.
36+
```
2937

30-
The NCP is considered solved when $r_{\text{vio}} < r_{\text{tol}}$ and $b_{\text{vio}} < b_{\text{tol}}$.
38+
The NCP is considered solved when ``r_{\text{vio}} < r_{\text{tol}}`` and ``b_{\text{vio}} < b_{\text{tol}}``.
3139
!!! info "solver options"
3240
Both `r_tol` and `b_tol` are options that can easily be accessed and modified via [`SolverOptions`](@ref).
3341

3442
### Newton Steps
35-
The main loop of the solver performs Newton's method on the equality-constraint set $c$ and the bilinear constraints. The solver typically converges in about 10 iterations.
43+
The main loop of the solver performs Newton's method on the equality-constraint set ``c`` and the bilinear constraints. The solver typically converges in about 10 iterations.
3644
!!! info "solver options"
3745
The maximal number of Newton's iterations `max_iter` can be set via [`SolverOptions`](@ref).
3846

3947
### Line Search
40-
Newton's method provides a search direction, then we perform a line search along this search direction to detemine the step length $\alpha$. We use a backtracking line search that accepts the step whenever it decreases $c_{\text{vio}}$ or $b_{\text{vio}}$.
41-
The line search starts with a step $\alpha=1$, if the step acceptance conditions are not met the step is decreased geometrically:
42-
$$\alpha \leftarrow \alpha \times s $$. The line search takes at most `max_ls` backtracking steps.
48+
Newton's method provides a search direction, then we perform a line search along this direction to detemine the step length ``\alpha``. We use a backtracking line search that accepts the step whenever it decreases ``c_{\text{vio}}`` or ``b_{\text{vio}}``.
49+
The line search starts with a step ``\alpha=1``, if the step acceptance conditions are not met the step is decreased geometrically:
50+
``\alpha \leftarrow s \cdot \alpha``. The line search takes at most `max_ls` backtracking steps.
4351

4452
!!! info "solver options"
45-
The scaling parameter $s$ is called `ls_scale` and the maximum number of line search iteration `max_ls` can be set via [`SolverOptions`](@ref).
53+
The scaling parameter ``s`` is called `ls_scale` and the maximum number of line search iteration `max_ls` can be set via [`SolverOptions`](@ref).

docs/src/linearized_friction.md

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,41 @@
1-
# Linearized friction
1+
# Linearized Friction
22

3-
### Mathematical Model
4-
Coulomb friction instantaneously maximizes the dissipation of kinetic energy between two objects in contact. For a single contact point, this physical phenomenon can be modeled by the following optimization problem,
5-
6-
$$\text{minimize}_{b} \quad v^T b \\
7-
\text{subject to} \quad \|b\|_2v\leq \mu \gamma,$$
3+
Coulomb friction instantaneously maximizes the dissipation of kinetic energy between two objects in contact.
84

9-
where $v \in \mathbf{R}^{2}$ is the tangential velocity at the contact point, $b \in \mathbf{R}^2$ is the friction force, and $\mu \in \mathbf{R}_{+}$ is the coefficient of friction between the two objects.
5+
### Mathematical Model
6+
For a single contact point, this physical phenomenon can be modeled by the following optimization problem,
107

8+
```math
9+
\begin{align*}
10+
\text{minimize}_{b} & \quad v^T b \\
11+
\text{subject to} & \quad \|b\|_2 \leq \mu \gamma,
12+
\end{align*}
13+
```
1114

15+
where ``v \in \mathbf{R}^{2}`` is the tangential velocity at the contact point, ``b \in \mathbf{R}^2`` is the friction force, and ``\mu \in \mathbf{R}_{+}`` is the coefficient of friction between the two objects.
1216

13-
This problem is naturally a convex second-order cone program, and can be efficiently and reliably solved. However, classically, an approximate version of the above problem:
17+
### Linearized Model
18+
This above problem is naturally a convex second-order cone program, and can be efficiently and reliably solved. However, classically, an approximate version:
1419

15-
$$\text{minimize}_{\beta} \quad [v^T -v^T] \beta, \\
16-
\text{subject to} \quad \beta^T \mathbf{1} \leq \mu \gamma, \\
17-
\beta \geq 0,$$
20+
```math
21+
\begin{align*}
22+
\text{minimize}_{\beta} & \quad [v^T -v^T] \beta, \\
23+
\text{subject to} & \quad \beta^T \mathbf{1} \leq \mu \gamma, \\
24+
& \quad \beta \geq 0,
25+
\end{align*}
26+
```
1827

19-
which satisfies the LCP formulation, is instead solved. Here, the friction cone is linearized and the friction vector, $\beta \in \mathbf{R}^{4}$, is correspondingly overparameterized and subject to additional non-negative constraints.
28+
which satisfies the LCP formulation, is instead solved. Here, the friction cone is linearized and the friction vector, ``\beta \in \mathbf{R}^{4}``, is correspondingly overparameterized and subject to additional non-negative constraints.
2029

2130
The optimality conditions of the above problem and constraints used in the LCP are:
2231

23-
$$[v^T -v^T]^T + \psi \mathbf{1} - \eta = 0, \\
24-
\mu \gamma -\beta^T \textbf{1} \geq 0,\\
25-
\psi \cdot (\mu \gamma - \beta^T \textbf{1}) = 0, \\
26-
\beta \circ \eta = 0, \\
27-
\beta, \psi, \eta \geq 0,$$
28-
29-
where $\psi \in \mathbf{R}$ and $\eta \in \mathbf{R}^{4}$ are the dual variables associated with the friction cone and positivity constraints, respectively, and $\textbf{1}$ is a vector of ones.
30-
31-
### Constructor
32-
[`LinearContact`](@ref)
32+
```math
33+
\begin{align*}
34+
[v^T -v^T]^T + \psi \mathbf{1} - \eta &= 0, \\
35+
\mu \gamma -\beta^T \textbf{1} & \geq 0,\\
36+
\psi \cdot (\mu \gamma - \beta^T \textbf{1}) &= 0, \\
37+
\beta \circ \eta &= 0, \\
38+
\beta, \psi, \eta &\geq 0,
39+
\end{align*}
40+
```
41+
where ``\psi \in \mathbf{R}`` and ``\eta \in \mathbf{R}^{4}`` are the dual variables associated with the friction cone and positivity constraints, respectively, and ``\textbf{1}`` is a vector of ones.

docs/src/maximal_representation.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
The ``i``-th body in a mechanism with ``N`` bodies has state:
44

5-
``z^{(i)} = (x^{(i)}, v^{(i)}, q^{(i)}, \omega^{(i)}) \in \mathbf{R}^3 \times \mathbf{R}^3 \times \mathbf{H} \times \mathbf{R}^3``,
5+
```math
6+
z^{(i)} = (x^{(i)}, v^{(i)}, q^{(i)}, \omega^{(i)}) \in \mathbf{R}^3 \times \mathbf{R}^3 \times \mathbf{H} \times \mathbf{R}^3,
7+
```
68

79
represented in maximal coordinates, where ``\mathbf{H}`` is the space of unit quaternions.
810

@@ -13,7 +15,9 @@ represented in maximal coordinates, where ``\mathbf{H}`` is the space of unit qu
1315

1416
The mechanism state:
1517

16-
``z = (z^{(1)}, \dots, z^{(N)})``.
18+
```math
19+
z = (z^{(1)}, \dots, z^{(N)}).
20+
```
1721

1822
is the concatentation of all body states.
1923

docs/src/mechanism_interfaces.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/src/minimal_representation.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ Dojo simulates systems in [maximal coordinates](maximal_representation.md).
44

55
For a mechanism with ``M`` joints and ``N`` bodies, the maximal representation ``z`` can be efficiently converted to minimal coordinates:
66

7-
``y = (y^{(1)}, \dots, y^{(M)}) \leftarrow z = (z^{(1)}, \dots, z^{(N)})``,
7+
```math
8+
y = (y^{(1)}, \dots, y^{(M)}) \leftarrow z = (z^{(1)}, \dots, z^{(N)}),
9+
```
810

911
where ``y^{(j)}`` depends on the degree and type of joint. **Note**: this minimal representation does not stack coordinates followed by velocities, which is a common convention; instead, **coordinates and velocities are grouped by joint**.
1012

1113
Each minimal state comprises:
1214

13-
``y = (p_{\text{translational}}, p_{\text{rotational}}, w_{\text{translational}}, w_{\text{rotational}})``
15+
```math
16+
y = (p_{\text{translational}}, p_{\text{rotational}}, w_{\text{translational}}, w_{\text{rotational}})
17+
```
1418

1519
coordinates ``p`` and velocities ``w`` for both translational and rotational degrees of freedom.
1620

0 commit comments

Comments
 (0)