1. Home
  2. Explore
  3. Engineering
  4. Motion Planning Optimization

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Motion Planning Optimization

Probabilistic State Estimation and Motion Planning

Motion-planning refinements

LQR trees

Sampling-based motion planners explore possible paths by generating samples, usually making them effective at finding locally connected routes. LQR trees combine motion planning with linear-quadratic regulation (LQR): the planner builds a collection of states or trajectories with associated feedback controllers and regions of attraction.

The distinction is that a sampled path-planning method tends to reason locally about individual connections, while an LQR controller can stabilize the system from a broader region of attraction. Combining the two can produce a more efficient planner: the planner need not find a separate detailed path for every state if a controller can reliably drive many nearby states toward a known trajectory or goal.

Shortcutting

Sampling-based planners often return paths with unnecessary bends or detours. Shortcutting attempts to simplify such a path:

  1. Select two points along the planned route.

  2. Test whether the system can travel directly between them without colliding with obstacles or violating its motion constraints.

  3. If the connection is valid, replace the intervening section with the shorter connection.

  4. Repeat to remove further unnecessary detours.

A straight-line shortcut is appropriate only when the system can follow such a path and the connection is collision-free. Systems with unusual dynamics or motion constraints may require a different feasible connection rather than a straight line. After shortcutting, trajectory optimization or another local optimization method can further smooth the route and produce a locally improved trajectory.


Why probability is needed in robotics

A robot rarely has direct, exact access to the state of itself and its environment. Instead, it receives noisy sensor measurements and acts in a world whose dynamics may be uncertain. Probability provides a framework for combining these imperfect sources of information.

Rather than claiming that the robot is in exactly one known state, a probabilistic estimator represents a distribution over possible states. This distribution expresses both the robot’s best current estimate and its uncertainty about that estimate.

Probability is useful for two related reasons:

  • State estimation: Sensors provide incomplete or noisy evidence about the world. Probability combines that evidence to estimate which states are plausible.

  • Stochastic dynamics: Actions do not always produce exactly the same outcome. Probability describes distributions over possible results, allowing a system to reason about expected outcomes rather than a single guaranteed result.

These ideas later combine in partially observable Markov decision processes (POMDPs). In a POMDP, an agent reasons about an uncertain state while choosing actions. Some actions may be useful not only for their direct effects, but also because they reveal information about the environment and reduce uncertainty.

Examples of uncertain robotic state

Helicopter

A helicopter’s state may include its position, orientation, velocity, and angular rate. Sensors provide only partial, noisy information about these quantities:

  • GPS gives a noisy estimate of position and sometimes velocity. Its accuracy may be limited to a few metres.

  • Gyroscopes measure angular rate around the sensor’s axes.

  • Accelerometers measure specific force, not simply ordinary acceleration. In free fall, an accelerometer ideally reads approximately zero. When stationary on the ground, it measures the support force opposing gravity, with magnitude approximately 9.81 m/s29.81\,\text{m/s}^29.81m/s2. This makes accelerometers useful for estimating orientation relative to gravity, especially when the vehicle is not undergoing strong acceleration.

  • Magnetometers measure the local magnetic field. Because Earth’s field has a known general direction, a measurement can help estimate orientation. Nearby magnets, electrical currents, power lines, or other magnetic disturbances can corrupt it.

Wind, engine behavior, servo motors, and rotor blades also introduce disturbances or unmodeled dynamics. The resulting state estimate is therefore generally a probability distribution, not an exact state.

Mobile robot inside a building

A slowly moving mobile robot may use position and heading as its state, without explicitly tracking velocity.

  • Wheel odometry estimates movement from wheel encoders. It is imperfect because wheels may slip, and uneven surfaces can make the robot move differently from what the wheel rotations suggest.

  • Laser range finders estimate distances from the time taken for emitted light to return. Since the light travels to an object and back, the measured round-trip time is converted into a one-way range. Mirrors, glass, and other reflective or transparent surfaces can cause missing or misleading returns.

  • Wheel slip and surface variations make the robot’s motion uncertain even when wheel rotations are measured accurately.

