Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS -...
Transcript of Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS -...
![Page 1: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/1.jpg)
Robotics: Science and Systems
Zhibin (Alex) LiSchool of Informatics
University of Edinburgh
Coordinate Transformation
Slide Credit: Prof. Sethu Vijayakumar
![Page 2: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/2.jpg)
Recap: What Tools Do We Need?
2
Coordinate Transformation(Where am I in relation to the
world?)
World Frame
Local Frame
![Page 3: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/3.jpg)
Coordinate definitionThe common definition of the x-y-z coordinate used in robotics: a Cartesian coordinate system that defines our 3-dimensional space (right-hand rule).A position in space is therefore defined by a vector:
The distance between points and is: x y
z
![Page 4: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/4.jpg)
Representation of positionA position is space is therefore defined by a vector:
Hence, two points and can be represented by vectors:
Quiz: what is a mathematically neatway to represent the spatial relation between these two points?
x y
z
r1
r2
![Page 5: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/5.jpg)
Coordinate transformationLet two vectors and be the origins of two coordinates , what the coordinate transformation would be with respect to the global coordinate ? For example, how to represent a vector in coordinate in the global coordinate ?
x y
z
r1
r2
O2 O1
O
![Page 6: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/6.jpg)
Coordinate transformationExample: represent a vector in local coordinate in the global coordinate . Position of a point in local coordinate Position of local coordinate in global coordinate
So position of in
O2
O
v
x y
z
r2
![Page 7: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/7.jpg)
Representation of spatial relation
The coordinates in previous examples have all axes aligned. So what is still missing in a more general case?
Rotational representation
![Page 8: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/8.jpg)
Rigid Body Position & Pose
Pose = Position + OrientationPosition
Prof. Sethu Vijayakumar // R:SS 2017 8
![Page 9: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/9.jpg)
Rotation Matrices• Properties
orthonormal matrix(orthogonal vectors stay orthogonal, normal vectors stay normal)
columns and rows are orthogonal unit vectors
Let the new basis vectors be (e.g.)Then, the coordinate transformation from frame is:
Prof. Sethu Vijayakumar // R:SS 2017
9
![Page 10: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/10.jpg)
Coordinate Transform
Prof. Sethu Vijayakumar // R:SS 2017 10
![Page 11: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/11.jpg)
Simple Rotation Matrices• 2D • 3D
Prof. Sethu Vijayakumar // R:SS 2017
11
![Page 12: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/12.jpg)
Example: a 2D Rotation MatrixHow the rotational matrix is formulated?
How this matrix is used?
or Note: is in a global coordinate, is in a local coordinate.Quiz: a whiteboard exercise to derive these equations
x
y
x’
y’
![Page 13: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/13.jpg)
Rotation Matrix: Good & Bad
• Pros– Rotates vectors
directly– Easy
composition
• Cons– 9 numbers– Difficult to
enforce constraints
Degrees of Freedom (DOF) of a Rotation Matrix• R3x3 has 9 numbers• 6 constraints ( 3 orthogonal, 3 normal)• only 3 degrees of freedom (DOF)Can we represent with minimal (=3) independent parameters?
Prof. Sethu Vijayakumar // R:SS 2017
13
![Page 14: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/14.jpg)
Rotation: Euler Angles• Describe rotations by consecutive rotations about
different axes:
• Z-Y-Z (3-1-3) representation• yaw-pitch-roll or Z-Y-X (3-2-1) ….used in flight!
Prof. Sethu Vijayakumar // R:SS 2017 14
![Page 15: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/15.jpg)
Euler Angles and Gimbal Lock
• Euler angles have a severe problem:– If two axes align: blocks 1 DOF – ‘singularity’ of Euler angles
• Pros– minimal
representation– human readable
• Cons– Gimbal lock– must convert to
matrix to rotate vector
– no easy compositionProf. Sethu Vijayakumar // R:SS 2017 15
![Page 16: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/16.jpg)
Coordinate definitionA GUI that helps to understand the properties, click here
![Page 17: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/17.jpg)
Rotation: Rotation Vector• Using 3 numbers…
• Pros– minimal
representation– human readable
• Cons– singularity for small
rotations– must convert to matrix to
rotate vector– no easy composition
Prof. Sethu Vijayakumar // R:SS 2017 17
![Page 18: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/18.jpg)
Quaternions: extension of complex numbers from 2 dimensions, into 4 dimensions.Complex numbers: Quaternions:
-Recall representation by the rotational Vector: 1) 3d rotation axis is define by a vector (position in [m]); 2) rotational angle is defined by radians. → discrepancy and ambiguity.Quaternions, however, represent all 4dimensions coherently.
Quarternion
![Page 19: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/19.jpg)
Rotation: Quarternion• Math tells: all schemes with 3 numbers will have a
singularity
Prof. Sethu Vijayakumar // R:SS 2017 19
![Page 20: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/20.jpg)
Quarternion: Composition• Conversion to/from matrix
• CompositionProf. Sethu Vijayakumar // R:SS 2017 20
![Page 21: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/21.jpg)
Quaternions: Pros and Cons• Pros
– no singularity– almost minimal
representation– easy to enforce constraints– easy composition– easy interpolation
• Cons– somewhat
confusing– not quite minimal– must convert to
matrix to rotate vector
• Summary of Rotation representations– need rotation matrix to rotate vectors– Quarternions good for free rotations– Euler angles OK for small angular deviations
– but beware singularities!Prof. Sethu Vijayakumar // R:SS 2017 21
![Page 22: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/22.jpg)
Homogeneous Transformations
Definition: position vector in a global coordinate; position vector in a local coordinate;
: rotational matrix
Hence, the transformation is
: offset vector between origins : vector is local frametransformed by
x’
y’
x
y p
r’
![Page 23: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/23.jpg)
Homogeneous Transformations
A compact way of representing coordinate transformations between two frames
in homogeneous transformations, we append 1 to all coordinate vectorsProf. Sethu Vijayakumar // R:SS 2017 23
![Page 24: Robotics: Science and Systemswcms.inf.ed.ac.uk/ipab/rss/lecture-notes-2018-2019/2. RSS - Coordin… · –but beware singularities! Prof. Sethu Vijayakumar // R:SS 2017 21. Homogeneous](https://reader033.fdocuments.in/reader033/viewer/2022052004/6017eb6d535b6f1c7270204e/html5/thumbnails/24.jpg)
Composition of transforms
Prof. Sethu Vijayakumar // R:SS 2017 24