Skip to content

4. Kinodynamic Path Finding

Introduction

Kinodynamic : Kinematic + Dynamic:

The kinodynamic planning problem is to synthesize a robot motion subject to simultaneous kinematic constraints, such as avoiding obstacles, and dynamics constraints, such as modulus bounds on velocity, acceleration, and force. A kinodynamic solution is a mapping from time to generalized forces or accelerations. (From Kinodynamic Motion Planning)

  • Differentially constrained
  • Up to force (acceleration)

Reason: Straight-line connections between pairs of states are typically not valid trajectories due to the system’s differential constraints.

  • Coarse-to-fine process
  • Trajectory only optimizes locally
  • Infeasible path means nothing to nonholonomic system

Examples:

  • Unicycle model:
(x˙y˙θ˙)=(cosθsinθ0)v+(001)ω

Constraints:

|v|vmax|ω|ωmax
  • Differential drive model:
(x˙y˙θ˙)=(r2(ul+ur)cosθr2(ul+ur)sinθrL(urul))

Constraints:

|ul|ul,max|ur|ur,maxv=r2(ul+ur)ω=rL(urul)
Differential drive model
Figure 1: Differential drive model.
  • Simplified car model:
(x˙y˙θ˙)=(vcosθvsinθrLtanϕ)

Constraints:

|v|vmax,|ϕ|ϕmax<π2Simple car model|v|{vmax,vmax},|ϕ|ϕmax<π2Reeds & Shepp’s car|v|=vmax,|ϕ|ϕmax<π2Dubin’s car
Simplified car model
Figure 2: Simplified car model.

State Lattice Planning

Basic idea

TODO: chap 2

  • Recall the search-based path finding method in Chapter 2
  • For planning, how to build a graph?
  • Is this graph doable for our real robot?

Assume the robot, a mass point, is not satisfactory any more. We now require a graph with feasible motion connections. We manually create (build) a graph with all edges executable by the robot.

  • Forward direction: discrete (sample) in control space
  • Reverse direction: discrete (sample) in state space

This is the basic motivation for all kinodyanmic planning. State lattice planning is the most straight-forward one.

TODO: chap 2, 3

  • In chapter 2, we discretize the control space (4 connections for 4-neighbor, 8 connections for 8-neighbor). We assume the robot can move in 4 / 8 directions.
  • In chapter 3, we discretize the state space (position) and assume the robot can move in any direction.

For a robot model: s˙=f(s,u) The robot is differentially driven. We have an initial state s0 of the robot. Generate feasible local motions by:

  • Sample in control space: select a u, fix a time duration T, forward simulate the system (numerical integration).
    • Forward simulation
    • Fixed u,T
    • No mission guidance,
    • East to implement
    • Low planning efficiency
  • Sample in state space: select a sf, find the connection (a trajectory) between s0 and sf
    • Backward calculation
    • Need calculate u,T
    • Good mission guidance
    • Hard to implement
    • High planning efficiency

Sampling in control space

  • State:
s=(xyzx˙y˙z˙)
  • Input:
u=(x¨y¨z¨)
  • System equation:
s˙=As+Bu,s(0)=s0.

where

A=[0I300],B=[0I3].

Specially, A,B can be expanded to more general cases, such as:

A=[0I30000I3000I3000],B=[000I3].
  • Several-order integrator
  • A nilpotent

The solution is:

s(t)=eAts0+[0teA(tτ)B dτ]um.F(t)s0+G(t)um

where F(t)=eAt is the state transition matrix, critical to the integration.

If matrix ARn×n is nilpotent, i.e., An=0, then eAt has a closed-form expression in the form of an (n1) degree matrix polynomial in t.

Note:

  • During searching, the graph can be built when necessary.
  • Create nodes (state) and edges (motion primitive) when nodes are newly discovered.
  • Save computational time/space.

For every sS from the search tree:

  • Pick a control vector u
  • Integrate the equation over short duration
  • Add collision-free motions to the search tree

For simplified car model with state s=(x,y,θ) and control u=(v,ϕ):

  • Select a sS
  • Pick v,ϕ,τ
  • Integrate motion from s
  • Add result if collision-free

Sampling in state space

Build a lattice graph:

  • Given an origin.
  • for 8 neighbor nodes around the origin, feasible paths are found.
  • extend outward to 24(=25-1) neighbors.
  • complete lattice.

Comparison

Comparison of sampling methods
Figure 3: Comparison of sampling methods.

Boundary Value Problem (BVP)

  • BVP is the basis of state sampled lattice planning.
  • No general solution. Case by case design.
  • Often evolve complicated numerical optimization.

BVP: design a trajectory x(t) such that:

x(0)=a,x(T)=b

With 5th order polynomial trajectory:

x(t)=c5t5+c4t4+c3t3+c2t2+c1t+c0.

Boundary conditions:

PositionVelocityAcceleration
t=0a00
t=Tb00

Solve:

[ab0000]=[000001T5T4T3T2T10000105T44T33T22T1000020020T312T26T200][c5c4c3c2c1c0].

Optimal BVP (OBVP)[1]

Fix final state

Modelling:

  • Objective: minimize the integral of squared jerk:
JΣ=k=13Jk,Jk=1T0Tjk2(t) dt.
  • State: sk=(pk,vk,ak). Input: uk=jk
  • System model: s˙k=fs(sk,uk)=(vk,ak,jk) / s˙=fs(s,u)=(v,a,j)