These examples illustrate why robotic state estimation must combine sensor models, motion models, and probability.


Foundations of probability

Events and probability axioms

Let Ω\OmegaΩ denote the sample space, the set of all possible outcomes. An event is a subset of Ω\OmegaΩ, such as the set of outcomes for which a particular property is true. Probability assigns each event a number between 000 and 111.

The basic properties include:

  • P(Ω)=1P(\Omega)=1P(Ω)=1: some outcome in the complete sample space must occur.

  • P(∅)=0P(\varnothing)=0P(∅)=0: the empty event contains no possible outcome.

  • For any events AAA and BBB:

    P(A∪B)=P(A)+P(B)−P(A∩B).P(A\cup B)=P(A)+P(B)-P(A\cap B).P(A∪B)=P(A)+P(B)−P(A∩B).

The intersection term prevents outcomes belonging to both events from being counted twice. The complement of AAA, written AcA^cAc, contains the outcomes where AAA is false. Since AAA and AcA^cAc together cover the sample space and do not overlap,

P(A)+P(Ac)=1.P(A)+P(A^c)=1.P(A)+P(Ac)=1.

Events can be understood as properties of possible world states: each point in the sample space represents a possible outcome, and an event collects the points for which its defining property holds.

Discrete and continuous random variables

A random variable assigns a value to each possible outcome.

Discrete random variables

A discrete variable takes one of a countable set of values. Its probability mass function gives the probability of each value:

P(X=x).P(X=x).P(X=x).

For example, a fair coin has two outcomes, heads and tails, each with probability 12\frac{1}{2}21​. The probabilities of all possible values of a discrete variable sum to 111.

Continuous random variables

A continuous variable can take values across a continuum. Its probability density function, commonly written p(x)p(x)p(x), describes how probability is distributed over that continuum. Probabilities are found by integrating over intervals:

P(a≤X≤b)=∫abp(x) dx.P(a\leq X\leq b)=\int_a^b p(x)\,dx.P(a≤X≤b)=∫ab​p(x)dx.

The density at a single point is not itself the probability that the variable equals that point. For a continuous distribution, probability is assigned to intervals; an individual point has probability zero under an ordinary continuous density.


Joint, marginal, and conditional distributions

Robotic estimation commonly relates several variables, such as a system’s state and the measurement produced by a sensor. Their joint distribution describes probabilities for combinations of values:

P(X=x,Y=y).P(X=x,Y=y).P(X=x,Y=y).

Independence

Two variables are independent when knowing one provides no information about the other. In that case,

P(X=x,Y=y)=P(X=x)P(Y=y).P(X=x,Y=y)=P(X=x)P(Y=y).P(X=x,Y=y)=P(X=x)P(Y=y).

Equivalently, conditioning on YYY does not change the distribution of XXX:

P(X=x∣Y=y)=P(X=x).P(X=x\mid Y=y)=P(X=x).P(X=x∣Y=y)=P(X=x).

Independence simplifies calculations, but it is often an unrealistic assumption if the variables are intended to convey information about one another.

Conditional probability

The conditional probability of X=xX=xX=x given Y=yY=yY=y is

P(X=x∣Y=y)=P(X=x,Y=y)P(Y=y),P(X=x\mid Y=y)=\frac{P(X=x,Y=y)}{P(Y=y)},P(X=x∣Y=y)=P(Y=y)P(X=x,Y=y)​,

provided P(Y=y)>0P(Y=y)>0P(Y=y)>0. It describes the probability of X=xX=xX=x within the outcomes where Y=yY=yY=y is known to hold.

The joint distribution can be reconstructed from a conditional distribution and a marginal:

P(X=x,Y=y)=P(X=x∣Y=y)P(Y=y).P(X=x,Y=y)=P(X=x\mid Y=y)P(Y=y).P(X=x,Y=y)=P(X=x∣Y=y)P(Y=y).

For continuous variables, the same relationships apply to densities, with sums replaced by integrals where appropriate.

