Autonomous Vehicle/Theory

Axis-Angle Rotation(Rodrigues Rotation)

Naranjito 2024. 9. 26. 18:57
  • Axis-Angle Rotation(Rodrigues Rotation)

 

It is used as a 3d rotation method that can improve the disadvantages of Euler Angle. 3D rotation is more flexible than Euler Angle.



- : the axis of rotation, orange line

- : a point to rotate

- 𝜃 : an angle to rotate

- : the final point of rotation

- : a point of the world space

- : the center of a rotating plane

 

1. Obtain

- Point : the position of the point in 3D space.

- Point : the origin in homogeneous coordinates.

- u = P O = ( x , y , z , 0 )

  * Tip

 

A point in Homogeneous coordinates can be written as . The last element being 1 signifies that it is a point located in 3D space.

To distinguish between points and vectors, homogeneous coordinates for vectors typically have the last element as 0. This is because vectors represent directions, not positions, and a direction doesn't need a "location" in projective geometry.


O O = v = ( u n ^ ) n ^

  * Tip

 

- : vector

- : unit vector

- ( u n ^ ) : It computes the amount of that lies along the direction of . It results in a scalar value.

- Multiplying by : It converts the scalar back into a vector. It "scales" by the projection of onto , giving a vector with the same direction as .
2. Obtain

 

 

= cos ( θ ) ( u v )

* Tip

 

O Q = n ^ × ( u v )


n ^ × ( u v ) : The cross product produces a vector that is perpendicular to both and .

 

