59
Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Embed Size (px)

Citation preview

Page 1: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Introduction toComputer Vision and Robotics:

Motion Generation

Tomas Kulvicius

Poramate Manoonpong

Page 2: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Motion Control:Trajectory Generation

Page 3: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Different robots –> different motions -> different trajectories

Page 4: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

How do we generate/plan trajectories?

Depends on-what kind of trajectories we need-apllication

Page 5: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Movement overview

Movements

Splines

DMPs GMMs

Point-to-Point Periodic

NOs RNNs

DMPs

Page 6: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Overview

Movements

Splines

DMPs GMMs

Point-to-Point Periodic

NOs RNNs

DMPs

Page 7: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Polynomial interpolation

-3 -2 -1 0 1 2 3 4 5 60

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Example trajectory sampled by blue points

Page 8: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Polynomial interpolation

-3 -2 -1 0 1 2 3 4 5 60

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

-3 -2 -1 0 1 2 3 4 5 60

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

4th order polynomialSampled trajectory

Insufficient fit!

Page 9: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Polynomial interpolation

-3 -2 -1 0 1 2 3 4 5 60

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

-3 -2 -1 0 1 2 3 4 5 6

-0.2

0

0.2

0.4

0.6

0.8

1

6th order polynomial

Insufficient fit!

Sampled trajectory

Page 10: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Polynomial interpolation

-3 -2 -1 0 1 2 3 4 5 60

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

-3 -2 -1 0 1 2 3 4 5 6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

9th order polynomial

-3 -2 -1 0 1 2 3 4 5 6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

Runge’s phenomenon

Sampled trajectory

Page 11: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Runge’s phenomenon

Runge function

5-th order polyn.

9-th order polyn.

Page 12: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Spline interpolation

-3 -2 -1 0 1 2 3 4 5 60

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Cubic splineSampled trajectory

-3 -2 -1 0 1 2 3 4 5 60

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Idea: many low order polynomials joined together

No oscillations as compared to polynomial interpolation

One can add desired velocity (cubic) or acceleration (5th order) at the end points

Page 13: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Overview

Movements

Splines

DMPs GMMs

Point-to-Point Periodic

NOs RNNs

DMPs

Page 14: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Dynamic Movement Primitives (DMPs)?

“DMPs are units of actions that are formalized as stable nonlinear attractor systems” (Ijspeert et al., 2002, Schaal et al., 2003, 2007)

Page 15: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Formalism of discrete DMPs

A set of differential Eqs, which defines a vector field that takes you from any start-point to the goal

Kernels:

Nonlinear function:

Ijspeert et al., 2002; Schaal et al., 2003, 2007

Position change (velocity):

Velocity change (acceleration):

Exponential decay:

(v)

g – goal

– temp. scal.

Page 16: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Kernels:

Nonlinear function:

Formalism of discrete DMPs

Ijspeert et al., 2002; Schaal et al., 2003, 2007

Position change (velocity):

Velocity change (acceleration):

Time

Exponential decay:

(v)

g – goal

– temp. scal.

Page 17: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

DMP properties: 1. GeneralizationDMPs can be scaled-in time and -spacewithout losing the qualitative trajectory appearance

Page 18: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

DMP properties: Position scaling

Page 19: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

DMP properties: GeneralizationDMPs can be scaled in time and space without losing the qualitative trajectory appearance

Page 20: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

DMP properties: 2. Robustness to perturbations

Real-time trajectory generator – can react to perturbations during movement

Page 21: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

DMP properties: 3. Coupling

DMPs allow to add coupling terms easily:-Temporal coupling-Spatial coupling

Page 22: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

DMP properties: Temporal coupling

Velocity change (acceleration):

Exponential decay (phase variable):

(v)

Adding additional term Ct allows us to modify the phase of themovement, i.e., stop the movement in case of perturbations.

+Ct

Page 23: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

DMP properties: Phase stopping

DMPs are not directly time dependent (phase based) which allows to control phase of the movement (e.g., phase stopping)

Without phase stopping With phase stopping

Page 24: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Temporal coupling: Movement stopping

Page 25: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Proactive behavior in humans

Page 26: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

What about robots?

Page 27: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

DMP properties: Spatial coupling

Adding additional term Cs allows us to modify trajectoryonline by taking sensory information into account, i.e. online obstacle avoidance.

Velocity change (acceleration):

+Cs

Page 28: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Spatial coupling: Obstacle avoidance

Page 29: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Spatial coupling: Human-Robot interaction

Page 30: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Spatial coupling: Robot-Robot interaction

Page 31: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Comparison of discrete movement generators

Method

PropertySplines DMPs GMMs

Time dependence

Direct IndirectInde-

pendent

Robustness to

perturbationsNo Yes Yes

Generalization No Yes Yes

Set of trajectories No No Yes

Page 32: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Overview

Movements

Splines

DMPs GMMs

Point-to-Point Periodic

NOs RNNs

DMPs

Page 33: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Kernels:

Nonlinear function:

Formalism of discrete DMPs: Reminder

