trajectory optimization
Trajectory optimization is the art of taking a rough plan of motion and polishing it into the best possible version, where 'best' means it scores lowest on some cost you care about — usually a mix of things like wasted energy, jerky movement, time taken, or how close it passes to obstacles. Instead of asking only 'what path gets me there', it asks 'of all the ways to get there, which one is smoothest, cheapest, and safest', and then mathematically searches for that one. Think of it like planning a road trip: many routes reach the destination, but you want the one that burns the least fuel, avoids potholes, and keeps the ride comfortable.
Crucially, the search is not free to pick anything — it must obey constraints, which are hard rules the answer is forbidden to break. Some constraints come from physics and the machine itself, called dynamics: a real arm can only move its joints so fast and push with so much force, so the optimizer cannot invent a motion the motors could never produce. Other constraints come from the environment: the trajectory must stay out of every obstacle and inside the robot's reachable space. The optimizer juggles all of this at once, nudging the whole motion bit by bit — speeding up here, easing off there, bowing wider around a corner — until it settles on a trajectory that is as cheap as possible while still legal under every rule.
Because it shapes the entire motion as one connected whole rather than one step at a time, trajectory optimization tends to produce flowing, natural-looking movement, which is why it is popular for robot arms, walking robots, drones, and self-driving cars. The trade-off is that it is heavier to compute and can land in a 'good enough but not truly best' answer if the starting guess is poor, so engineers often feed it a decent rough plan first and let the optimizer refine from there.
A welding arm is given a jagged first-draft path between two seams; trajectory optimization smooths it into a graceful sweep that finishes faster, never exceeds the motors' torque limits, and keeps the torch a safe distance from the clamp.
From a rough sketch to the smoothest legal motion.
The thing being minimized is called the cost function (or objective); the rules it must respect are constraints. A path that breaks no constraints is called feasible.