- 𝜃 : It determines how much of the vector aligns with (horizontal component) and how much is perpendicular to it (vertical component, aligned with .

- sin ( θ ) O Q : It gives you the portion of the original vector that lies along the perpendicular direction defined by .
O P = cos ( θ ) O P + sin ( θ ) O Q = cos ( θ ) ( u v ) + sin ( θ ) ( n ^ × ( u v ) ) = cos ( θ ) ( u v ) + sin ( θ ) ( n ^ × u n ^ × v ) = cos ( θ ) ( u v ) + sin ( θ ) ( n ^ × u )

x has been eliminated because two vectors are parallel.

O P = cos ( θ ) ( u v ) + sin ( θ ) ( n ^ × u )

3. Obtain

= +

O P = v + cos ( θ ) ( u v ) + sin ( θ ) ( n ^ × u )


Substitute v = ( u n ^ ) n ^ ,

O P = u = cos ( θ ) u + ( 1 cos ( θ ) ) ( u n ^ ) n ^ + sin ( θ ) ( n ^ × u )

Conclusion

 

- : input vector

- , 𝜃 : used to rotate

Depend on , 𝜃, changes to .
  • Axis-Angle Rotation(Rodrigues Rotation) in Matrix

 

( u n ^ ) n ^ ( n ^ n ^ T ) u

* Tip

 

n ^ n ^ T = n 1 n 2 n 3 n 1 n 2 n 3 = n 1 2 n 1 n 2 n 1 n 3 n 2 n 1 n 2 2 n 2 n 3 n 3 n 1 n 3 n 2 n 3 2

When we multiply this projection matrix by , the resulting vector is the projection of onto .

So, the matrix form n ^ n ^ T does the same projection operation as ( u n ^ ) n ^ .
O P = u = cos ( θ ) u + ( 1 cos ( θ ) ) ( u n ^ ) n ^ + sin ( θ ) ( n ^ × u )

can be expressed like this.

u = cos ( θ ) u + ( 1 cos ( θ ) ) ( n ^ n ^ T ) u + sin ( θ ) ( n ^ × u )

  • Cross product in Matrix

 

n ^ = n ^ x n ^ y n ^ z , u = u x u y u z

It is computed using the following determinant of a 3x3 matrix:
n ^ × u = det i ^ j ^ k ^ n ^ x n ^ y n ^ z u x u y u z

Where are the unit vectors along the 𝑥-axes,𝑦-axes, and 𝑧-axes.

The determinant expands as:
n ^ × u = i ^ n ^ y n ^ z u y u z j ^ n ^ x n ^ z u x u z + k ^ n ^ x n ^ y u x u y

Calculating the Determinants:
i ^ n ^ y n ^ z u y u z = i ^ ( n ^ y u z n ^ z u y )

j ^ n ^ x n ^ z u x u z = j ^ ( n ^ x u z n ^ z u x )

k ^ n ^ x n ^ y u x u y = k ^ ( n ^ x u y n ^ y u x )

∴ Full vector:
n ^ × u = [ n ^ y u z n ^ z u y n ^ z u x n ^ x u z n ^ x u y n ^ y u x ] = [ 0 n ^ z n ^ y n ^ z 0 n ^ x n ^ y n ^ x 0 ] [ u x u y u z ]

Substitute K to

K = 0 n ^ z n ^ y n ^ z 0 n ^ x n ^ y n ^ x 0

Then,
n ^ × u = K u


K 2 = 0 n ^ z n ^ y n ^ z 0 n ^ x n ^ y n ^ x 0 0 n ^ z n ^ y n ^ z 0 n ^ x n ^ y n ^ x 0 = n ^ z 2 n ^ y 2 n ^ x n ^ y n ^ z n ^ x n ^ x n ^ y n ^ z 2 n ^ x 2 n ^ y n ^ z n ^ x n ^ z n ^ y n ^ z n ^ x 2 n ^ y 2
Because of this satisfaction,

n ^ x 2 + n ^ y 2 + n ^ z 2 = 1

It can be

n ^ z 2 n ^ y 2 n ^ x n ^ y n ^ z n ^ x n ^ x n ^ y n ^ z 2 n ^ x 2 n ^ y n ^ z n ^ x n ^ z n ^ y n ^ z n ^ x 2 n ^ y 2 = n ^ x 2 1 n ^ x n ^ y n ^ z n ^ x n ^ x n ^ y n ^ y 2 1 n ^ y n ^ z n ^ x n ^ z n ^ y n ^ z n ^ z 2 1
And

n ^ n ^ T = n ^ x n ^ x n ^ x n ^ y n ^ x n ^ z n ^ y n ^ x n ^ y n ^ y n ^ y n ^ z n ^ z n ^ x n ^ z n ^ y n ^ z n ^ z

I = 1 0 0 0 1 0 0 0 1



n ^ n ^ T I = n ^ x 2 1 n ^ x n ^ y n ^ x n ^ z n ^ y n ^ x n ^ y 2 1 n ^ y n ^ z n ^ z n ^ x n ^ z n ^ y n ^ z 2 1
K 2 = n ^ n ^ T I

n ^ n ^ T = K 2 + I
Then, using this

n ^ × u = K u

and

n ^ n ^ T = K 2 + I
u = cos ( θ ) u + ( 1 cos ( θ ) ) ( n ^ n ^ T ) u + sin ( θ ) ( n ^ × u )

can be changed to

u = cos ( θ ) u + ( 1 cos ( θ ) ) ( n ^ n ^ T ) u + sin ( θ ) ( n ^ × u ) = cos ( θ ) u + ( 1 cos ( θ ) ) ( K 2 + I ) u + sin ( θ ) K u = ( cos ( θ ) I + ( 1 cos ( θ ) ) ( K 2 + I ) + sin ( θ ) K ) u = R u

 

In here, 

R = cos ( θ ) I + ( 1 cos ( θ ) ) ( K 2 + I ) + sin ( θ ) K



cos θ 1 0 0 0 1 0 0 0 1 + 1 cos θ n ^ x 2 n ^ x n ^ y n ^ z n ^ x n ^ x n ^ y n ^ y 2 n ^ y n ^ z n ^ x n ^ z n ^ y n ^ z n ^ z 2 + sin θ 0 n ^ z n ^ y n ^ z 0 n ^ x n ^ y n ^ x 0

Conclusion

 

R = ( 1 cos ( θ ) ) n ^ x 2 + cos ( θ ) ( 1 cos ( θ ) ) n ^ x n ^ y sin ( θ ) n ^ z ( 1 cos ( θ ) ) n ^ z n ^ x + sin ( θ ) n ^ y ( 1 cos ( θ ) ) n ^ x n ^ y + sin ( θ ) n ^ z ( 1 cos ( θ ) ) n ^ y 2 + cos ( θ ) ( 1 cos ( θ ) ) n ^ y n ^ z sin ( θ ) n ^ x ( 1 cos ( θ ) ) n ^ x n ^ z sin ( θ ) n ^ y ( 1 cos ( θ ) ) n ^ y n ^ z + sin ( θ ) n ^ x ( 1 cos ( θ ) ) ) n ^ z 2 + cos ( θ )

 

https://gaussian37.github.io/vision-concept-axis_angle_rotation/

'Autonomous Vehicle > Theory' 카테고리의 다른 글

Linear Transformation  (0) 2024.04.03
Fourier transform  (0) 2024.04.02
Random Process, Ensemble, Time Average, Ergodic  (0) 2024.03.20
Bernoulli Trials  (0) 2024.03.18
Chi-squared Distribution  (0) 2024.03.18