Marginalization and the law of total probability

A marginal distribution describes one variable without retaining the other. It is obtained by summing over all possible values of the variable being removed:

P(X=x)=∑yP(X=x,Y=y).P(X=x)=\sum_y P(X=x,Y=y).P(X=x)=∑y​P(X=x,Y=y).

Using a conditional distribution, the law can also be written as

P(X=x)=∑yP(X=x∣Y=y)P(Y=y).P(X=x)=\sum_y P(X=x\mid Y=y)P(Y=y).P(X=x)=∑y​P(X=x∣Y=y)P(Y=y).

This rule is useful when the distribution of a new variable is constructed from a known distribution over an earlier variable and a model describing how the new variable depends on it.

For continuous YYY, summation is replaced by integration:

p(x)=∫p(x∣y)p(y) dy.p(x)=\int p(x\mid y)p(y)\,dy.p(x)=∫p(x∣y)p(y)dy.

Bayes’ rule

Bayes’ rule reverses a conditional relationship:

P(X=x∣Y=y)=P(Y=y∣X=x)P(X=x)P(Y=y).P(X=x\mid Y=y) = \frac{P(Y=y\mid X=x)P(X=x)}{P(Y=y)}.P(X=x∣Y=y)=P(Y=y)P(Y=y∣X=x)P(X=x)​.

It is especially important when the quantity needed is difficult to model directly, but the reverse conditional is easier to obtain. In state estimation:

  • XXX may represent the system’s state.

  • YYY may represent a sensor measurement.

  • P(Y=y∣X=x)P(Y=y\mid X=x)P(Y=y∣X=x) is the sensor model: the likelihood of a measurement if the state were xxx.

  • P(X=x)P(X=x)P(X=x) is the prior belief about the state.

  • P(X=x∣Y=y)P(X=x\mid Y=y)P(X=x∣Y=y) is the posterior belief after observing the measurement.

The denominator normalizes the result so that the probabilities over all possible values of XXX sum to 111. Because it does not depend on xxx, an implementation can first compute the numerator for every possible state and then normalize the resulting values.

The prior and likelihood are often available from previous estimates and sensor calibration, respectively. Bayes’ rule combines them to produce the desired posterior.

Conditioning on additional information

The same rules apply when other evidence is already known. For example, the conditioned law of total probability is

P(X=x∣Z=z)=∑yP(X=x∣Y=y,Z=z)P(Y=y∣Z=z).P(X=x\mid Z=z) = \sum_y P(X=x\mid Y=y,Z=z)P(Y=y\mid Z=z).P(X=x∣Z=z)=∑y​P(X=x∣Y=y,Z=z)P(Y=y∣Z=z).

Bayes’ rule with additional conditioning is

P(X=x∣Y=y,Z=z)=P(Y=y∣X=x,Z=z)P(X=x∣Z=z)P(Y=y∣Z=z).P(X=x\mid Y=y,Z=z) = \frac{P(Y=y\mid X=x,Z=z)P(X=x\mid Z=z)} {P(Y=y\mid Z=z)}.P(X=x∣Y=y,Z=z)=P(Y=y∣Z=z)P(Y=y∣X=x,Z=z)P(X=x∣Z=z)​.

Every relevant term must retain the conditioning information consistently. Conceptually, conditioning restricts attention to outcomes compatible with the known evidence and renormalizes probabilities over that restricted set.


Conditional independence

Variables XXX and YYY are conditionally independent given ZZZ when, once ZZZ is known, learning one of XXX or YYY provides no further information about the other:

P(X=x,Y=y∣Z=z)=P(X=x∣Z=z)P(Y=y∣Z=z).P(X=x,Y=y\mid Z=z) = P(X=x\mid Z=z)P(Y=y\mid Z=z).P(X=x,Y=y∣Z=z)=P(X=x∣Z=z)P(Y=y∣Z=z).

Equivalent statements include

P(X=x∣Y=y,Z=z)=P(X=x∣Z=z)P(X=x\mid Y=y,Z=z)=P(X=x\mid Z=z)P(X=x∣Y=y,Z=z)=P(X=x∣Z=z)

