Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay...

43
1 Property of University of Pennsylvania, Vijay Kumar Video 11.1 Vijay Kumar

Transcript of Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay...

Page 1: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

1Property of University of Pennsylvania, Vijay Kumar

Video 11.1

Vijay Kumar

Page 2: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

2Property of University of Pennsylvania, Vijay Kumar

Applications

Trajectory generation in robotics

Planning trajectories for quad rotors

START

GOAL

INT. POSITIONINT. POSITION

Smooth three dimensional trajectories

Page 3: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

3Property of University of Pennsylvania, Vijay Kumar

1

1

2

3

2

3

Motion Planning of Quadrotors

Page 4: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

4Property of University of Pennsylvania, Vijay Kumar

Start, goal positions (orientations)

Waypoint positions (orientations)

Smoothness criterionGenerally translates to minimizing rate of change of “input”

Order of the system (n)The input is algebraically related to the nth derivative of

position (orientation)

Boundary conditions on (n-1)th order and lower derivatives

General Set up

Page 5: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

5Property of University of Pennsylvania, Vijay Kumar

Examples

Shortest distance path (geometry)

Fermat’s principle (optics)

Principle of least action (mechanics)

cost functional

function

Calculus of Variations

running cost

Page 6: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

6Property of University of Pennsylvania, Vijay Kumar

Consider the set of all differentiable curves, x(t), with a

given x(0) and x(T).

Calculus of Variations

Page 7: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

7Property of University of Pennsylvania, Vijay Kumar

Euler Lagrange EquationNecessary condition satisfied by the “optimal” function x(t)

Calculus of Variations

Courant, R and Hilbert, D. Methods of Mathematical Physics. Vol. I. Interscience Publishers,

New York, 1953.

Cornelius Lanczos, The Variational Principles of Mechanics, Dover Publications, 1970

Page 8: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

8Property of University of Pennsylvania, Vijay Kumar

input

0 T

Smooth trajectories (n=1)

Page 9: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

9Property of University of Pennsylvania, Vijay Kumar

Euler Lagrange Equation

Smooth trajectories (n=1)

Page 10: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

10Property of University of Pennsylvania, Vijay Kumar0 T

Smooth trajectories (n=1)

Page 11: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

11Property of University of Pennsylvania, Vijay Kumar

input

Smooth trajectories (general n)

Page 12: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

12Property of University of Pennsylvania, Vijay Kumar

Euler Lagrange EquationNecessary condition satisfied by the “optimal” function

Euler-Lagrange Equation

Page 13: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

13Property of University of Pennsylvania, Vijay Kumar

n=1, shortest distance

n=2, minimum acceleration

n=3, minimum jerk

n=4, minimum snapn – order of system

nth derivative is an

algebraic function of

input

velocity

Smooth Trajectories

Page 14: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

14Property of University of Pennsylvania, Vijay Kumar

n=1, shortest distance

n=2, minimum acceleration

n=3, minimum jerk

n=4, minimum snapWhy is the minimum

velocity curve also the

shortest distance

curve?

velocity

Smooth Trajectories

Page 15: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

15Property of University of Pennsylvania, Vijay Kumar

Video 11.2

Vijay Kumar

Page 16: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

16Property of University of Pennsylvania, Vijay Kumar

n=1, shortest distance

n=2, minimum acceleration

n=3, minimum jerk

n=4, minimum snap

Smooth Trajectories

Page 17: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

17Property of University of Pennsylvania, Vijay Kumar

Euler-Lagrange:

Design a trajectory x(t) such that x(0) = a, x(T) = b

0

Minimum Jerk Trajectory

Page 18: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

18Property of University of Pennsylvania, Vijay Kumar

Boundary conditions:

Position Velocity Acceleration

t = 0 a 0 0

t = T b 0 0

Solve:

Solving for Coefficients

Page 19: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

19Property of University of Pennsylvania, Vijay Kumara=0, b=1, T=50

Minimum Jerk Trajectory

Page 20: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

20Property of University of Pennsylvania, Vijay Kumar

Euler Lagrange EquationNecessary condition satisfied by the “optimal” function

Extensions to multiple dimensions (first order system, n=1)

Page 21: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

21Property of University of Pennsylvania, Vijay Kumar

Minimum-jerk trajectory in (x, y, q)

start

position,

orientation

goal

position,

orientation

Minimum Jerk for Planar Motions

G.J. Garvin, M. Žefran, E.A. Henis, V. Kumar, Two-arm trajectory

