Stanford AA274A Principles of Robotic Autonomy | Autumn 2019 | Trajectory Optimization
Stanford Online
Trajectory optimization goal 1:01
The lecture turns from robot models and ROS setup to the problem of finding a motion from an initial position and heading to a desired final one. The path must obey the robot’s motion rules, such as a no-slip or rolling constraint for a wheeled robot. It may also need to minimize time, control effort, or both. The main method named here is differential flatness, which is useful for systems such as quadrotors.
Differential equations and Euler 5:02
Robot motion is written as a differential equation, meaning an equation for an unknown function and its derivative. You do not need analytic solutions here. The class uses numerical discretization, especially the Euler method. With a small time step, x(t + Δt) is approximated by x(t) + Δt ẋ(t), so an initial state can be stepped forward recursively. Smaller steps give better accuracy, but they also require more computation.
Feasible and optimal paths 14:00
A trajectory is the time history of the state from t0 to tf. It must satisfy the dynamics, input bounds such as limits on linear and angular speed, and state bounds such as obstacle avoidance. If it only satisfies those constraints, it is feasible. If it also minimizes a cost, it is an optimal trajectory problem. The cost is written as a terminal term H(x(tf), tf) plus an integral running cost over time.
Terminal cost and labels 20:00
The terminal cost is the cost you pay at the final time. It lets you aim for a point without needing to hit it exactly. A squared distance to a desired state is one common form. The notation uses D for desired, as in desired state or desired trajectory.
Trajectory versus motion 22:00
If there are no state constraints, the problem is called trajectory optimization. If there are state constraints, such as collision avoidance, it becomes motion planning. The choice of cost is left to the designer. You may care only about time, or you may trade time against fuel. The final time can be fixed or free, depending on the task.
Open loop and feedback 25:31
Open loop control depends only on time. Closed loop control depends on state and time, so it can correct drift when the model is not exact. Open loop is easier to compute, but it gives you no way back if you drift away from the planned path. A practical compromise is to compute an open loop reference and add a feedback tracking term around it.
Direct methods first 33:30
Two main solution styles are direct and indirect methods. Direct methods discretize time first. They replace integrals with sums and differential equations with difference equations, then solve a nonlinear optimization problem over finitely many variables. The cost is approximated by summing small pieces over time, and Euler integration is the basic example used for the dynamics.
Direct and indirect methods 40:02
Free final time and harder terminal conditions are left aside here. The discussion turns to how nonlinear optimization is usually handled. In indirect methods, you first derive necessary conditions for optimality, then solve those conditions for the control trajectory. The catch is that these conditions are differential equations, not just algebraic equations, so they are harder to solve and must be discretized.
Flatness for car paths 44:02
For mobile robots, the practical goal is often not perfect optimality but a feasible trajectory that is good enough and fast to compute. Differential flatness makes that easier for certain systems. A simple car is used as the example. If you prescribe a smooth path in x and y, you can recover the heading, speed, and steering angle from the path and its derivatives. The flat output here is x and y, and the key point is that no differential equation needs to be solved to get the inputs.
Flat output steps 1:00:01
A trajectory can be built in the flat output space without working through the full dynamics first. Initial and final conditions on state and input are turned into conditions on the flat outputs and their derivatives. You then fit a smooth curve, often with polynomial interpolation, and map it back to recover the remaining states and controls.
Polynomial interpolation 1:03:01
Each flat output can be written as a polynomial in chosen basis functions. The unknowns are the coefficients, not the whole curve, which keeps the computation light and reliable. More basis functions give you more flexibility, but they also make the problem larger and slower.
Constraints and smoothness 1:06:32
Extra bounds are handled by translating them into the flat output space when possible, or by using good proxy constraints there. The common cost is smoothness, often measured with jerk or snap, so the path has fewer sharp changes and less control effort. For input bounds, one practical trick is time scaling, where you speed up or slow down the same path until the input limits are met.
Where flatness works 1:11:01
There is no general computable test for whether a system is differentially flat. In practice, finding a new flat system is notable enough to publish, and reference catalogs list many known cases and their mappings. For mobile robotics, the unicycle model and the simple car model are both flat, which is why the method is so useful here.
AI-generated summary. It can be wrong or incomplete - check anything that matters against the original.