and

P(Y=y∣X=x,Z=z)=P(Y=y∣Z=z).P(Y=y\mid X=x,Z=z)=P(Y=y\mid Z=z).P(Y=y∣X=x,Z=z)=P(Y=y∣Z=z).

Conditional independence is useful because it expresses limited dependence without requiring complete independence. For example, whether someone carries an umbrella and whether pavement is wet may be related because both are affected by rain. If the weather condition is known, the two outcomes may be treated as independent given that common cause.

In robotics, sensor readings are often assumed conditionally independent given the true state: once the state is known, each sensor’s measurement is modeled as depending on that state rather than on the other measurements. This can greatly simplify computations. The assumption may only be approximate, so it should be checked against the physical sensing process.


Sensor updating and dependence pitfalls

Consider a robot trying to determine whether a door is open. A sensor model may be easier to specify in the causal direction—what reading is likely when the door is open or closed—than in the diagnostic direction—what state is likely given a reading. Bayes’ rule converts the former into the latter.

Suppose a measurement ZZZ occurs with probability 0.60.60.6 when the door is open and probability 0.30.30.3 when it is closed. If the prior probability of an open door is 0.50.50.5, observing ZZZ should increase the estimated probability that the door is open. Bayes’ rule gives

P(open∣Z)=0.6⋅0.50.6⋅0.5+0.3⋅0.5=23.P(\text{open}\mid Z) = \frac{0.6\cdot 0.5} {0.6\cdot 0.5+0.3\cdot 0.5} = \frac{2}{3}.P(open∣Z)=0.6⋅0.5+0.3⋅0.50.6⋅0.5​=32​.

A second sensor observation can be incorporated by applying Bayes’ rule again, using the current posterior as the new prior. If the second observation is more likely when the door is closed, it should reduce the estimated probability that the door is open.

Avoiding overconfidence from correlated readings

Repeated measurements cannot automatically be treated as independent. Two nearby laser beams may encounter the same interference, and repeated readings from a stationary sensor may share the same environmental conditions or internal sensor effects.

If a single piece of evidence is incorrectly treated as many independent observations, its likelihood is multiplied into the calculation repeatedly. The estimator then becomes overconfident: it assigns an artificially high probability to whichever state the evidence favors. For example, repeatedly counting copies of one observation can push a posterior far closer to certainty than the evidence warrants.

Sensor update models should therefore reflect the actual independence of the readings. Sampling a sensor very rapidly does not guarantee that each sample contains new, independent information.


Bayes filters for dynamic systems

A Bayes filter maintains a probability distribution over the state of a system as time passes, actions are taken, and observations arrive. At each time step it uses:

  • A prior or previous state estimate.

  • A dynamics model describing how actions change the state.

  • A sensor model describing how states generate observations.

  • A sequence of actions and observations.

The filter separates estimation into two stages: prediction, which propagates uncertainty through the dynamics, and measurement correction, which incorporates new sensor evidence.

Dynamics and action models

Actions are uncertain. If a robot attempts to close a door, for example, the attempt may succeed or fail. The dynamics model describes this uncertainty:

P(Xt=xt∣Xt−1=xt−1,Ut=ut).P(X_t=x_t\mid X_{t-1}=x_{t-1},U_t=u_t).P(Xt​=xt​∣Xt−1​=xt−1​,Ut​=ut​).

Here Xt−1X_{t-1}Xt−1​ is the previous state, UtU_tUt​ is the action taken before reaching the current state, and XtX_tXt​ is the resulting state.

The predicted distribution over the next state is found by averaging over all possible previous states:

P(Xt=xt∣past actions and observations)=∑xt−1P(xt∣xt−1,ut)P(xt−1∣past observations).P(X_t=x_t\mid \text{past actions and observations}) = \sum_{x_{t-1}} P(x_t\mid x_{t-1},u_t) P(x_{t-1}\mid \text{past observations}).P(Xt​=xt​∣past actions and observations)=∑xt−1​​P(xt​∣xt−1​,ut​)P(xt−1​∣past observations).

