diff --git a/book/BUILD.bazel b/book/BUILD.bazel index 23120235..14ba4876 100644 --- a/book/BUILD.bazel +++ b/book/BUILD.bazel @@ -76,6 +76,9 @@ rt_html_test( rt_html_test( srcs = ["trajopt.html"], + data = [ + "//book/data:drones_crazy.html", + ], ) rt_html_test( diff --git a/book/data b/book/data index d6ac8698..303803ca 160000 --- a/book/data +++ b/book/data @@ -1 +1 @@ -Subproject commit d6ac8698d673d7a0fa7c9289ad71e2cc623db6d7 +Subproject commit 303803caf81cd8bcd151eed741d8492c52e80e4e diff --git a/book/figures/min_time_gcs.svg b/book/figures/min_time_gcs.svg new file mode 100644 index 00000000..332109fd --- /dev/null +++ b/book/figures/min_time_gcs.svg @@ -0,0 +1,1296 @@ + + diff --git a/book/trajopt.html b/book/trajopt.html index f2186475..758ad837 100644 --- a/book/trajopt.html +++ b/book/trajopt.html @@ -161,7 +161,7 @@
We've looked at a few optimal control problems for the double integrator using value iteration. For one of them -- the quadratic @@ -1410,14 +1410,51 @@
Recall one of our first
+Recall our first example of the chapter was + doing trajectory optimization for the double integrator. Optimizing convex + objectives over a fixed horizon is naturally transcribed into convex + optimization problem. But in order to solve the minimum-time problem (where the + horizon is unknown), we had to solve multiple optimization problems to find the + correct horizon.
+ +This search over horizon can naturally be encoded as a mixed-integer problem, + and GCS provides a natural and efficient framework for doing it. First, let's + observe that the original fixed-horizon problem can naturally be described as a + GCS: take the sets to be the domain of $x$ (to make these domains bounded, one + can simply pick a conservative bounding box). Our graph will simply be a serial + chain with one copy of this set for each timestep, and edge constraints that + enforce the dynamics: $$\bx[n+1] - \bA \bx[n] \in \bB {\bf U},\qquad {\bf U} = + \left\{ \begin{bmatrix}u\end{bmatrix} \, | \, u \in [-1, 1] \right\}.$$ + Awesomely, once we implement all of the code optimizations that we are currently + working on for Drake's GCS implementation, formulating the problem in this way + will give you back exactly the same linear program that we solved + above.
+ +Now we can make the time duration optional by defining edges, with + constraints, from each timestep directly to the goal:
+ + + + + +Note that for this example, the GCS convex relaxation is not tight (yet; I
+ still have some ideas), but the convex_relaxation = False
version
+ solves beautifully, if you have an MIP solver available.
The minimum-time double integrator problem is too simple to warrant the use + of GCS. Afterall, the line search we recommended above can work efficiently + enough. But this is a nice simple illustration of how one might formulate + trajectory optimization as a GCS, and it will scale to much more complicated + formulations.
+More recently,
You can check out the trajectories in the + meshcat animation.
+ +Deepnote example notebook coming soon!
+