Spatial Descriptions and Transformations: Robotics
Spatial Descriptions and Transformations: Robotics
Spatial Descriptions and Transformations: Robotics
Http://raic.kunsan.ac.kr
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
contents
1. Introduction
2. Descriptions(positions, orientations and frames)
3. Mappings(changing descriptions from frame to frame)
4. Operators(translations, rotations, transformations)
5. Summary of interpretations
6. Transformation arithmetic
7. Transform equations
8. More on representation of orientation
9. Transformation of free vectors
10. Computational considerations
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
1. Introduction
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
P-1. Coordinates
y
Ex) Point : (x, y), (r, θ)
( x, y)
Triangle : {(1,1), (0,0), (3, -2)} 1 1
j
Line : {(x, y) | ax+by+c=0}
x
i
• Coordinate system(=frame):
system of basis vectors by which an unique
representation is possible.
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
P-2. Vectors
• Notation : a, b, c
Let a (a , a , , a )
1 2 n b (b , b , , b )
1 2 n
Then a b (a1 b1 , a b , , a b )
2 2 n n
a (a , a , , a
1 2 n
)
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
3-dimensional space (cartesian space)
i, j, k : unit vectors
z
b
a
a x
k y a a i a ja k
x y z
a y
a
z
i j
x a b (a x b x ) i (a y b y ) j (a z b z ) k
a (a i a j a k ) ( a ) i ( a ) j ( a ) k
x y z x y z
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
Dot product (Scalar product)
a b a b cos
b
a b (a i a j a k ) (b i b j b k )
x y z x y z
a b a b a b
θ x x y y z z
a
여기서, i i j j k k 1
i j j k k i 0
교환 법칙 a b b a
분배 법칙 (a b) c a c b c
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
Cross product (Vector product)
a b a b sin k
a b sin i j k
a b det a a a x y z
b b b x y z
b
(a bz a z b y) i (a bx a x bz ) j (a b y a y bx) k
y z x
k
θ
a 여기서, ii j j k k 0
분배 법칙 : a (b c) a b a c
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
2. Descriptions
1. Description of a position
좌표계가 설정되면 우주상의 어떤 점(point)도 3X1의 위치 벡터로서 위치를
정할 수 있다.
• 벡터들이 자신이 설정된 좌표계를 나타내는 첨자를 좌측 상반부 (leading
superscript)에 달고 있다.
{A}
ZA
A
P p
A
x
p p
y
p
z
YA
XA
그림 2.1 계에 기준한 벡터의 예
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
2. Description of an orientation
• 회전행렬(rotation matrix) : A
B R
r r r
11 12 13
A r r r
B R =[ A X B AY B A Z B ]= 21
r r r
22 23
31 32 33
(2.2)
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
Px
A Py
P=
Pz
{B}
{A}
A Z
P B
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
• 식 (2.2) 의 스칼라양 r ij 에 대한 표현을 간단히 하면
A
B R 는
X B X A Y B X A Z B X A
A A A
A
B R X B YB ZB X B Y A Y B Y A Z BY A (2.3)
X B Z A
Y B Z A
Z B Z A
B
• A
은 계 {A} 를 계 {B} 에 대하여 표시하는 것이 되므로 식 (2.3)의
R
전치행렬이 된다.
B
T
XA
A A
B B
R BART
A
BR XB ZB
T
A
YB YA 즉 A
B
T
ZA
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
3. Description of a frame
{B}
ZB
{A}
{B} {BA R, APBORG}
ZA A
PBORG YB
XB
YA
XA
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
여러 가지 계의 예
{A}
ZA
YA
{C}
ZC
{B}
{U}
YU
ZB
ZU XA YC
XC
YB
XU XB
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
3. Mappings
(changing descriptions from frame to frame)
{B}
ZB
{A}
B
ZA A
P P
YB
A
PBORG
YA XB
XA A
P BP APBORG
A
P P PBORG
B A
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
• 2. Mappings involving rotated frames
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
•그림[2.5]에서 두 계의 원점이 일치할 경우 계 {B}에 대하여 벡터의 정의를
알고 있을 때 , 다른 계 {A} 에 대한 그 벡터를 정의 할 수 있다.
•이 계산은 {B}의 방위 표현이 {A}에 관하여 알려 졌을 때 가능하다.
•이 방위는 회전행렬 A
B R 에 의해서 주어진다.
• A
P 는 다음과 같이 계산 된다.
B {A}
A
p x X A BP {B}
ZA
B ZB B
P
p y YA P P R P
A B A A B
B YB
B
A
p z Z A BP
YA
XA
XB
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
회전 행렬 구하는 방법
( X A , YA , Z A ) ( i , j , k ), ( X B , YB , Z B ) (i', j', k ')
T
pz known
B B B B
{A} p
p x
, p y
,
{B}
p ,
T
pz ?
A A A A
ZA p x
p, y
ZB B
P B
A B B B B B
p i p i ( p i' p j' p k ') p i i' p i j' p i k ')
YB x x y z x y z
A B B B B B B
p j p j ( p i' p j' p k ') p j i' p j j' p j k ')
y x y Z x y z
YA B
A B B B B B
A
XB
B
px i i' ij'
i k ' p x
A
B
p j i' j j' j k ' p
y
A
P R PA B A
y
B
B p k i' k j' k k '
p z
z
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
• 3. Mappings involving general frames
{B}
ZB
{A} A
P
P BAR BP APBORG
A B
P
ZA XB
(2.17)
A
PBORG YB
YA
XA
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
• 위의 식은 한 계에서 다른 계로 벡터의 표시를 변환하는 일반적인
맵핑을 나타낸다.
A A A B
P B R PBORG P
= (2.19)
1 000 1 1
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
4. Operators
(translations, rotations, transformations)
• 1. Translational operators
A A
• [그림 2.9]는 어떻게 벡터 P1이 벡터 Q 에 의하여 전위되었는가를 보여
준다.(벡터 AQ 는 이 전위를 수행하는 데 필요한 정보를 제공한다.)
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
• 전위를 수행한 결과 새로운 벡터는 다음과 같다. A
P2 AP 1 AQ
• 행렬 연산자로 전위를 수행하는 것을 나타내면 A
P2 DQ (q) AP1이다.
(여기서 q 는 벡터 Q 의 방향으로 부호를 가진 전위의 크기이다.)
• D Q 라는 연산자는 다음의 간단한 형식의 균질 변환으로 생각할 수 있다.
1 0 0 qx
0 1 0 qy
DQ (q )
0 0 1 qz
0 0 01 {B}
q x , q y , qz 는 전위벡터 Q {A} A
P2
• 여기서 A A
ZA P1 P1
의 성분이고, q qx2 q y2 qz2
이 된다. A
Q
YA
XA
[그림 2.4] 전위 연산자.
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
• 2. Rotational operators
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
• 3. Transformation operators
A
• 연산자 T는 벡터 P2 를 계산한다. A
P2 T AP1
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
5. Summary of interpretations
• 균질변환의 세 가지 해석
A
1. 이것은 계의 표시 이다. B 는 계 {A} 에 기준한 계 {B} 를 표시한다.
A
T
A
특히, B R
의 열은 {B}의 주축의 방향을 정의하는 단위 벡터이고, BORG P
는 {B}의 원점의 위치를 정한다.
A A
3. 이것은 변환연산자 이다. T 는 P1 에 작용하여 P2 를 생성한다.
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
6. Transformation arithmatic
• 1.Compound transformations
C A
• [그림2.12]에서 P 를 알고서 P 를 구하기를 원한다.
B
P CBT CP (2.37)
A
P ABT BP (2.38)
Z B {C}
Z B{B} C
P
위의 두식을 결합하면 YC
{A}
ZA A
P
A
P T T P
A
B
B
C
C
위의 결과에서 다음을 정의할 수 있다. YB
YA XC
XA
A
C T T TA
B
B
C
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
A
• {B}와 {C}를 알고 있으므로 T 의 표현을 나타낼 수 있다.
C
A
B R B
C R A
B R BPCORG APBORG
A
C T
0 0 0 1
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
• 2. Inverting a transform
A
• 계 {A}에 기준하여 알려진 계 {B} 즉, BT 의 값을 아는 계가 있을때 {B} 에 기
준한 {A}의 표시 즉, BT 를 얻기 위하여 이변환의 역을 얻기를 원한다.
B A A A B B
• AT 를 발견하기 위하여 , B R 과 PBORG 로부터 A R 과 PAORG 를 계산 해야
한다.
1) B
A R BA R T
2)
B A
( PBORG ) ABR APBORG BPAORG 0
A T
BR BART A PBORG A 1
AT BT
B
0 1
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
7. Transform eqations
{D}
1)
U
DT UAT DAT
2)
U
D T UBT CBT CDT {A}
변환방정식을 만들기 위하여 이 두 가지 식을
같게 놓는다.
U
A T DAT UBT CBT CDT {C}
하면 해는 다음과 같다.
{B}
B
C T UBT 1 UAT DAT CDT 1
[그림2.14]
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
[그림 2.15]는 유사한 다른 경우를 나타내며 {C}의 가능한 두 가지 표시는 다음과 같다.
1)
U
C T UAT DAT 1 DCT
2)
U
C T UBT CBT
{D}
U
위의 두 식을 같게 놓음으로써 A T 를 구할 수 있다.
U
A T UBT CBT DCT 1 DAT {A}
{C}
{U}
{B}
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
8. More on representation of orientation
• 방위를 표시하는 방법으로 3*3 회전행렬 만을 사용.
• 회전행렬은 모든 열이 서로 수직이고 단위 크기를 가지고 있으며 그 행렬
식의 값이 언제나 +1인 경우이다.
• 회전행렬은 고유 정규직교행렬(proper orthonormal matrices)이라
고 한다.
• 정규직교행렬에 관한 Cayley 의 공식[3] 의 결과에 의하여 어떤 3*3 회
전행렬도 세 개의 파라미터만으로 표시할 수 있다.
• 회전행렬 R이 주어졌을 때, 요소 사이의 종속관계를 쉽게 나타낼 수 있다.
R [X Y Z] [ i j k]
• 행렬 9개의 요소에, 6개의 제한조건이 있다. (단위 벡터의 성질)
| X | 1 X Y 0
|Y | 1 XZ 0
| Z | 1 Y Z 0
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
• 1. X-Y-Z fixed angles
c c c s s s c c s c s s
A
B RXYZ ( , , ) s c s s s c c s s c c s (2.64)
s c s c c
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
• 회전행렬로부터 등가의 롤, 피치와 요우각을 역으로 계산하는 문제.
• (2.64)식을 주어진 회전행렬과 같도록 놓는다.
r11 r12 r13
A
B RXYZ ( , , ) r21 r22 r23
r31 r32 r33
0.0
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
9. Transformation of free vectors
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB
10. Computatoinal considerations
• 변환이 수행되는 순서는, 같은 양을 계산하는 데 필요한 계산양의 많은 차를 나
타낸다.
•
A
P BAR CBR DC R DP 와 같이 벡터의 회전이 여러 번 수행 된다고 할 때
27 mul
18 add 9 mul
27 mul 9 mul 6 add
18 add 9 mul 6 add
9 mul
6 add 6 add
School of Electronic & Information Eng., Kunsan National University. Robotics & AI Control LAB