This is the law of total probability applied to the state transition. For continuous states, the sum becomes an integral.

Actions commonly increase uncertainty because the outcome is not perfectly predictable. Measurements often reduce uncertainty by ruling out states inconsistent with the observed evidence, though a measurement need not reduce uncertainty in every situation.

State-estimation assumptions

A common Bayes-filter model makes two Markov-style assumptions:

  • The current observation depends on the current state, rather than directly on the entire history.

  • The next state depends on the previous state and the action, rather than directly on all earlier states and actions.

These assumptions are appropriate when the state representation contains enough information to summarize the relevant history. If important information is missing from the state, the assumptions may fail. A practical model may then need to include additional state variables or a longer history.

The filter’s output is only as reliable as its assumptions and models. Errors in the dynamics model, sensor model, or independence assumptions lead to errors in the resulting state distribution.

Recursive Bayes-filter update

Let bel⁡t(xt)\operatorname{bel}_t(x_t)belt​(xt​) denote the belief, or posterior distribution, over the current state after incorporating observations through time ttt. The prediction step uses the previous belief and the action:

bel⁡‾t(xt)=∑xt−1P(xt∣xt−1,ut)bel⁡t−1(xt−1).\overline{\operatorname{bel}}_t(x_t) = \sum_{x_{t-1}} P(x_t\mid x_{t-1},u_t) \operatorname{bel}_{t-1}(x_{t-1}).belt​(xt​)=∑xt−1​​P(xt​∣xt−1​,ut​)belt−1​(xt−1​).

The measurement-correction step incorporates the observation ztz_tzt​:

bel⁡t(xt)=η P(zt∣xt) bel⁡‾t(xt),\operatorname{bel}_t(x_t) = \eta\,P(z_t\mid x_t)\, \overline{\operatorname{bel}}_t(x_t),belt​(xt​)=ηP(zt​∣xt​)belt​(xt​),

where η\etaη is a normalization constant chosen so the belief sums to 111. Combining the two steps gives

bel⁡t(xt)=η P(zt∣xt)∑xt−1P(xt∣xt−1,ut)bel⁡t−1(xt−1).\operatorname{bel}_t(x_t) = \eta\,P(z_t\mid x_t) \sum_{x_{t-1}} P(x_t\mid x_{t-1},u_t) \operatorname{bel}_{t-1}(x_{t-1}).belt​(xt​)=ηP(zt​∣xt​)∑xt−1​​P(xt​∣xt−1​,ut​)belt−1​(xt−1​).

For continuous states, summation is replaced by integration:

bel⁡t(xt)=η p(zt∣xt)∫p(xt∣xt−1,ut)bel⁡t−1(xt−1) dxt−1.\operatorname{bel}_t(x_t) = \eta\,p(z_t\mid x_t) \int p(x_t\mid x_{t-1},u_t) \operatorname{bel}_{t-1}(x_{t-1})\,dx_{t-1}.belt​(xt​)=ηp(zt​∣xt​)∫p(xt​∣xt−1​,ut​)belt−1​(xt−1​)dxt−1​.

The recursion avoids recomputing the entire history. The current belief summarizes the information from earlier observations and actions, so each new action or observation can be incorporated incrementally.

Qualitative localization example

A mobile robot may have a map of a building and a noisy sensor that detects walls in several directions. Initially, its belief may be spread broadly over possible locations. A wall measurement updates the belief, making locations inconsistent with the observation less likely. The robot’s movement then spreads or shifts the belief according to the uncertain motion model. A later measurement concentrates it again.

Repeated prediction and correction can localize the robot over time. This requires a map or other model relating candidate locations to expected observations.


Gaussian distributions

Gaussian distributions are widely used to represent continuous uncertainty. Their tractable mathematical properties make them useful for state estimation, including local approximations for systems with nonlinear dynamics.

Univariate Gaussian

A univariate Gaussian has mean μ\muμ and variance σ2\sigma^2σ2, where σ\sigmaσ is the standard deviation. Its density is

