Rigid body transformations Intelligent Robotics 2014/15 Chris Burbridge Euclidean Space ● N-dimensional Euclidean space with n-dimensional vectors or points. ● Vector. ● – Expresses a relative displacement, change or direction. – The sum and the difference of two vectors is a vector. – Denoted by line segment connecting two points. Point. – Expresses an absolute location in some reference frame. – The sum is undefined, the difference is a vector. Rigid Bodies ● ● ● Point p can move on a trajectory represented by a parametrised curve p(t) = (x(t), y(t)). A rigid body is a collection of points (particles) which mutual distances are fixed regardless of trajectories they can move on. For any pair of points p and q belonging to a rigid body: – ǁp(0) – q(0)ǁ = ǁp(t) – q(t)ǁ, for any t. Rotation Matrix ● Y Rotate point p = (x, y) by angle θ. – p’=(x’, y’) From trigonometry: p=(x, y) θ – Equivalently in a matrix form: X Transforming a point Y – ● Rotation is anticlockwise by θ Y' X' Rotate a coordinate frame by angle θ: θ y' x p=(x, y) y p’=(x’, y’) x' X Transforming coordinate frames Rotation Matrix Properties ● ● Rotation matrices form a group with multiplication operation ◦ : – Closure: If R1, R2 are rotation matrices R1◦R2 is also a rotation matrix. – Identity: For each rotation matrix R, there exists an identity element I, such that R◦I = I◦R. – Inverse: For each rotation matrix R, there exists a (unique) inverse, R-1 such that R◦R-1 = R-1◦R = I. Inverse is just the transpose! – Associativity: For any rotation matrices R1, R2, R3 : (R1◦R2)◦R3 = R1◦(R2◦R3). Other properties: – Columns of R are mutually orthonormal. – Not commutative R1◦R2 ǂ R2◦R1 Rotation Matrix Example Rigid Body Transformations ● ● A rigid body transformation g is a mapping from R2 to R2 (or in 3D R3) which represents a rigid motion and preserves: Distance between any points p and q: ∥g ( p) – g (q)∥=∥ p – q∥ Cross product of any vectors v and w: g (v×w)= g (v )× g (w ) ● It is a series of rotations and translations. Homogeneous Representation ● Rotating, translating, rotating, translating.... ● It is easier to transform, transform, transform.. ● Can represent a two-step rotation & translation as a single-step matrix multiplication using homogeneous co-ordinates Homogeneous Representation ● Any point p from R2 has a corresponding R3 vector: ● For any point p, the transformation p’= g(p) = Rp + v can be rewritten as a 3x3 matrix M: Moving to 3D ● ● Translation in R3 is no more complicated Rotation in R3 is the same, but now we have a rotation about an x, y, z axis – Euler angles; Tait-bryan angles – Which order, which axis? – Often (and in ROS), Quaternion's are used instead of rotation matrices. Quaternions for 3D Rotation ● A unit quaternion Q=[q x , q y , q z , q w ] represents a rotation in 3D ● Can be converted to a rotation matrix ● Simplest to think of in terms of angle axis: Q=[ x .sin (α/2) , y .sin (α/2) , z .sin (α/2) , cos(a/ 2)] Is a quaternion representing a rotation α about the axis [x, y, z] ● For example, a 90 degree rotation about the z axis: Q=[0 .sin (90/ 2) , 0 . sin (90/ 2) ,1 .sin (90/2) , cos(90/2)] =[0, 0, 0.707,0.707] Quaternion Product ● Combining two rotations Q1 & Q2 to find an overall rotation quaternion Q3: [ w x x w y z z y Q 1 . Q 2 + Q 1 .Q 2 + Q 1 . Q 2 − Q 1 .Q 2 w y x z y w z x Q .Q − Q .Q + Q .Q − Q .Q 1 2 1 2 1 2 Q 3= 1w 2z x y y x z w Q 1 . Q 2 − Q 1 .Q 2 + Q 1 .Q 2 + Q 1 .Q 2 Q 1w . Q w2 + Q 1x .Q 2x − Q 1y .Q 2y + Q 1z . Q 2z ● ] Quaternion products are not commutative Why Quaternions? ● ● ● Smooth interpolation Computationally efficient combination of rotations Less floating point rounding problems Summary ● Rigid body transformations are important in many areas of robotics ● Quaternions are nifty ● Reading: – Mathematics for Computer Graphics, J. A. Vince, ISBN 978-1-84996-022-9 – www.euclideanspace.com – ROS TF Library: http://www.ros.org/wiki/tf/ including ROS tf.transformations python code.
© Copyright 2026 Paperzz