kinematics - seoul national...

30
Kinematics Jehee Lee Seoul National University

Upload: others

Post on 19-Aug-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Kinematics

Jehee LeeSeoul National University

Page 2: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Kinematics

• How to animate skeletons (articulated figures)

• Kinematics is the study of motion without regard to the forces that caused it

Page 3: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Hierarchical Models

• Tree structure of joints and links– The root link can be chosen arbitrarily

• Joints– Revolute (hinge) joint allows rotation about a fixed axis– Prismatic joint allows translation along a line– Ball-and-socket joint allows rotation about an arbitrary axis

Page 4: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Human Joints• Human joints are actually much more complicated

Page 5: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Forward and Inverse Kinematics

1q

2q

)F(),( iq=qp ),(F 1 qp-=iqForward Kinematics Inverse Kinematics

1q

2q

Page 6: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Forward Kinematics: A Simple Example

• A simple robot arm in 2-dimensional space– 2 revolute joints– Joint angles are known– Compute the position of the end-effector

)sin(sin)cos(cos

21211

21211

qqqqqq

++=++=

llyllx

e

e2q

1q1l

2l

),( ee yx

Page 7: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

3D Position and Orientation

• The position and orientation of an object is represented as a rigid transformation

• Vector & 3x3 Matrix

• 4x4 Matrix

• Vector & Quaternion

pqvq +-1

pRv +

÷÷ø

öççè

æ÷÷ø

öççè

æ=

11v

0pR

Tv

X ¢Y ¢

X

Y

Page 8: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Forward Kinematics: A Simple Example

• Forward kinematics map as a coordinate transformation– The body local coordinate system of the end-effector was initially

coincide with the global coordinate system– Forward kinematics map transforms the position and orientation

of the end-effector according to joint angles

2q

1q1l

X ¢Y ¢

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ=

÷÷÷

ø

ö

ççç

è

æ

100

1Ty

x

e

e2l

X

Y

Page 9: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

A Chain of Transformations

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ=

÷÷÷

ø

ö

ççç

è

æ

100

1Ty

x

e

e

( ) ( ) ( ) ( )

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -=

=

100010

01

1000cossin0sincos

100010

01

1000cossin0sincos 2

22

221

11

11

2211

lltranslrottranslrotT

qqqq

qqqq

qq

2q

1q1l

X ¢Y ¢

2l

X

Y

Page 10: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Thinking of Transformations

• In a view of body-attached coordinate system

( ) ( ) ( ) ( )

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -=

=

100010

01

1000cossin0sincos

100010

01

1000cossin0sincos 2

22

221

11

11

2211

lltranslrottranslrotT

qqqq

qqqq

qq

X

Y

X ¢Y ¢

Page 11: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

X

Y

Thinking of Transformations

• In a view of body-attached coordinate system

1qX ¢

Y ¢

( ) ( ) ( ) ( )

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -=

=

100010

01

1000cossin0sincos

100010

01

1000cossin0sincos 2

22

221

11

11

2211

lltranslrottranslrotT

qqqq

qqqq

qq

Page 12: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Thinking of Transformations

• In a view of body-attached coordinate system

1q1L

X ¢Y ¢

X

Y

( ) ( ) ( ) ( )

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -=

=

100010

01

1000cossin0sincos

100010

01

1000cossin0sincos 2

22

221

11

11

2211

lltranslrottranslrotT

qqqq

qqqq

qq

Page 13: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

2q

1q1L

X ¢Y ¢

Thinking of Transformations

• In a view of body-attached coordinate system

X

Y

( ) ( ) ( ) ( )

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -=

=

100010

01

1000cossin0sincos

100010

01

1000cossin0sincos 2

22

221

11

11

2211

lltranslrottranslrotT

qqqq

qqqq

qq

Page 14: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

2q

1q1L

X ¢Y ¢

2L

Thinking of Transformations• In a view of body-attached coordinate system

X

Y

( ) ( ) ( ) ( )

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -=

=

100010

01

1000cossin0sincos

100010

01

1000cossin0sincos 2

22

221

11

11

2211

lltranslrottranslrotT

qqqq

qqqq

qq

Page 15: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Thinking of Transformations

• In a view of global coordinate system

X

Y

X ¢Y ¢

( ) ( ) ( ) ( )

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -=

=

100010

01

1000cossin0sincos

100010

01

1000cossin0sincos 2

22

221

11

11

2211

lltranslrottranslrotT

qqqq

qqqq

qq

Page 16: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Thinking of Transformations

• In a view of global coordinate system

X ¢

Y ¢

2L

X

Y

( ) ( ) ( ) ( )

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -=

=

100010

01

1000cossin0sincos

100010

01

1000cossin0sincos 2

22

221

11

11

2211

lltranslrottranslrotT

qqqq

qqqq

qq

Page 17: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

2q

X ¢Y ¢

2L

Thinking of Transformations

• In a view of global coordinate system

X

Y

( ) ( ) ( ) ( )

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -=

=

100010

01

1000cossin0sincos

100010

01

1000cossin0sincos 2

22

221

11

11

2211

lltranslrottranslrotT

qqqq

qqqq

qq

Page 18: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Thinking of Transformations

• In a view of global coordinate system

2q1L

X ¢Y ¢

2L

X

Y

( ) ( ) ( ) ( )

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -=

=

100010

01

1000cossin0sincos

100010

01

1000cossin0sincos 2

22

221

11

11

2211

lltranslrottranslrotT

qqqq

qqqq

qq

Page 19: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Thinking of Transformations• In a view of global coordinate system

2q

1q1L

X ¢Y ¢

2L

X

Y

( ) ( ) ( ) ( )

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -

÷÷÷

ø

ö

ççç

è

æ

÷÷÷

ø

ö

ççç

è

æ -=

=

100010

01

1000cossin0sincos

100010

01

1000cossin0sincos 2

22

221

11

11

2211

lltranslrottranslrotT

qqqq

qqqq

qq

Page 20: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

How to Handle Ball-and-Socket Joints ?

• Three revolute joints whose axes intersect at a point (equivalent to Euler angles), or

• 3D rotation about an arbitrary axis

( ) ( ) ( )( ) ( )

!!

÷÷÷÷÷

ø

ö

ççççç

è

æ -

÷÷÷÷÷

ø

ö

ççççç

è

æ

-÷÷÷÷÷

ø

ö

ççççç

è

æ-

=

=

1000010000cossin00sincos

10000cos0sin00100sin0cos

10000cossin00sincos00001

21

zz

zz

yy

yy

xx

xx

zyx translrotrotrottranslT

qqqq

qq

qq

qqqq

qqq

Page 21: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Floating Base

• The position and orientation of the root segment are added

1q

2q

3q( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )221100 qqqq rottranslrottranslrottransltranslrotT rr=

X

Y

Page 22: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Joint & Link Transformations• Each segment has its own coordinate frame• Forward kinematics map is an alternating multiple of

– Joint transformations : represents joint movement– Link transformations : defines a frame relative to its parent

1L

3L

2L3322110 JLJLJLJT =

The position and orientation of the root segment

1st link transformation

1st joint transformation

Page 23: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Joint & Link Transformations

• Both are rigid transformations in general– Joint transformations may include translation

• Human joints are not ideal hinges– Link transformations may include rotation

• Some links are twisted

Page 24: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Denavit-Hartenberg Notation

),(),(),(),( 11 iiiii ZRotdZTransaXTransXRotL qa ×××= --

iiii

iiii

iiii

iiii

ZXXZXXdXZZ

XZZa

about measured and between angle the along measured to from distance the

about measured and between angle the along measured to from distance the

1

1

1

1

-

-

+

+

====

q

a

Page 25: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Link Transformations• How do you compute the link transform for the ith joint if

you know the position and orientation of the ith joint as well as its parent’s position and orientation at the neutral pose ?

1-iT

iL

iTiii

iii

TTLTLT11

1--

-

=

=

Page 26: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Representing Hierarchical Models• A tree structure

– A node contains a joint transformation– A arc contains a link transformation

0J

1J

2J

3J

1L

2L

3L

Page 27: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Depth-First Tree Traversal• Draw graphics needs to compute the position and

orientation of all links• OpenGL’s matrix stack is useful

0J

1J

2J

3J

1L

2L

3L

Page 28: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Summary• Kinematics is the study of motion of articulated figures

– Kinematics does not consider physics (forces, mass, …)

• Forward kinematics is straightforward– Forward kinematics map can be considered as a coordinate

transformation

• The next lecture: How to solve the inverse problem

Page 29: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Programming Assignment #1• Create a tree-structured hierarchical model of human

figures– You have to compute the forward kinematics map of your model– You may use a matrix stack to build the forward kinematics map

incrementally

• The model may be displayed using three-dimensional primitives such as polygons, boxes, cylinders, and spheres

• The joints are either revolute or ball-and-sockets

Page 30: Kinematics - Seoul National Universitymrl.snu.ac.kr/.../ComputerAnimationLectureNote/5_Kinematics.pdf · Forward Kinematics: A Simple Example • Forward kinematics map as a coordinate

Programming Assignment #1• Animate the model to demonstrate the hierarchical

structure– For example, use sin/cos functions to make it walk and run

• Implement a scene 3D viewer– You should be able to change the viewpoint (scene

rotation/translation)– The viewer will be used in all the other programming assignment

• Submit a report of at most three A4 pages– Describe the tree-structure, joints, and geometric primitives– Describe how the joints are animated