p(x)=12πσexp⁡(−(x−μ)22σ2).p(x) = \frac{1}{\sqrt{2\pi}\sigma} \exp\left( -\frac{(x-\mu)^2}{2\sigma^2} \right).p(x)=2π​σ1​exp(−2σ2(x−μ)2​).

The density is greatest at the mean and decays as xxx moves away from it. The normalization factor ensures that the density integrates to 111.

The mean and variance are

E[X]=μ\mathbb{E}[X]=\muE[X]=μ

and

Var⁡(X)=E[(X−μ)2]=σ2.\operatorname{Var}(X) = \mathbb{E}\left[(X-\mu)^2\right] = \sigma^2.Var(X)=E[(X−μ)2]=σ2.

Approximately 68%68\%68% of a Gaussian’s probability lies within one standard deviation of the mean, between μ−σ\mu-\sigmaμ−σ and μ+σ\mu+\sigmaμ+σ. The density extends indefinitely in both directions, although its tails become small.

Why Gaussians arise: the central limit theorem

The central limit theorem explains why Gaussian distributions often approximate quantities formed by many independent contributions. If X1,…,XnX_1,\ldots,X_nX1​,…,Xn​ are independent random variables with common mean μ\muμ and finite variance σ2\sigma^2σ2, then the standardized sum

Zn=∑i=1nXi−nμnσ2Z_n = \frac{\sum_{i=1}^{n}X_i-n\mu} {\sqrt{n\sigma^2}}Zn​=nσ2​∑i=1n​Xi​−nμ​

approaches a standard normal distribution as nnn becomes large. More generally, under suitable conditions, sums of many independent effects tend toward a Gaussian after centering and scaling.

This gives Gaussians practical relevance beyond mathematical convenience: aggregate noise or the combined effect of many small independent factors is often approximately Gaussian.

Multivariate Gaussian

A multivariate Gaussian describes a vector-valued variable X∈RdX\in\mathbb{R}^dX∈Rd. It has mean vector μ\muμ and covariance matrix Σ\SigmaΣ:

p(x)=1(2π)ddet⁡(Σ)exp⁡(−12(x−μ)TΣ−1(x−μ)).p(x) = \frac{1} {\sqrt{(2\pi)^d\det(\Sigma)}} \exp\left( -\frac{1}{2}(x-\mu)^\mathsf{T} \Sigma^{-1}(x-\mu) \right).p(x)=(2π)ddet(Σ)​1​exp(−21​(x−μ)TΣ−1(x−μ)).

The covariance matrix is symmetric and, for a non-degenerate Gaussian, positive definite. Its diagonal entries are the variances of individual coordinates. Its off-diagonal entries describe how pairs of coordinates vary together:

Σij=E[(Xi−μi)(Xj−μj)].\Sigma_{ij} = \mathbb{E}\left[ (X_i-\mu_i)(X_j-\mu_j) \right].Σij​=E[(Xi​−μi​)(Xj​−μj​)].
  • A positive covariance indicates that the two coordinates tend to be above or below their means together.

  • A negative covariance indicates that one tends to be above its mean when the other is below.

  • Zero covariance indicates no linear covariance between them; in a joint Gaussian, zero covariance also implies independence.

The Gaussian’s mean gives its center, while its covariance determines its spread and orientation. In two dimensions, equal variances and zero covariance produce a symmetric, circular contour. Unequal variances stretch the distribution more along one coordinate. Correlation tilts the contours: positive correlation elongates them along the direction where both variables increase together, while negative correlation elongates them along the opposing direction.

A symmetric covariance matrix can be diagonalized by a rotation into suitable coordinates. In those coordinates, its diagonal entries describe the variance along independent principal directions. This provides an intuitive way to understand a correlated Gaussian: it can be viewed as a set of uncorrelated Gaussian dimensions expressed in rotated coordinates.

The mean and covariance summarize the expected value and second-order relationships of the state variables, making multivariate Gaussians useful for representing continuous uncertainty in robotics.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent