3D Coordinates and Representations of Rotations (Cyrill Stachniss, 2020)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so welcome today i want to talk about coordinate transformations and representations for rotations especially because most of the time we are concerned with state estimation problems which involve that we have objects that move through the 3d world that means they are somewhere in the world and they often have an orientation that means they look somewhere or have a distinct orientation like an airplane is flying forward so the forward direction needs to be specified and therefore the representation of rotations is a crucial point in here and is also the most complex part of this lecture and there are different ways how we can do that and want to dive a little bit into the different alternative representations of rotations and what their advantages and disadvantages are so we start with kind of the first part of this lecture here and then following up we will in the next lecture leave the euclidean world and go to a different space the projective space and then my colleagues will continue teaching the relevant parts of the coordinate systems lecture that are important for the individual disciplines but let's start today with kind of the very basic things that we may want to look into if you want to represent a point in space okay so the problem of representing geometric objects or in the simplest ways points in space either in 2d or in 3d is something which is very common so this can be where is an object where did i place my presenter i place it here on my table and the question is how can i describe where it is i can describe this by specifying the x y z coordinate of where that pointer is for example um and the question is how do we represent those points is using x y z coordinate a good way to do this quite often probably yes but there are different ways how we can do this and we are often also concerned with transformations so we have objects which move through the space this can be an airplane flying around can be a drone can be a robot can be a car and we need to estimate where those systems are and track their motion through the environment and therefore we need to transform those points to transform an object from one state into the successor state for example and therefore transformations also play an important role in here prominent examples as i said before a moving vehicle a robot that is represented as a point in space that can move from one position to another position and this is in the simplest form can be represented by a point in practice it's most likely to be a bit more complex because there are some orientation information that you may want to take into account or later on you may even take velocities into account but in the most simplest form we can say these are objects which have a location in space which is an x y coordinate if we're in the plane or an x y that coordinate if we are in the 3d world and there are even different ways what my coordinate system looks like or where the original where's the system pointing to so different coordinate systems that you need to deal with in during your studies so let's start with the most simplest way we have simply a point in the two-dimensional world again the point is shown here in calligraphic letters and this is my x and my y-coordinate of that point so i can express the point in my euclidean world as the euclidean coordinate as a vector both face x is regular x regular y so the x and y coordinate of that point and this is a coordinate telling me where this point x lies so this is this point over here it's a very simple representation of where that point is and if you go to the 3d world that means we leave the plane so to say then this simply becomes we need a third coordinate axis in order to do this so we can visualize this in 3d we have x coordinates y coordinate axis and that coordinate axis and then this point has an x y z coordinate here expressed in capital letters just to make the explicit distinction between 2d and 3d and so this is the way we represent points in space and this is very very simple just a standard euclidean way as you know it from school therefore i won't dive much more into the details here but one thing which is important to note in here is um the coordinate systems where are the coordinate x's actually pointing to that's something that needs to be specified and different communities have different conventions on how this is done so one of the important quantities is typically that we have a right so-called right-handed coordinate system so in a right-handed coordinate system you can use your right hand where this is my x-coordinate my y-coordinate my z-coordinate so this tells you first second and third coordinate how they are oriented too so if my the x coordinate the this is moving forward in this example over here then this would be my second coordinate and my third coordinate over here and you have to be careful with your right hand because um if you're at least if you're right and typically right with your right hand so if you make your the pen you write your your notes down and then you intentionally you or you accidentally use your left hand and then you screw up everything so make sure you put down your pen and take your right hand and if you want to check where your coordinate axes are typically it is defined in the way that the positive rotation can be also determined using your right hand so if your thumb is the coordinate axis then your fingers point in the direction of a positive rotation so if you're pointing forwards now to the camera this is the rotation axis then this would be the positive direction of motion important thing is always use your right hand don't use your left hand okay so um if you go a bit further now just as a notation if i'm talking about the geometric object it's typically used here in calligraphic letters where i'm talking about the point itself and not specifying the way it is represented for today we are leaving in the euclidean world so we will use this type of font this is the coordinates of this point x in euclidean coordinates we will also investigate homogeneous coordinates then it will be a different font whatever is lowercase is typically 2d whatever is capitalized is typically in 3d um a refers to planes in homogeneous coordinates a matrix or rotation matrix is typically written here in this form r and we have quaternions which typically use this type of fonts um in the same way or it's actually the same way as for homogeneous coordinates but for now we are actually fine um as we don't go into homogeneous coordinates today so just as kind of explaining the notation um i introduced this or i'm using following here the notation of wolfgang firstner that he also used in his book photogrammetric computer vision because it makes it easy for you to immediately see what kind of object you have in front of you and you don't need to think ah which representation what this if you use the right font then this comes automatically and i think it helps understanding therefore this slide is important okay let's look a little bit now into transformations so we have a point and you want to transform the point for example moving the point somewhere else shifting it rotating it scaling it these are typical operations that we often want to do so let's start with a translation so i have a point x sitting over here and i want to translate that point somewhere else i want to translate the point with my translation vector t so that the point ends up being over here so we start our x point x this point over here has an x y coordinate then we have a translation vector t x t y which is a translation an additive term that i add to the x into the y coordinate and then i have my new resulting point x prime so that i can say okay x prime is a transformation or translation t translation is a special form of transformation so that my x prime y prime can be computed as x y plus the translation vector you can see here the translation is means simply adding the shift vector onto your coordinates and this shifts the point somewhere else simple shift in this example in the 2d plane the next thing we may want to do we want to rotate points so or rotate vectors so we have one point over here we have this direction vector here to my point x and my point x prime and i want to perform a rotation which rotates this vector over here so the origin stays the same and this point should later on lie over here again we have x prime y prime as my two points and then i can express this transformation from here to here using rotation matrix and the rotation matrix is the matrix of that following form in 2d it's the cosine of the rotation angle here also the cosine on the rotation angle these are the elements in the main diagonal and sine and minus sine of that rotation angle in the off-diagonal elements so if i multiply this vector x y my input to the right-hand side of this rotation matrix it will perform a rotation around the origin and rotate this point to its new coordinates and this is a rotation that i execute this is something that is important whenever you have objects which have some an orientation or some very distinct orientation like for example airplanes always flying forward a car typically also has a front location because that's where you're typically driving to and if you want to express where those objects are looking to for example to describe motion rotations play an important role over here also one important thing to note in here we have sine and cosine functions in here that means this is something which is or is an entity which is not linear anymore so the rotation angles adds a non-linearity to those operations if you consider this as a shift you were just adding a vector to or values to your individual coordinates so this was linear just a linear addition here we have a rotation angle this is squeezed through some non-linear functions the sine and the cosine function so this operation is not linear in the rotation angle anymore the third thing we often need to do is a scale change or performing so-called similarity transform this can involve rotation scale changes as well as translations the scale change is the next important thing here i'm basically enlarging or reducing the size of my world or my objects um so if i have a point which sits over here and i'm multiplying it with a scale effect i want to make everything smaller let's say half of its size that means this point would move downwards towards the origin of my coordinate system so i have my original point x recorded x and y and x prime y prime i can express this by multiplying a scalar factor with the um with this vector so x prime y prime can be expressed as a scale factor lambda over here multiplied with x and y so it's lambda times x and lambda times y so if lambda is 0.5 all the dimensions gets half of its size sometimes we want to scale with different values in the x and y coordinate then you could have used different scalar values over here but if you have one scalar value because you want to shrink or enlarge the world in along all dimensions in the in the same magnitude then you can express this here as this matrix where you have your scaling factor on the main diagonal or just with a scalar multiplying the vector both as possible so we have seen three basic transformations so far a translation a rotation and a scale change we can actually write down these different transformations over here again translation rotation and change in scale and so the question is now what's are they all the same are these different types of operations we said already a bit that this here has some non-linear functions involved so i'm non-linear in the rotation angle but the question is what else is different in here and what is a key difference in here is that those two transformations can be expressed as a vector or matrix vector multiplication so i have a matrix sitting over here and over here and a vector sitting over here and i'm multiplying the vector from the right hand side to the matrix and this generates this transformation that's different here in the first example the first example we don't have a rotation times a vector we have a vector plus a vector so this is a sum and these are matrix multiplications and this is a different thing different of mathematical operations and these different mathematical operations are not that nice because if you want to for example combine multiple transformations it's not that we can easily express this with operations of the same kind and can combine them no we have to separate the matrix multiplication and the summation in all the individual transformations so there's no single operation to describe a transformation in the euclidean space that unifies the sum operation that i have here for the translation and the matrix multiplication for example for scaling or for a computing rotation as it's shown here on this slide and this is something which is can make mathematical operations you write them down by hand on a piece of paper actually quite complex because you have concatenated transformations and you can't combine for example multiple operations into a single transformation that easily so um and this will actually lead to the fact that we will also look into alternative representation of the euclidean space so in the next lecture we will look into homogeneous coordinates which does some trick by let's say adding a new dimension so that all the operations can actually be expressed as matrix multiplications but we can only achieve this by adding an additional dimension to um the vector so the two-dimensional vectors become three-dimensional everything which is three-dimensional becomes four-dimensional and so on and so forth there's something we are not going to investigate today but in the next lecture which has some advantages that operations can be shown in a more elegant and nicer way but in our euclidean space um we have different types of transformation so we have we have a transformation what we typically do we scale our point and then we perform the rotation and then we form the translation and this means we execute them one after the other so written down here we first scale our point then we perform our rotation and the last part is the sub computing the sum by adding the translation vector after we have scaled and rotated our point and this is how we do this in the euclidean space and this again these are two different operations that we're doing we are performing this matrix multiplication over here um actually this scalar could also be sitting over here in this in this matrix and the main main elements that would be the same and then we have the sum so it's adding something and performing a matrix multiplication two different operations that we are actually executing here and the important thing is that rotation and translation are not commutative that's something important to note um because it's a difference if i first rotate a point and then perform a shift or if i first perform a shift and then perform a rotation that is different you can actually see this if you just kind of write down what that means so if i first rotate a point and then shift it then i would have the vector multiplied with a matrix this is the first operation i'm executing and then i'm translating this point so the rotation doesn't has any effect on the shift if i ever first do the translation and then do the rotation i add the shift first and then apply the matrix multiplication so the rotation impacts also on the on the translation vector so it's not the same result so you have to be careful what you execute after each other and therefore it's important to know your order so also if we are in the kind of 3d world and we perform rotations also the rotations are not commutative so it means it makes a difference if you first perform rotation 1 and then a rotation two or if you first do two and one um if you're in three-dimensional world this actually make a difference and the resulting why this is the case because the um the matrix multiplication is not a cumulative operation mathematically so it's not guaranteed to provide the same result in general will not so the standard operation consisting of rotations scale changes and translations is our so-called similarity transforms or is a similarity transform and this is a very commonly used transformation which you find in a lot of operations and it has 40 degrees of freedom in the 2d world and 70 degrees of freedom in the 3d world so why 40 degrees of freedom in 2d because we have one degree of freedom for the scale change assuming i'm performing the same scale equation x and y one degree of freedom for the rotation this is the rotation angle in 2d we only have one rotation axis around which we can rotate so we don't need to specify the axis it's automatically given and the only degree of freedom that we have is the orientation at the angle so by how much we are actually going to rotate and that's something that will change we will change in 3d later on and then we have a translation vector so we can shift in the x direction and we can shift in the y direction and this is again 2 degree of freedom so in sum we have a four degree of freedom operation so we have four parameters that we need to specify and these are the parameters um uh my angle phi that i have my lambda t x and t y these are my four degrees of freedom that describe my similarity transform into d again i said in 3d we have seven degrees of freedom scale change is again still a one degree of freedom operation rotations now we have three rotation angles so we can rotate around the x-axis we can rotate around the y-axis we can rotate around the z-axis we have our three x's specified and can express this as three angles for example around um the so these these three specified x's x y and z axes this is one way for representing rotations there are other ways but we'll come to that later today and then we have a translation which is a three degree of freedom vector a shift in x shift and y shift and z so that in sum we have seven degrees of freedom so one degree of freedom is here this matrix contains a rotation matrix which contains three degrees of freedom in 3d world and we have d x t y t z again three degree of freedom so we have one plus three plus three gives us gives us gives us seven degrees of freedom and that's the very common transformation that we can execute it's not the most general form of things we have other transformations that we execute for example in a fine transformation or a projective transformation these are transformations which have more degrees of freedom to different types of manipulations but here for the purpose of today of this lecture the similarity transform is the thing that we look into as a maximum so scale change rotation and translation other transformations are of course possible but then are more complex to express over here okay the next thing i want to look into is actually how to represent this rotation so far we talked about the position of a point which in the euclidean space is just a vector taking on the x y and z coordinate so it's very easy very straightforward rotations are somewhat more tricky and there are different ways how we can actually represent rotations and there's no best solution so to say there are always different types of representations and they all have their advantages and their disadvantages so certain things i can do very well and other things i can't do that well or at some point in time they may have nice mathematical properties so very good to use and optimization approaches for example but are not human readable and for me as a human very hard to interpret or i have others which are very easy for a human to interpret but which have other problems such as singularities or we have representations which are over parameterized like a rotation matrix which three by three matrix has nine possible values that it can take that it that we need to specify so nine degrees of freedom um but actually a rotation uh in 3d is only specified by three parameters so rotating our x-axis y-axis and z-axis so we have nine values but only three degrees of freedom so we have a lot of constraints maybe six constraints that are involved in there which is not a problem in if i just want to execute that but if i perform state estimation many to estimate the rotation parameters this become can become disadvantages and so all the different representations that are out there are have their advantages and disadvantages and one of the goals of the lecture today is to understand what are advantages and disadvantages of certain representations i will go through this representations in a rather briefly manner so we'll just look into the different ways how we can represent a rotation just very briefly a lot of things you should have known already from your previous studies and if you kind of struggle with something it's a good point to go deeper and read more about the different ways for example for representing rotations um before you continue um so see kind of as a small refresher today and i try to highlight what advantages and disadvantages of the different ways for representing rotations actually are and we want to start with the most common form of a rotation representing rotation which is the rotation matrix so in a rotation matrix i express as a name says the rotation by a matrix and i'm executing the rotation on a geometric object for example in a point by multiplying the point to the matrix from the right hand side so if i have my input x and my rotation is expressed in this rotation matrix r i multiply r from the right hand side to this matrix the point x to the right hand side of this rotation matrix r and this gives me x prime and in 3d this is a three by three matrix we can of course um perform this operation not only in 3d we can use 2d 45d nd so that rotation can more abstractly be specified as a mapping from rn to rn so we're staying the same space i can x i can specify them with the rotation matrix with the following constraints that the determinant of this matrix equals to 1 that means we don't have a scale change involved in here and that the inverse of the rotation is actually the transpose of the matrix itself so if you kind of flip the matrix on the main diagonal that the transpose this actually inverts the rotation kind of undoes the rotation that we have executed so the key properties in here is rotations do not change the scale and the rotations have a fixed point which is kind of the rotation center that we have in here and something that results from this expression over here and so how does a rotation matrix look like we have seen rotation matrix in 2d i showed them in the beginning already when we had this first small example where i rotate a point it's a two by two matrix and has one degree of freedom and this is my rotation angle and always consists of cosine sine and minus sign over here so with these four elements in the rotation of the 2d plane around the origin by the specified rotation angle okay so if we are in the 2d world we have an x and y um coordinate system then we are basically rotating around the uh the z axis the virtual set x that access which will exist i'm rotating the whole plane around this angle okay so how does it now look if you want to move to 3d can we express this form of rotation from 2d in 3d yes of course we can by saying everything the z coordinates of the vectors simply don't change just change x and y in the same way but don't change the z-coordinate of a point because this is what this what would happen if you just add a new dimension of that dimension to it and this can be expressed with this rotation matrix that you see down here so you can see this is again our rotation matrix we know from 2d and now we added this third dimension but in the third dimension we don't do anything so we just have zero elements over here and then one over here so all the z coordinates of the points will not be affected by this operation so this is a rotation in 3d around the z-axis and we can very similarly specify the same thing for the x and y-axis as well if you want to rotate around the other x's if you want to rotate around the other axis like x y or z that was the same just the part where we don't change anything shifts in this matrix so then the rotation matrix sits down here and those elements are zero or if it's a z-coordinate then those elements must be zeros and ones so that the y-coordinate would not be affected by this rotation so these are the ways we can specify a rotation around the x-axis rotation around the y-axis and the rotation around the z-axis and these are kind of the three basic rotation matrices that as we'll see later on we can combine with each other by just multiplying them which means we first perform rotation for example around the z-axis then around the y-axis then around the x-axis and by combining those different rotations we can actually generate arbitrary rotations even if your rotation axis is not the x-axis y-axis or z-axis and this can simply be achieved by multiplying those matrices just multiplying those matrices with each other and basically generating a new rotation which is generated by chaining the individual rotations and just they need to multiply it with one point this something which results directly from the fact that i can express those rotations as matrices and simply can multiply those matrices and obtain a matrix with the same dimension as before rotation matrices as we said before are one way for specifying this and for performing this in the 3d world we have a three by three matrix because remember we said before it's a mapping from our n to our n if we're in the three dimensional world it's from r3 to r3 so we have a three by three matrix so a square matrix with nine elements and those elements are r11 until r33 and i can write them down as these nine numbers into matrix form i can also interpret those nine numbers in different ways i can interpret them as three column vectors arranged in a row back door or three row vectors arranged in a column vector so that in this example for example c1 would be r12 r21 r 3 1 and c 2 would be r 1 2 r 2 2 and r 3 2 and the same for the 3. or our 1 transpose would be r12 r11 r12 r13 and so these are two ways how can also interpret that and then we can use those vectors to define the constraints and these are the constraints resulting from the fact that the determinant of this matrix must be one and that the inverse is equal to the transposed and this results in the fact that the um the column vectors must be all of length one so unit length and um the that they are orthogonal on top of each other and if they are orthogonal that means the dot product is zero or expressed as c1 transposed c2 must be zero c2 transpose c3 must be zero and c3 transposed to c 1 must be 0. so this means that those column vectors are orthogonal on top of each other and these are six constraints and all of those constraints reduce the degree of freedom by one so we have nine values over here six constraints which leaves me with three degrees of freedom that this matrix has and that's exactly what we have in here in general three by three matrix has nine degrees of freedom we have six independent constraints all of those constraints or every of those constraints sorry reduces the degree of freedom by one so three degrees of freedom remain and these are three rotations uh rotation angles for example a rotation around the z axis a rotation around the y-axis and the rotation around the z-axis this is one way how i can specify this and fill those three degrees of freedom and a few words about this column and row vectors which may be useful so the column vectors so these were these c1 c2 c3 are the images of the unit vectors after the rotation so what does that mean the unit vector are the vectors of length one along the coordinate axis so e one the unit vector e one is a one looking along the x-axis so having the coordinates one zero zero and e two has zero one zero because it looks along the along the y axis and c 3 would be 0 0 1 looks along the z axis so if i want to execute the rotation in e1 for example multiply with the rotation matrix that means nothing else than having the vector 1 0 0 multiplied with this matrix over here so this means the zeros in here will cancel out all the terms related to c 2 and c 3 and only c 1 will survive so the result will be c1 so if i take the unit vector along the x-axis multiplied with the rotation matrix what remains is the first column of my rotation matrix gives me c1 and the same holds for c2 and c3 so the unit vectors will be mapped into the column vectors of the rotation matrix as a result of the rotation also the row vectors can be interpreted in a similar way the row vectors are those vectors which by executing the rotation will be rotated into the unit vectors so if i um take my rotation and i multiply a row vector with it i will actually get the corresponding unit vector out of this so basically exactly the the other way around and this is and this is something which we can exploit in certain context when we use the unit vectors for example and turn them into the column vectors of those matrices and there's something that's it's often good to see because it also gives you a visual understanding of that matrix at least to some degree and it's hard to interpret a rotation matrix really completely but by looking into the column vectors you get an idea where the unit vectors of the coordinate systems are actually mapped to for so in this say it can help you to get some geometric understanding of what this matrix actually means but besides of this it's actually not trivial to interpret a rotation matrix just when you see it unless it's a rotation around one of those x's that you know how the matrix looks like so to sum up what we know about the rotation matrices so rotation matrix is a 3d matrix or in our case 3d matrix in general rotation matrix of course could be could also exist in higher dimensional spaces and it's a 3x3 matrix and has the two properties one is that it the determinant is one and that the inverse equals to the trunk to its transposed and it's an over parameterized representation what does overparameterized mean over parametrized means we have more numbers to fill than 3d degrees of freedom so we said we have three degrees of freedom three rotation angles but we have nine values to fill so we have more values to fill than we have um actually values that we that we need and this can be suboptimal in state estimation problems because this will give me nine parameters and three cons and six constraints so if i ignore the constraints or just do my parameter estimation and estimating them as three degree three degrees of freedom i probably will get a matrix out which is similar to rotation matrix but i can't guarantee that those constraints are actually enforced so that the determinant is actually one and that the inverse is exactly the same in the transformation matrix so i'm most likely violating those constraints and this can be clearly sub-optimal in state estimation problems so either i treat them especially in the state estimation to enforce those constraints or i will probably leave the space of valid solutions and will come up with a matrix which is not exactly a rotation matrix and this can be problematic however a big advantage is is that i can very easily compose different rotations so if i have 10 rotations to execute i can just multiply those matrices the matrix multiplication results in a single new matrix and again three by three matrix and all the rotations are encoded in this matrix which is very very nice and very elegant especially if you write things down and what is also a great plus for rotation matrices is that they are very commonly used exchange format because they don't have any ambiguity in there that means rotation matrix tells you exactly what to do you multiplied with a vector and you get a new vector out that executed that rotation you don't need to specify in along which dimensions m i'm looking to how are the rotation angles defined all this you don't care because you don't need to the matrix vector multiplication gives you the result that you want and this is great because there are a lot of different representations where there is ambiguity on or different ways how we can define them and consider that you're developing one software component which should work with the rotations that you get in and someone else computed it you always need to make sure you're using exactly the same conventions so that your rotations are compatible and rotation matrices solve for this problem if you just communicate through rotation matrices you don't suffer from this issue which is really really great and um using wrong conventions or incompatible conventions not necessarily wrong ones are just different conventions which are incompatible can be a big nightmare when for example developing software systems um and exchange information with other communities or software components that other people have developed this can be really a pain and that's where one thing where rotation matrices are great okay the next things we want to look into are euler angles there's also a very commonly also traditionally used one the reason for it that they are very very easy for us to interpret and the um the rotations expressed by euler angles and say okay we have fixed rotation axes like the x-axis y-axis and z-axis and we are expressing any rotation or as a sequence of three rotations around x y z for example or z y x or y x that or whatever order we have to specify it you come here come the conventions um it's very useful for visualizing things because we as humans can interpret this very well the x-axis goes in this direction so rotation along the x-axis will look like this and this is so a very commonly used techniques for describing the current state of let's say a mobile platform a car moving through the environment we have something like your pitch roll three angles around z y and x axis for example in a similar way submarines as well the only problem is all the communities typically use different conventions and so they will use different axes different orders different directions so they are a zoo of different ways how you can interpret those euler angles and this can be painful the other thing which is a good thing is that the minimal representation in the sense there are three variables involved rotation around x y and z and they are three degrees of freedom so there are no additional constraints that i have in that sense um and so one of those examples so typically the roll rotation is specified around the x-axis which is in most conventions the forward direction so if you're in aerospace or if you're in ground vehicles this is always the same x typically looks forward and then you have the y and the z axis which is the pitch the the sorry the y and the z axis the pitch is typically the rotation around the y axis and the yaw is the rotation around the z axis but that's already it depending on the community you're in you will have different conventions so again in most cases x-axis points forward but again also not always the case in people working with ground vehicles you typically the y-axis goes to the left so x forward and then y to the left and as the result of this the z-axis is pointing upwards if you're in aerospace or working with submarines then typically the x is still forward but then typically the y-axis goes to the right that means the z-axis goes downward so be very very careful about your conventions and even it's not always guaranteed that even it's right-handed so it really depends which community you're in what their conventions are and what they're using satellites may again use different ways for representing these rotations and you have to specify exactly what you're doing if you work with euler angles otherwise it's impossible for other people to understand what you have done what your conventions are and how you're using it so therefore it's a warning it can get messy here okay so let's see how rotation around the x-axis looks like so i have here my coordinate system and i specified x y and that so if i perform a rotation around the x-axis so that means that is my rotation axis all the points lying on that axis will not be changed and it leads to a rotation that the that i'm basically rotating here around the x axis in this way it's my right hand so this is the rotation and as a result of this we will have a new y-axis and a new z-axis later on and the change here is this angle alpha with the corresponding rotation matrix that you see over here so the x-axis stays unchanged so just one zero zero one zero zero over here and the rotation matrix sits in here so um the x-coordinate of a point stays the same um its y-coordinate changes in z-coordinate changes and this depends on the sign and the cosine and the other two coordinates in this case y and that which are involved in here and this is a rotation around the first the x-axis alpha and zero zero for the other two and we can specify the three rotation matrices related to those other angles so r1 r2 r3 or our x our y our z are those matrices that i can specify and then use them to express what does it mean to rotate around whatever the first axis by five degrees okay first axis five degrees we need to compute sine and cosine of five degrees and put them in here and that would be then or rotation around the x-axis for example you can also visualize this very similar as i've done before so this was one i've showed before when you rotate around x when you rotate around y the y-axis stays the same the x-axis changes and the z-axis changes and if you rotate around z then that stays the same and the x-axis and the y-axis changes because we are basically rotating and then r in a different coordinate system okay so what we can do what is nice because we can express this again as rotation matrices in the way we did we can combine those rotation matrix the rotations via rotation matrices and i can see this here i can different ways how i can specify this so i can say i can define a rotation as first retained rod the first axis and the second then the third one or say third one then second one then first or um transpose one so there are different ways how i can specify this and this is one of the things we need to specify in which order we should execute something and the order matters because the order is different and just by providing three rotation angles just 10 degrees 20 degrees 5 degrees it doesn't tell you about which axis we are talking about and how the rotation looks like exactly and just to show you an example that the order makes a difference we have here two common representations so first rotation around x and around y then around that or first around that then y then x the rotation matrices look different if you just expand it so this is how the rotation matrix looks like for this uh for these three rotations and they look different that means they are not identical so the order matters so your pitch roll or roll pitch yaw will make a difference in the final result so you need to make sure you always specify how your convention looks like so how does it look like how can we go from rotation matrices to euler angles or from euler angles to rotation matrices so given we have a rotation matrix because i said before it can be used as an exchange format we can actually compute the three rotation angles but for that we need to know the convention that we are talking about i most of the time use um your pitch roll but again it depends on the community you're in so you need to know the axis and the the order of your rotation uh the order of your rotation and um also the assumption here that there's no uh we're not in a situation where there's a singularity in the euler angle representation um and that exists as we will explore in a second okay so let's say we have this uh this form in this example it's our x our first rotation around x and rotation around y then rotation around that so we have this coordinate system over here so in the case that beta cosine beta is unequal to zero that means beta was sec and that means that the second rotation is not plus or minus 90 degrees so for the first case if this is the case then we can actually go back from the rotation matrix to alpha x computing alpha beta gamma with this expression over here again something it's not derived in here but if you need the computation you can actually look it up and use it and you do need to do some mathematic exercise to turn come from here to here um it's definitely possible but for the purpose of this lecture um this is the equation that you can use if you need to convert your rotation matrix matrix into um into into euler angles okay if my second rotation is um so if you're in the situation that beta equals to zero this is one of those singularities which i can end up let's see what happens if b cosine beta equals to zero so if cosine beta equals to zero a lot of those terms here go to zero this goes to zero this goes to zero this goes to zero this goes to zero and i get this simplified matrix i can still combine them and what i see in here is i have these three terms involving sine minus sine and cosine but in the argument is always the same the argument is a subtraction of two rotation angles so it's the third rotation angle minus the first rotation angle and that's the problem because it means i cannot specify gamma or alpha explicitly i only can say something about the difference of gamma and alpha so i can't determine the parameters and we can actually see this intuitively quite well because what it basically means is um the the singularity if the second rotation is a 90 degree rotation it basically means that the first rotation axis and the third rotation axis after having executed the second one is actually a rotation around the same axis so whatever i do in the first rotation i can undo in the third rotation and so as a final result i cannot say the first rotation was whatever 30 degrees and the second one was minus 10 degrees i only know that the first and the second combined resulted in a rotation of 20 degrees so the the the difference between those and that is something which leads to this so-called gimbal lock or singularity situation that if the second rotation is a 90 degree rotation um i cannot recover the first and the third rotation only the difference in magnitude between them the other problem i have with this rotation angles that have a discontinuity if i have you can it's a classical wraparound problem so a rotation of 2 pi equals a to rotation of zero if you know this this is if you do your computations by hand it's not that problematic if you are running any state state estimation algorithm that doesn't explicitly know that you're working with rotation angles for example um and especially handled these situations this can be problematic for example if you compute jacobians because it can be the case that you have two values 2 pi and 0 which is exactly the same thing but the the gradient looks huge because they have a because there's a valid difference between 0 and 2 pi if you just look to the numerical values without interpreting as a rotation and this can lead to problems in state estimation problems basically jumps into in parameters and that's problematic and the other thing which is problematic in here again i said before which conventions are using three two one one two three are probably the two most commonly used ones but again there are many others and also depending on the community you will even have the angles being defined in the the axis being defined in different ways so to sum up um euler angles are again a common representation they have three values and this is three rotation angles what is fixed are the rotation axis according to some convention that you need to specify otherwise they are rather useless um they're quite useful for visualizing rotation so we as humans have a good way for interpreting what we actually see it's a minimal representation in the sense that we there's no additional constraints involved um so if we have three parameters we have three rotations that's exactly what we want to estimate it's not that we have nine values but need only three as we had it for the rotation axis however there are singularities and discontinuities and we cannot directly compose rotations so we cannot just multiply them or add them up as we are able with the multiplication in the case of rotation matrices so we need to turn them into rotation matrices multiply them and then convert them back into either angles for example and this is kind of sub-optimal and also it's not the greatest tool for state estimation problems given this this above-mentioned problem so you need to handle those cases separately there nevertheless it's a commonly used technique especially um traditional literature you find a lot of people using euler angles and for visualization is nice so what you often do internally you don't use them but for visualizing the results you often turn them into um into euler angles because it's quite nice to or easy way for us humans to interpret what we see on the screen if you look into that the next part is the axis angle representation and this exploits the fact that instead of executing three rotations one around the z axis one around the y-axis and one around the x-axis that we can express this as a single rotation around a free-to-define axis so instead of executing three rotations one after the other we can just do it with one rotation and among along different axes and this becomes clear if you think that you have three rotation matrices you can multiply those rotation matrices and again have a single rotation out of that and so there we can express this as an angle around as x's to specify and this is the result of the um euler theory so the axis angle representation what it actually does it specifies a free rotation axis and the magnitude of this rotation just express this as a single rotation okay and so what we can do is we simply store the rotation axis and our angle okay great so in general these are four parameters three for the rotation axis and 1 for the magnitude and i said 4 shouldn't that be 3 yes this is the case the axis the magnitude of the axis doesn't matter so what we typically do we introduce an additional constraint that the magnitude of the rotation axis is actually one and then we have four minus one degree of freedom and again have an over parametrized form so not a minimal representation because we have four numbers to fill four parameters to fill but only three degrees of freedom that are involved in here um we should note that kind of this is this is standard form it's kind of the axis angle representation so r is the axis and theta is here the the magnitude of the rotation and have the constraint that r is of length one an alternative way to go down towards this kind of minimal representation is um to say i keep my rotation axis r1 r2 r3 but it's normalized in a way that the magnitude of the rotation is actually the um the length of the vector corresponds to the angle the magnitude of the rotation so a longer vector means a lot a rotation around a larger angle and a smaller length of the vector is a smaller rotation and then i have only three parameters right so then i come towards a minimal representation that i have because i have three values and these three values define me all that i need to specify axes for the direction as well as the magnitude of that and these are kind of also called sometimes normalized axis angle representation because it's normalized to the magnitude of that rotation okay from axis angle rotation into a rotation matrix so kind of the two steps always looking how i can convert or a representation that i have into a rotation matrix and the other way around and what you do this by the so-called rodriguez formula which gives you the rotation matrix as uh with around this axis with this magnitude which is specified over here and this s is a screw symmetric matrix which is defined as this matrix over here containing three elements a screw symmetric matrix is a matrix that is identical to its negative transposed so transpose and multiply minus one gives you the original matrix and um this screw symmetric matrix encodes the um the rotation axis and with this form specified over here you can turn the axis angle representation into a rotation matrix if you use the normalized variant of this so where the magnitude of the of the rotation is encoded in the length of the vector and this is then you have this formula over here which is similar to this form but you have this additional normalization in here and so this bolt theta is the original theta times the uh the rotation axis so that the length of the vector is equal to the magnitude of that rotation and this is the way how you go from the axis angle representation into the rotation matrix representation we can also go the other way around from a rotation matrix into an axis angle representation and you can here obtain it in this form over here so the magnitude of rotation is the a tan 2 of a vector a which is given over here which takes different values out of your rotation matrix and the second part the magnitude is the trace of your rotation matrix -1 which is specified down here which is basically the sum of the of the main diagonal elements and in this way you are able to recover the the rotation value what we need to look into if we need to take into account if we do this is that we have a singularity for a zero rotation so if we have a zero rotation the axis doesn't matter right so if my rotation matrix is the identity then it's not clearly specified how the access angular representation looks like another problem that we have may have is if the magnitude of rotation is pi so a 180 degree rotation because you can see if let's say this is your rotation axis over here uh and you rotate 180 degrees in this direction or 180 degrees in the other direction you will actually get the same result that you could also get in so it's equivalent to flipping the um flipping the rotation axis so if you if you have a 100 degree rotation uh sorry a 100 degree rotation yes you can actually flip your axis and let your rotation axis point in the other direction you would actually get the same result or otherwise if not the case then you obtain r as a this vector a divided by the magnitude of a which then would be the normalized rotation matrix so in this way you go from the rotation matrix to the excess angular representation but you need to be able need to make sure you cover those two cases so to handle them separately if your if your rotation match is the identity matrix or you have 180 degree rotation in some involved in here so to sum up the axis angle representation is something which is it's also a minimal representation if it's normalized or closed or four it's quite easy to visualize by providing one rotation axis and the magnitude of the rotation um therefore it's it's volume and readable it however has this singularity where the magnitude of rotation is zero so it's actually a rather common case it needs to be handled separately because then the rotation matrix the the rotation axis doesn't matter whatever rotation axis you specify um as long as theta is zero it will give you a zero rotation you also have rotation limits in terms of between pi and minus pi you need to take into account and as before you can't directly compose the rotations with each other if you have two rotations you want to compose them or chain them you have to go back for example to the rotation matrix representation chain them and convert them back it's the same that we had for the euler angles there is no direct way for chaining both of them in an elegant fashion and therefore we often have to go back to the axis angle to the rotation matrix representation if we are dealing if we are working otherwise in the axis angle representation and so now we are coming to the last part of the chapter on representing rotations which looks into quaternions which is another form on how we can represent rotations and it's a very popular form especially in the context of state estimation problems or optimization problems because this quaternion representation has attractive properties which are especially important if we perform state estimation so the quaternions are an alternative way for modeling rotations it was kind of the idea when it was brought up for the first time by willian hamilton in 1848 but in general it is a four dimensional structure consisting of one real part and three imaginary dimensions and um so that is something that allows us to represent the rotations in a very attractive way and the quaternions if we use quaternions in a certain way um so we set up a quaternion um in a special way then they are representing rotations and we can actually use them for manipulating them representing them and using them especially in state estimation algorithms the main downside of the quaternions are that they are not only partially human readable so you can interpret this 4-d vector in some way that is possible um but um especially the manipulations that we do with plutonians are let's say not fully intuitive to most of us um if you're working with cartoonists for a long time you get used to that but they look a little bit confusing at least on the first few times you actually see them but if you use them inside a computer and you have everything in a software system nicely boxed they are a very attractive way for representing um orientations because it's an attractive way for the internal state estimation algorithm so if you use your mobile phone um and you are and your mobile phone estimates whatever how the um how you hold your device it internally for example uses fraternians for representing those rotations and a lot of technical systems that we see today also rely on quaternions again has been discovered and published by hamilton in 1848 although there have been other people doing that earlier rodriguez a few years earlier in 1814 and even gauss had discovered quaternions already in 1819 although this article was only published in 1900 so therefore the credit in public goes to hamilton for that and if you are in dublin you can even see this stone on one of the bridges in dublin where hamilton was going to a meeting of the royal academy of science and while being on that bridge got that idea and actually sat down and carved his findings into the bridge of these three imaginary or complex numbers that he used to represent the the rotations so that he doesn't forget about it and so it's still uh there that you can go there and see where he made this discovery okay so let's have a look on what the property of those quaternions are we can use quaternions as a representation of rotations and the only four parameter representations that has the following properties first it's a unique representation the only exception is the sign so it's defined basically up to us up to the sign it has no singularities and no discontinuities and so given that we have this unique property there is kind of an almost minimal representation that we are using here and the especially the attractive thing is that without singularities and without discontinuities this is something which is attractive for state estimation algorithms like whatever a kalman filter or the squares approach but tries to estimate the rotations of a mobile system for example if you don't suffer from discontinuities or singularities that's something that is attractive for state estimation and one of the reasons why quaternions are so popular today and in these techniques okay let's see how we define a quatrain differentiating the quaternion per se is basically a four-dimensional vector so we can see it as vector being split up into um two parts this is a one-dimensional part and a three-dimensional part which adds up basically a vector of four dimensions so in your computer you need to store four numbers and we can interpret them as a 1d real number this is the first element the q over here and a three-dimensional complex part and so this q over here considering here being written as q one q two q three are the coefficients of these imaginary parts and you know from the complex numbers in 2d you may have seen at school you have this imaginary unit i the differences here we have three typically called i j and k so we can write this quaternion q as uh the real part plus q one this coefficient times the unit i q 2 times j plus q 3 times k and these are the imaginary units which have the following properties you know the unit i square equals -1 that's something that you probably know from your math at school the difference is now we have three of those um units now and with the three units plus the real part we are actually able to encode rotation axis and the magnitude of the rotation in an attractive way so that these quaternions allow us to model rotations we can also see it simply as a tuple this 4d vector so with two parts a 1d part and a 3d part that follows a certain algebra so there are certain rules for addition multiplication inversions but in the end these fraternities form an algebra that we can do manipulations in and if we set up a quaternion if we define those one of those quaternions in a special way then they actually represent the rotations and this is the way we are going to use this so first let's discuss very briefly the basic rules and then how we can use this in order to find rotations so we can add up two patronians so if you have a quaternion q and a quaternion r and we want to add them up then q plus r gives me new quaternion p and you can see it here that we simply need to add the individual values so we can add up all the dimensions so this is the um real part and the imaginary parts we just add them up so that's very easy just that a vector a vector sum as we know how to use it so that's easy more difficult or more let's say counter intuitive is the multiplication so the multiplication is defined in the way as it's shown here and it's basically a combination of multiplications of scalar numbers of dot products and cross products so we have multiplication of two scalars multiplication of a scalar and a vector scalar and a vector we have the dot product over here and we have the cross product over here and um so this is something which actually makes it for for a lot of people counter intuitive but it's just a way how we can define the multiplication of two quaternions and as we'll see later on if we use this form of multiplication then we end up having attractive properties that allows us to represent rotations with those quaternions so it's important to note that the execution of rotation is not commutative it's something that we had seen already with our rotation matrices that it makes a difference if i have a rotation matrix r1 and multiplied with r2 or if i have r2 and multiplied with r1 so something that multiplication is typically commutative in the real numbers as as you know it from from school but it is not in the context of matrix multiplication and it is not the case here for the quaternion and the reason for this is this cross product term over here because the cross product is not commutative and it's important that we have that the property because uh executing rotations is not commutative we also have something which is called a unit quaternion which is a quaternion which is normalized to uh to one okay so uh we have to talk about the inverse as well so the inverse of a quaternion can be computed so the inverse element and so the inverse element of a quaternion q is the so-called conjugate quaternion which is the original quaternion just that the complex part imaginary part changed its sign and then we have the normalization term in here so that this thing is in the end normalized so this gives me the inverse of a quadrant and now giving these rules for summing quaternions multiplying them and computing the inverse we can actually define rotations within quaternions so how is this done and this is probably the most important slide in here so we can use quaternions to model rotations if we set them up in a certain way so the real part gets the cosine of the magnitude of the rotation that we want to execute it divided by 2 so angle divided by 2 and the cosine of it this is my my real part and the imaginary part consists of the normalized rotation axis so this is this r this is the rotation axis with length one so in the same way as we know it from the axis angle representation where we normalize um at least in the 40 description the length of the rotation axis to 1 same happens here and this creates my imaginary part except that is also multiplied with the sine of half of the rotation that we want to execute and if we design a quaternion like this so we fill it with those numbers then they represent rotation and we can actually execute rotations and rotate points that also need to be set up in a special way so just as an example let's say we have a certain rotation axis that we want to define and we want to execute a rotation around a certain magnitude how do we do this so a very concrete example so we have a rotation angle let's say 30 degrees around the rotation axis which is here given by 0.6 0.8 and 0. so these are my the magnitudes of or defines the for example x y and that coordinate system and this is the the defines my rotation axis so again how did the equation look like this is how our quaternion should look like so the first part would be cosine of the angle divided by 2 and the vector part is the sine of the angle divided by 2 times the rotation axis so in this example this would lead to the quaternion in the following form so we want to rotate by 30 degrees so we divide the angle by 2 which gives me 15 degrees in here so we have cosine of 15 degrees here sine of 15 degrees and then multiplied with the vector and this vector is already normalized to length one so i don't need to do a normalization in here or if i write it as a tuple i would use the following form over here or if i write it the quaternion as a complex number with these units i j and k i would write it down in the way it is written down here and this is all equivalent just kind of different ways how we can store them in your computer you would store those simply four dimension as four separate numbers and then would fill them with cosine angle divided by two sine of the angle divided by two times the first dimension of the rotation axis second and third dimension of the rotation axis okay so this then this quaternion that we set up in this way so this quaternion queue will encode a rotation to be executed with respect to a point um and so just to mention this is something the way the quaternion stores the data is actually kind of related to the excess angular representation remember in the axis angle representation we just stored the um the magnitude of the rotation as a single scalar value and we also store the rotation axis with length one so the rotation axis sits in here but instead of storing the um the magnitude of the rotation we draw we just store the sine and the cosine of half of the rotation why half of the rotation that might look a little bit counter-intuitive we'll see that in a second if we execute a rotation we actually need to multiply the quaternions we use the quaternion basically twice the quaternion and the inverse quaternion that we need for the multiplication therefore we use it twice and basically need to um divide the magnitude by by half because we've used two of them um so we can see that the excess angle representation the quaternion actually not too dissimilar in the way of what we store so we were to restore the same rotation axis and just once kind of a sine and a cosine instead of the angle itself but as you remember for example the axis angle representation had no way for chaining a sequence of rotations we always had to go back for example into the um into rotation matrices and execute this chaining in the space of rotation matrices and then convert back the quaternion do that differently by the rules that we have defined for adding up values or multiplying values and computing the inverse we are actually able to um do all the operations in this quaternion space we don't need to convert it back into rotation matrices for example in order to chain um two rotations in an elegant way okay so now do how do we execute a rotation okay we perform or we execute a rotation with respect to a point in the following way so p encodes the point that i want to transform so my 3d point in space q represents the rotation so q is exactly set up in the way we just described it on the two slides before and p stores the 3d point and it does this in a way that we set the real part of the quaternion to zero and store in the imaginary part the x y and z coordinate of my of my point okay so it's very easy to set up and then if i take this quaternion p and multiply from the left hand side q and from the right hand side q inverse then this will lead to a point p prime which is the point p rotated around the rotation represented by q okay so let's make it again an example so we have a point p so what we do we first build up the point in this quaternion space by saying the quaternion p is the first dimension is zero and the other three dimensions are exactly the x y as that coordinate of my point done then i define the rotation that i want to execute in form of q if that in the form that i put cosine the angle divided by 2 sine of the angle divided by 2 plus the rotation the rotation axis in here okay and then i have set up everything that i want and then i can execute my rotation through this left right multiplication that i've executed here and the inverse i can of course also compute easily through this conjugate quaternion and the appropriate normalization okay so that's it that's how we execute the rotation and we'll get a new point p and in the p prime sorry p prime over here and in this uh p prime we have then stored the um the three coordinates of the rotated point and we have rotated our point and we can also use these quaternions to compose multiple quaternions that represent rotations so we can set up two quaternions let's say one rotation of 30 degree around the x-axis and the second rotation of 20 degrees around an undefined axis okay now the question is can we combine those two and execute just one rotation which is a concatenation of those two rotations and yes we can actually do this by multiplying those two rotations so if we multiply those into quaternions then we actually get um we can we can chain those so we can actually see how that works the composition is easily multiplying the two and we can actually just see how the hover works it's very easy so we have our point p that we want to transform and we first want to execute the rotation q prime and rotate p with the rotation starting q prime so that we get p prime right this is the first execu rotation that we execute then we want to take this result and rotate it again with the second rotation the second rotation is q double prime so p prime goes in here we multiply q double prime and q double prime inverse from the left and right hand side which gives me my resulting point p double prime which is the point executing first rotation q prime and then the rotation q double prime so we just take this expression and move it in here so this is the outer part this is the inner part so i actually get this expression over here and what i then can do is i can just regroup those quaternions so i take the first two elements and group them together like shown here with the bracket and the second two and there you can see they are the identical ones just one is the inverse of the other okay so we can group them as q and q inverse so that we have a new rotation q p q inverse so that q is a combination of the two rotations and so that's very easily done so soft if you want to execute a rotation q that consists of two um individual rotations representing squadronians we just need to multiply those two quaternions and then get a new new rotation out and then can execute a single rotation that is a new rotation around this point and this is exactly the same way as we have done it for rotation matrices so this form would be equivalent to this form over here of um multiplying one rotation matrix around with the other and so that's very straightforward so we can easily compose rotations in this particular with these quaternions and this is one of the attracting attractive properties that the other representations we talked about before so euler angles or euler angles or angle axis representation miss and only the rotation matrix could offer but here we even have one of those representations which has all the other attractive properties used in state estimation for example the thing with the over parameterization that we really suffer from with this nine dimensions in the rotation matrix matrices we don't have here in this quaternions and we can convert the quaternion forth and back into rotation matrix in a straightforward way so if we look to the how to turn a unit quaternion into a rotation matrix we have the equation sitting over here this gives the rotation matrix and even the way back is directly possible so these are the elements and you can see that certain things look similar to the excess angle representation we also have the thing with a trace in here if you remember that slightly different equations but this shows kind of the similarity between those two but again if you think about the axis angle representation we have these four cases we would need to take into account to circumvent certain problems in the representation this is something that we do not have here in this quaternion space so with these equations you can convert forth and back between the rotation matrix and a quaternion in both ways before coming to an end i would like to point you out to in my point of view outstanding youtube video that you can find out there has nothing to do with me as done by this great channel three blue one brown which has instructional videos with outstanding animations and they are super illustrative so you can really see how that works and i just strongly recommend you to actually watch this video which gives you an idea on how the what these complex units are and how we can set up this rotation it only deals with basically how to rotate a point uh using these quaternions um but it's a it's a really great illustration and uh the person from this channel has teamed up with another colleague providing in kind of interactive tutorial so it's in it's a tutorial way you can actually define your quaternions and with your mouse actually drag around rotations and change those values and you can see directly live to which kind of rotations this actually leads to um this is something which is much better than anything i could produce here so i encourage you with this website um over here ether.net quaternions um which provides which links you to this website and there you can actually explore watch the videos and then actually interactively change those and get a better feeling on how these quaternions looks like i found that very useful when trying to understand how those squadronians work so i just can really recommend you take a break from this video we're done with this video anyway in a few minutes and then open this website and explore quaternions on your own it's highly recommended so to summarize the quaternions um they are four parameter parameter representations of um the rotations or can be used to represent rotations it's a unique representation that means if you compare those four numbers and if if the four numbers differ that means it's also different rotation except of the sign so with the sign you can flip the sign um and then you get still the same rotation being executed um there are no singularities no discontinuities like this wraparound problems um that we had seen before or the gimbal lock something that quaternions do not have it furthermore allows to easily compose or chain different rotations just by multiplying the quaternions and then executing your regular rotations you can chain them in a very similar way as we have done this with rotation matrices it also allows you to do interpolations of rotation that's something i haven't talked about here sometimes it's called slurp spherical linear interpolation between this angular space um this is something that is also important for example for animations if you want to create animations and you just have keyframes and want to interpolate in between them that's important but it can also be relevant for certain state estimation optimization problems where you want to interpolate between two values in the space of rotations and quaternions allow you to do that again in an elegant way so quaternions in some are an attractive way for handling rotation especially inside technical systems you will often find quaternions and quaternions are typically the standard choice for that um it's even partially human readable if you have an idea on how to interpret those four dimensions not as good as the excess angular representation because you don't uh represent the magnitude of rotation on the sine and cosine and the sine part is even multiplied by the rotation axis so it's not that intuitive um but nevertheless um you can actually make sense out of it at least to some degree uh but it's often seen is confusing for example the multiplication of two quaternions is something um that's hard to wrap your your head or your brain around that and therefore a lot of people when they see quaternions for the first time are not that excited but they're actually a very nice representation for in order to deal for example with your underlying optimization problems and a lot of optimizers for example use not to solve the simultaneous localization mapping problem or running bundle adjustment systems or kalman filters estimating the orientation of a dynamic system rely on quaternions so to sum up the over lecture we have seen that there are different ways for representing rotations so the majority of this lecture just focused on rotations because it's kind of the most tricky part in here and the different representations offer different things to you some of them are very easily readable by humans or very easy to visualize but then they may have discontinuities or or other problems like singularities it can be minimal representations we just need to store the minimum number of rotations or of parameters they need to store for defining a rotation like the three rotation angles or overparameterized systems in the extreme case the rotation matrix which stores nine values bringing advantages and disadvantages into the game some of them are unique otherwise are not unique or only partially unique that you have ambiguities in the system or how easy or difficult it is to compose rotations or is how are the x's defined so these are all things which in which those representation differs and there is no kind of best representation overall which is best kind of scores best in all categories um so for example rotation matrices are a great thing if you want to as an exchange format so if you want to send a rotation to someone else you should use this and you have no idea how that their system works internally what kind of representations they use rotation matrix are often used as an exchange format euler angles and contrast are very good for visualizing results because you can visualize this in your kind of if you have let's say you're an airplane flying around you want to visualize the rotations that you're in so in your body frame you can actually express this as kind of a role or a pitching movement or your movement which is very intuitive for us humans to see and therefore good and used in visualizations state estimation systems and technical systems often rely internally on quaternions because of the attractive properties that i've shown before and axis angle representations also kind of human readable they have a link to quaternions just from the four numbers not as easy to see it but you if you're good to interpret sine values and sine and cosine you may be able to even read it by just looking to the quaternion although that's a little bit more tricky so to sum up the course i presented you kind of popular ways for representing rotations and these are the kind of four basic ways that i think are important to understand especially if you want to build technical systems you need to know what the advantages and disadvantages are in order to make the right design choices and we will use the different representations here a lot if we just write down mathematical terms rotation matrices are often attractive unless you have to expend all of them then of course they're all also complicated but so if you write down derivations i often use rotation matrices if you want to build a system set estimation systems your first choice are most likely quaternions internally and if you just want to visualize something on the screen then the the three euler angles are one way for representing it but then again you have to take care what is the convention and that's something which which can be very annoying so you also have to be very specific on defining the um conventions that you're using and if you exchange or use other software components or exchange something with partners you develop a part of a system your partner or your coworker does another part you need to make sure you're exactly on the same stage in the way you can you need to have your conventions defined and this can be a source of error that is very very hard to debug so there's a warning sign on that side so with this i hope we gave you a good introduction here into the um different ways how you can represent especially rotations next week we'll look into homogeneous coordinates as another way for representing elements or points in space and leave the euclidean world towards this projective space um and then at least for my side from the photogrammetry robotics side you should have learned all the kind of basic things that you need in order to start and then after that my colleagues from the institute will take all over and present their specific needs in this lecture so thank you very much for your attention and i again at that point in time recommend you to visit the website for quaternions and explore the quaternions on your own thank you very much
Info
Channel: Cyrill Stachniss
Views: 5,930
Rating: undefined out of 5
Keywords: robotics, photogrammetry
Id: YXGUGSAv09A
Channel Id: undefined
Length: 86min 57sec (5217 seconds)
Published: Fri Aug 21 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.