Ijspeert et al., 2002; Schaal et al., 2003, 2007

Position change (velocity):

Velocity change (acceleration):

Time

Exponential decay:

(v)

g – goal

– temp. scal.

Page 34: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

150 200 250 300-1

-0.5

0

0.5

1

150 200 250 3000

1

2

3

150 200 250 300-40

-20

0

20

40

Nonlinear function:

Formalism of rhythmic DMPs

Ijspeert et al., 2002; Schaal et al., 2003, 2007

Position change (velocity):

Velocity change (acceleration):

Limit cycle oscillator withconstant phase speed:

(,A)

Kernels:

Time

g – baseline A – amplitude

– frequency

Page 35: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Overview

Movements

Splines

DMPs GMMs

Point-to-Point Periodic

NOs RNNs

DMPs

Page 36: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Central Pattern Generator (CPG)

Pattern generation without sensory feedback (Open-loop system)

Neural oscillators

Page 37: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

CPG methods

• Dynamical system approach:Dynamical system approach:•Van der Pol Oscillator•Dynamic Movement Primitives

• Neural control approach:Neural control approach:•Matsuoka Oscillator•2-neuron Oscillator

Page 38: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

The transfer function

The activation function

Neural structure: 2-neuron network [Pasemann et al., 2003]

Central pattern generator (CPG): Self excitatory + excitatory & inhibitory synapses

2-neuron oscillator

Page 39: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Pasemann, F., Hild, M., Zahedi, K. SO(2)-Networks as Neural Oscillators, Mira, J., and Alvarez, J. R., (Eds.), Computational Methods in Neural Modeling, Proceedings IWANN 2003, LNCS 2686, Springer, Berlin, pp. 144-151, 2003.

W11

, W22

W12 = - W21

2-neuron oscillator

Page 40: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Modulatory input

CPG with modulatory input

Page 41: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Different walking gates (AMOS II)

Page 42: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Overview

Movements

Splines

DMPs GMMs

Point-to-Point Periodic

NOs RNNs

DMPs

Page 43: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Reflexive neural networks

Reflexes - local motor response to a local sensation

Locomotion as a chain of reflexes: purely sensory-driven system (Closed-loop system).

Page 44: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Reflexive neural network: application to bipedal robot RunBot

Page 45: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

GL

1) Left leg touches the ground: GL = active Left hip flexes (backward) & Left knee extends (straight) = STANCE

Right hip extends (forward) & Right knee flexes (bend) = SWING

2,3) Right Hip angle reaches AEA (Anterior Extreme Angle)AEA = active Right knee extends (straight)Right leg still in swing, Left leg still in stance

4,5) Right leg touches the ground:GR = active Right hip flexes (backward) & Right knee extends (straight) = STANCE

Left hip extends (forward) & Left knee flexes (bend) = SWING

Sensor-triggered generation of movement

Page 46: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Reflexive neural network of RunBot

Page 47: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Passive dynamic walking

Page 48: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Neural learning

Learning to walk up a ramp

Page 49: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

RunBot learning to walk up a ramp

Page 50: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Pros:

• Very close link between the controller and what the robot actual does

Cons:

• because of the lack of a centrally generated rhythm, locomotion might be completely stopped because of damage in the sensors and/or external constraints that force the robot in a particular posture.

Reflex based methods

Page 51: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Comparison of periodic movement generators

Method

PropertyDMPs

Neural

OscillatorsRNNs

Time dependence Indirect Direct Direct

Robustness to

perturbationsYes Yes Yes

Generalization Yes Yes&No N/A

Arbitrary trajectory Yes Yes&No N/A

Page 52: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Joining movement sequences: human vs. robot

We want to achieve human like motions – smooth transitions between consequent movements.

Page 53: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

0 50 100-0.1

-0.05

0

0.05

0.1

0.15

0 50 1000

0.2

0.4

0.6

0.8

1

Kernels:

Nonlinear function:

Formalism of original DMPs: Reminder

Ijspeert et al., 2002; Schaal et al., 2003, 2007

Position change (velocity):

Velocity change (acceleration):

Delayed goal:

( )

Time

Exponential decay:

Page 54: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Modification of original DMP’sGoal function:

Sigmoidal decay:

Nonlinear function:

Page 55: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Joining DMPs by using overlapping kernels

Goal: to join accurately in position and velocity space at the joiningpoint at the specific time T(provided by human example)

Page 56: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Comparison: orig. DMPs vs. novel approach

Sequentialjoining

tSequentialjoining

Novelapproach

Joining letters“a” and “b”

Page 57: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Joining demo: Handwriting

Page 58: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Joining demo: joining of discrete and repetitive movements

Page 59: Introduction to Computer Vision and Robotics: Motion Generation Tomas Kulvicius Poramate Manoonpong

Summary

Types of motions:- discrete (poin-to-point);- oscillatory (repetitive).

Movement generation frameworks:- splines;- dynamic movement primitives (DMPs);- neural oscillators (NOs);- reflexive neural networks (RNNs).

There is no best trajectory generator – it much depends on the application!