planning in a manipulation task, Biological Cybernetics, January 1997,

Volume 76, Issue 1, pp 53-62

Human manipulation tasks

Rate of change of muscle fiber lengths

is critical in relaxed, voluntary motions

T. Flash and N. Hogan, The coordination of arm movements: an

experimentally confirmed mathematical model, Journal of neuroscience,

1985

Page 22: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

22Property of University of Pennsylvania, Vijay Kumar

Design a trajectory x(t) such that x(0) = a, x(T) = b

Optimal Trajectories with Constraints

Page 23: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

23Property of University of Pennsylvania, Vijay Kumar0 T

Trapezoidal Velocity Profile

Minimum Time Trajectories

Page 24: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

24Property of University of Pennsylvania, Vijay Kumar

Video 11.3

Vijay Kumar

Page 25: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

25Property of University of Pennsylvania, Vijay Kumar

Design a trajectory x(t) such that x(0) = a, x(T) = b

t

x

Smooth 1D Trajectories

Page 26: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

26Property of University of Pennsylvania, Vijay Kumar

Design a trajectory x(t) such that:

t

x

Multi-Segment 1D Trajectories

Page 27: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

27Property of University of Pennsylvania, Vijay Kumar

Design a trajectory x(t) such that:

Define piecewise continuous trajectory:

Multi-Segment 1D Trajectories

Page 28: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

28Property of University of Pennsylvania, Vijay Kumar

Design a trajectory x(t) such that:

t

x

What if the system is

a 2nd order system?

Continuous but not Differentiable

Page 29: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

29Property of University of Pennsylvania, Vijay Kumar

Design a trajectory x(t) such that:

t

x

Minimum Acceleration Curve for 2nd Order Systems

Page 30: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

30Property of University of Pennsylvania, Vijay Kumar

Design a trajectory x(t) such that:

4m degrees of freedom

Minimum Acceleration Curve for 2nd Order Systems

Cubic spline

Page 31: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

31Property of University of Pennsylvania, Vijay Kumar

Design a trajectory x(t) such that:

t

x

Cubic Spline

Page 32: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

32Property of University of Pennsylvania, Vijay Kumar

Design a trajectory x(t) such that:

t

x

2m

Cubic Spline

Page 33: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

33Property of University of Pennsylvania, Vijay Kumar

Design a trajectory x(t) such that:

x

2m+2(m-1)

Cubic Spline

Page 34: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

34Property of University of Pennsylvania, Vijay Kumar

Design a trajectory x(t) such that:

t

x

2m+2(m-1)+2 = 4m constraints

Cubic Spline

Page 35: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

35Property of University of Pennsylvania, Vijay Kumar

Design a trajectory x(t) such that:

t

x

Spline for nth order system

Page 36: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

36Property of University of Pennsylvania, Vijay Kumar

Design a trajectory x(t) such that:

t

x

Spline for nth order system

Page 37: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

37Property of University of Pennsylvania, Vijay Kumar

Polynomial interpolants

Boundary conditions at intermediate points

SplinesSmooth polynomial functions defined piecewise (degree n)

Smooth connections at in between “knots” (match values of

functions and n-1 derivatives)

Summary

Page 38: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

38Property of University of Pennsylvania, Vijay Kumar

Video 11.4

Vijay Kumar

Page 39: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

39Property of University of Pennsylvania, Vijay Kumar

When working with quadrotors, we want to find a

trajectory that minimizes the cost function:

From the Euler-Lagrange equations, a necessary

condition for the optimal trajectory is:

The minimum-snap trajectory is a 7th order polynomial.

Minimum Snap Trajectory

Page 40: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

40Property of University of Pennsylvania, Vijay Kumar

Design a trajectory x(t) such that:

The trajectory will be a 7th-order piecewise polynomial with 2 segments:

This trajectory has 16 unknowns.

Trajectory with 3 waypoints

Page 41: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

41Property of University of Pennsylvania, Vijay Kumar

t

x

Design a trajectory x(t) such that:

Trajectory with 3 waypoints

Page 42: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

42Property of University of Pennsylvania, Vijay Kumar

Position constraints in matrix form:

Trajectory with 3 waypoints

Page 43: Video 11.1 Vijay Kumar - prod-edxapp.edx-cdn.org · Property of University of Pennsylvania, Vijay Kumar 39 When working with quadrotors, we want to find a trajectory that minimizes

43Property of University of Pennsylvania, Vijay Kumar

Endpoint derivative constraints at t0 in matrix form:

Trajectory with 3 waypoints