Chapter 2 Math Fundamentals
Total Page:16
File Type:pdf, Size:1020Kb
Chapter 2 Math Fundamentals Part 1 2.1 Conventions and Definitions 2.2 Matrices 2.3 Fundamentals of Rigid Transforms 1 Mobile Robotics - Prof Alonzo Kelly, CMU RI Outline • 2.1 Conventions and Definitions • 2.2 Matrices • 2.3 Fundamentals of Rigid Transforms • Summary 2 Mobile Robotics - Prof Alonzo Kelly, CMU RI Outline • 2.1 Conventions and Definitions – 2.1.1 Notational Conventions – 2.1.2 Embedded Coordinate Frames • 2.2 Matrices • 2.3 Fundamentals of Rigid Transforms • Summary 3 Mobile Robotics - Prof Alonzo Kelly, CMU RI Physical Quantities • Mechanics is about r properties of / relations b a between objects. • a is “r-related” to b • r property of a relative to b • Example velocity (v) of robot (r) relative to earth (e): • Relationship is directional and (often) asymmetric. ≠ 4 Mobile Robotics - Prof Alonzo Kelly, CMU RI Properties ? • “r’ is not quite a property of a. – “the” velocity of an object is not defined. z • It’s a property of a relative to b. x y • a and b are real objects. • In rare instances, we do not need a b. z – unit vectors always of length 1. y x 5 Mobile Robotics - Prof Alonzo Kelly, CMU RI Vectors, Matrices, and Tensors • With one exception (e.g. clight) all require a datum (def’n of zero). • May be scalars (density), vectors (velocity), tensors (_?_). – All are tensors of varying order. • We write: • The vectors at least can be of 1, 2, or 3 dimensions . ⃑ ⃑ ⃑ 6 Mobile Robotics - Prof Alonzo Kelly, CMU RI Frames of Reference and Coordinate Systems • Objects of interest are real: z wheels, sensors, obstacles. x y • Abstract them by sets of axes fixed to the body. • These axes: – Have a state of motion Reference Frame – Can be used to express Coordinate System vectors. • Call them coordinate frames. 7 Mobile Robotics - Prof Alonzo Kelly, CMU RI Coordinate Frames • Points possess position but not orientation: Particle (orientation undefined) • Rigid Bodies possess position and orientation: Ball (can rotate) • A rigid body: – does not have one position. – does have one orientation 8 Mobile Robotics - Prof Alonzo Kelly, CMU RI Outline • 2.1 Conventions and Definitions – 2.1.1 Notational Conventions – 2.1.2 Embedded Coordinate Frames • 2.2 Matrices • 2.3 Fundamentals of Rigid Transforms • Summary 9 Mobile Robotics - Prof Alonzo Kelly, CMU RI Vectors and Coordinates • Many laws of physics relate vectors and hold regardless of coordinate system. • Notation: – is expressed in some coordinate system. – is coordinate system independent. ⃑ c b a 10 Mobile Robotics - Prof Alonzo Kelly, CMU RI Vectors and Coordinates • Vectors of physics are coordinate system independent: c = a + b c Tool b a World • Addition is defined geometrically. 11 Mobile Robotics - Prof Alonzo Kelly, CMU RI Vectors and Coordinates • Vectors of linear algebra are coordinate system dependent: c = a + b cx ax bx = + c a b y y y • Addition is defined algebraically. • A relation to physical vectors (directed line segments) requires a coordinate system. 12 Mobile Robotics - Prof Alonzo Kelly, CMU RI Free and Bound Transformations • Distinguishes what happens when the reference frame changes. • Bound: the vector may change and its expression may change. – Transformation of frame of reference (physics). • Free: the vector remains the same and its expression may change – Transformation of coordinatesp (mathematics). a b rp rp a a b rp 13 Mobile Robotics - Prof Alonzo Kelly, CMU RI Notational Conventions o c d r c r o d • r relationship / property • o object to which property is attributed • d object serving as datum • c object providing the coordinate system 14 Mobile Robotics - Prof Alonzo Kelly, CMU RI Box 2.1 Notation for Physical Quantities • : the r property of a expressed in the default coordinate system associated with object a. • : the r property of a relative to b in coordinate system independent form. ⃑ • : the r property of a relative to b expressed in the default coordinate system associated with object b. • : the r property of a relative to b expressed in the default coordinate system associated with object c. 15 Mobile Robotics - Prof Alonzo Kelly, CMU RI 16 Mobile Robotics - Prof Alonzo Kelly, CMU RI Sub/Super Scripts – Physics Vectors • Leading subscripts denote the frame/ object possessing the vector quantity: vball • Leading superscripts denote the frame/object with respect to which the quantity is measured (i.e. the datum): world train world vball = vball + vtrain World 17 Mobile Robotics - Prof Alonzo Kelly, CMU RI Sub/SuperScripts – LA Vectors • Leading subscripts denote the object frame possessing the quantity: v wheel • Leading superscripts denote the datum (also the implied coordinate system within which the quantity is expressed). world vwheel • Trailing superscripts denote the coordinate system, and leading denotes datum when necessary. body wheel vworld 18 Mobile Robotics - Prof Alonzo Kelly, CMU RI Notational Conventions • Position vectors: r = T xyz • Also sometimes as r or as r to emphasize it is a vector. • Matrices: t t t xx xy xz T = tyx tyy tyz tzx tzy tzz 19 Mobile Robotics - Prof Alonzo Kelly, CMU RI Why All The Fuss ? • Accelerometer: acceleration of the sensor wrt inertial space: i as • Strapdown: acceleration of the sensor wrt inertial space referred to b i body coordinates: as • Nav Solution: Acceleration of the body wrt earth referred to earth e e coordinates: ab 20 Mobile Robotics - Prof Alonzo Kelly, CMU RI Why All The Fuss ? • WMR kinematics are much easier to do in the body frame. e vfr • Velocity of the front right wheel wrt the earth (“world”) frame: e vfr • Velocity of front right wheel wrt earth e referred to body coordinates: b e vfr 21 Mobile Robotics - Prof Alonzo Kelly, CMU RI Why All The Fuss ? • Coordinate system may be unrelated to either b w ve vfr fr the object or the datum. – So you need a third symbol to be precise. e w 22 Mobile Robotics - Prof Alonzo Kelly, CMU RI Converting Coordinates b b a r = Ta r b • We will see later that T notation satisfies our conventions where it meansa the ‘T’ property of ‘object’ a wrt ‘object’ b. 23 Mobile Robotics - Prof Alonzo Kelly, CMU RI Outline • 2.1 Conventions and Definitions • 2.2 Matrices • 2.3 Fundamentals of Rigid Transforms • Summary 24 Mobile Robotics - Prof Alonzo Kelly, CMU RI Tensors • For our purposes, these are multidimensional arrays: • Consider T(I,j,k) to be a 3D “box” of numbers. • Suppose it is 3X3X3, then there are three “slices” extending out of the page. 2 3.6 7 35– 12 7 9.2 18 T1 = T2 = T3 = 8– 4.3 0 42– 1 84– 0 13 T213[],, =T2[][]1 []3 ==t213 12 25 Mobile Robotics - Prof Alonzo Kelly, CMU RI 25 Some Notation • Block Notation: A A A = 11 12 A21 A22 A = • Tensor Notation: aijk – [ .. ] means a set that can be arranged in a rectangle that is ordered in each dimension. 26 Mobile Robotics - Prof Alonzo Kelly, CMU RI 26 Operations ⋅ • Vector dot product: ab= ∑ak bk k – Also written T • Matrix multiplication: a b C== AB[] c =a b – Dot product of i-th row and ij ∑ ik kj j-th column k aybz – azby c== ab× • Cross product azbx – axbz X – Also written: c== ab× a b axby – aybx 0a– z ay aX = – ‘Skew” matrix az 0a– x –ay ax 0 27 Mobile Robotics - Prof Alonzo Kelly, CMU RI 27 Operations • 2.2.1.7 Outer Product: a b a b a b x x x y x z c== abT aybx ayby aybz azbx azby azbz • 2.2.1.8 Block Multiplication: A A B B A = 11 12 B = 11 12 A 21 A22 B21 B22 A B + A B A B + A B AB = 11 11 12 21 11 12 12 22 A21B11 + A22 B21 A21 B12 + A22 B22 28 Mobile Robotics - Prof Alonzo Kelly, CMU RI 28 2.2.1.9 Linear Mappings • Of course, this is: y= Ax – “every element of y depends on every element of x in a linear manner”. = • Two views: – “A operates on x”: y is the list of mX1 mXn projections of x on each row of A. – “x operates on A”: y is a weighted nX1 sum of the columns of A. x is the weights. • A turns x into y or x collapses A’s rows to produce y 29 Mobile Robotics - Prof Alonzo Kelly, CMU RI 29 2.2.2 Matrix Functions … • Function of a scalar: a11 ()t a12 ()…t At()==() a21 ()t a22 ()…t aij t … …… • Function of a vector: a11 ()x a12 (x )… Ax()==() a21 ()x a22 (x )… aij x … …… 30 Mobile Robotics - Prof Alonzo Kelly, CMU RI 30 Exponentiation • Powers of matrices automatically commute: 3 2 2 A ===AA() ()A A AAA • Hence, we can define matrix “polynomials”: 2 Y= AX + BX+ C • Not so useful in practice but: – Y = aX2 +bX +c (scalar coefficients) is super useful. 31 Mobile Robotics - Prof Alonzo Kelly, CMU RI 31 Arbitrary Functions of Matrices • Recall the Taylor Series: 2 2 3 3 df x d f x d f fx()= f0()++x ----- +----- +… dx 2! dx 3! dx 0 0 0 • Taylor series for exponential function: 2 3 x x e ==exp()x 1++++ x x----- ----- … 2! 3! • Hence, define the matrix exponential as: A2 A 3 exp()A = I++++ A ------ ------ … 2! 3! 32 Mobile Robotics - Prof Alonzo Kelly, CMU RI 32 2.2.3 Matrix Inversion & Inverse Mapping • Matrix inverse defined s.t.: –1 A AI= • Therefore: –1 –1 A yA==Ax x xA= –1y 33 Mobile Robotics - Prof Alonzo Kelly, CMU RI 33 2.2.3.2 Determinant • Scalar-valued function of a det() A ==ab ad– cb matrix.