Solving:

  • By Pontryagin's Minimum Principle, we first introduce the costate: λ=(λ1,λ2,λ3)
  • Define the Hamiltonian function:
H(s,u,λ)=1Tj2+λfs(s,u)=1Tj2+λ1v+λ2a+λ3j

Generally:

J=h(s(T))+0Tg(s(t),u(t)) dt

where s(T) is the final state and g(s(t),u(t)) is the transition cost.

Write the Hamiltonian and costate:

H(s,u,λ)=g(s,u)+λfs(s,u)λ=(λ1,λ2,,λn)

Suppose the optimal input is u and the optimal state is s, then the necessary conditions for optimality are:

λ˙=Hs(s,u,λ)

with the boundary condition of:

λ(T)=h(s(T))

and the optimal input u satisfies:

u=argminuH(s,u,λ)
λ˙=sH(s,u,λ)=(0λ1λ2)

The costate is solved as:

λ=1T[2α2αt+2βαt22βt2γ]

(For later convenience)

λ˙=[0λ1λ2]=[000100010]λCλλ=eCtλ(0),λ(0)2/T[αβγ]C2=[000000100],C3=0,λ=[100t10t2/2t1]λ(0)

The optimal input is solved as:

u(t)=j(t)=argminj(t)H(s(t),j(t),λ(t))=12αt2+βt+γ.

The optimal state trajectory is solved as:

s(t)=[p(t)v(t)a(t)]=[1120αt5+124βt4+16γt3+12a0t2+v0t+p0124αt4+16βt3+12γt2+a0t+v016αt3+12βt2+γt+a0]

with initial state: s(0)=(p0,v0,a0). This is obtained by jerk-acceleration-velocity-position integration.

The remaining unknowns α,β,γ are solved for as a function of the desired end state variable components sk. Let s(T)=(pf,vf,af), then the unknowns α,β,γ are isolated by reordering the above equation as:

[pfvfaf]=[1120T5124T416T3124T416T312T216T312T2T][αβγ]+[12a0T2+v0T+p0a0T+v0a0].

Solving for the unknown coefficients yields

[αβγ]=[1120T5124T416T3124T416T312T216T312T2T]1[ΔpΔvΔa]=1T5[720360T60T2360T168T224T360T224T33T4][ΔpΔvΔa]

where

[ΔpΔvΔa]=[pfvfaf][12a0T2+v0T+p0a0T+v0a0].

And the cost is:

JΣ=1T0Tj2(t) dt=1T0T(12αt2+βt+γ)2 dt.=1T0T(14α2t4+αβt3+(12αγ+β2)t2+2βγt+γ2) dt=120α2T4+14αβT3+(16αγ+13β2)T2+βγT+γ2
  • Similar solution can also be found when s(T) is partially defined
  • Same solving process holds for Jk=0Tj2(t) dt+T

The boundary condition: λ(t)=h(s(t)).

  • For fixed final state problem:
h(s(T))={0,s=s(T)+,otherwise

Not differentiable. So we discard this condition, and use given s(T) to directly solve for unknown variables

  • For (partially)-free final state problem:
Given si(T),iI

We have boundary condition for other costate:

λj(T)=sjh(s(T)),ji.

Free v & a (Homework)

The Hamiltonian function is shown in the last section:

H(s,u,λ)=1Tj2+λ1v+λ2a+λ3j

By utilizing Pontryagin's Minimum Principle, we have (Also shown in the last section):

λ˙=sH(s,u,λ)λ(t)=1T[2α2αt2βαt2+2βt+2γ]

With boundary condition for λ(T) with free v(T),a(T), thus h doesn't relate to v(T),a(T), we have:

λ2(T)=λ3(T)=0

Thus, we have:

{β=αTγ=12αT2

and

λ(t)=1T[2α2αt2βαt2+2βt+2γ]=1T[2α2α(tT)α(t22Tt+T2)].

The optimal input is solved as:

u(t)=j(t)=argminj(t)H(s(t),j(t),λ(t))=λ3T2=12αt2αTt+12αT2.

By integrating the optimal input, we have the optimal state trajectory as:

s(t)=[p(t)v(t)a(t)]=[1120αt5124αTt4+112αT2t3+12a0t2+v0t+p0124αt416αTt3+14αT2t2+a0t+v016αt312αTt2+12αT2t+a0].

With known p(T)=pf, we can solve for α as:

pf=1120αT5124αT5+112αT5+12a0T2+v0T+p0α=20T5(pfp0v0T12a0T2).

Thus:

JΣ=1T0Tj2(t) dt=20T6(pfp0v0T12a0T2)2.

It shows that J is a function of T. By optimizing T, we can further reduce the cost. With differentiating J with respect to T, and setting dJdT=0, we have:

(pfp0v0T12a0T2)(a0T2+4v0T6pf+6p0)=0

Thus, the optimal T is:

T=v0+v02+2a0(pfp0)a0 or T=2v0+4v02+6a0(pfp0)a0.

And TR0 and pick the one with smaller cost.

TBC


  1. Mueller M W, Hehn M, D'Andrea R. A computationally efficient motion primitive for quadrocopter trajectory generation[J]. IEEE transactions on robotics, 2015, 31(6): 1294-1310. ↩︎

Released under the MIT License.