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 @@

Underactuated Robotics -

Trajectory optimization for the Double Integrator

+

Trajectory optimization for the Double Integrator

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 @@

The special case of direct shooting without state constraints

to solve the convex relaxation (followed by a little "rounding") to solve the problem to global optimality.

-

Minimum-time problems

- -

Recall one of our first

+

Minimum-time linear optimal control

+

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.

+

MPC for piecewise-affine systems (PWAMPC)

+

+

Motion planning around obstacles

@@ -1436,6 +1473,34 @@

The special case of direct shooting without state constraints

+

Minimum-snap trajectories for quadrotors flying around obstacles

+ +

Mellinger11 showed that minimum-snap is convex (as long as each + time step of the plan is confined to a single convex region) using + differential flatness. Mellinger12 used an older MIP formulation to + allow the assignment of time steps to convex regions to be chosen by the + optimizer. But in both of these formulations, the total duration of the + trajectory had to be fixed. Requiring a fixed duration, in my opinion, is a very + unfortunate limitation.

+ +

Marcucci22 showed that the quadrotor motion planning problem + could be transcribed using GCS. Moreover, this paper considered a richer version + of the problem where the duration in each convex set is not pre-specified, but + is jointly optimized. Unfortunately, constraints on acceleration, jerk, and snap are nonconvex, and so did not fit neatly into this transcription.

+ +

More recently, Wrangel24 showed that we can effectively handle + the non-convexity of the derivative constraints (with time-scaling) by using convex approximations of the constraints in the (global) GCS search, and then using the exact nonconvex version of these constraints in the final rounding step.

+ +
+
Three candidate trajectories for a quadrotor navigating from the bottom left corner to the top right room of a building. The blue trajectory (convex GCS trajectory optimization) is fast but lacks smoothness and exhibits unrealistic roll due to high initial accelerations. The yellow and red trajectories (proposed method) enforce higher-order continuity, limit accelerations, and achieve smoother paths while the yellow trajectory also minimizes snap. (reproduced from Wrangel24)
+
+ +

You can check out the trajectories in the + meshcat animation.

+ +

Deepnote example notebook coming soon!

+
+

Explicit model-predictive control

@@ -1923,6 +1988,12 @@

The special case of direct shooting without state constraints

Proceedings of the International Conference on Robotics and Automation (ICRA) , May, 2016. [ link ] +
+
  • +David von Wrangel and Russ Tedrake, +"Using Graphs of Convex Sets to Guide Nonconvex Trajectory Optimization", +Under review , 2024. +

  • A. Alessio and A. Bemporad,