‫Welcome back.
‫So how would you write this G in the body frame as a six by one vector?
‫Well, first, you know, the force of gravity equals minus the mass of the drone times G.
‫Right.
‫And it's minus because it points down.
‫Now, you have to be careful here because this force of gravity is in the inertia frame.
‫So even if your drone is tilted like this is the case here where your body frame Z axis does not align
‫with the inertia frame Z axis, then this force of gravity still points down in the negative inertial
‫frame Z axis.
‫But since we work in the body frame, we have to represent the force of gravity in the body frame as
‫well.
‫So this here, this is our inertial frame, and then in red, you have the body frame and then you see
‫the force of gravity goes in the negative inertial frame Z direction.
‫Therefore, if your initial reaction was to write something like this, then I'm afraid it's not quite
‫correct because this is in the body frame, but this would be in the inertia frame.
‫So we have to convert that into the body frame, but we already have the tools to do that, right.
‫We built it in the previous section.
‫It's called rotation matrices.
‫So the force of gravity in the inertia frame equals.
‫And then we had our rotation matrix that had the convention body frame, Z, Y, X, so the oilor angles
‫and then you would multiply that by the force vector.
‫That would be the gravity force vector, but in the body frame and that would be your equation, right?
‫By the way, let me put a lower case G here, because that's how we know that here.
‫But the thing is that we already have our force of gravity in the inertia frame.
‫So what we need is our force of gravity in the body frame.
‫So we really need the opposite equation.
‫So we inverse it.
‫We say that our F g in the body frame equals.
‫The inverse of our rotation matrix times the force of gravity in the inertia frame so you can rewrite
‫our Lambda G in the body frame in this way, lambda G in the body frame equals.
‫Force of gravity vector in the body frame, and then this zero three by one vector for the moments.
‫And now we replace the body from gravity force with this expression here that comes from here.
‫And so the final answer would be like this, this would be your force of gravity in the inertia frame,
‫but then you multiply your inverse rotation matrix by this inertia frame force of gravity.
‫And here you will have three elements then and then here you would have three zeros as well.
‫So if you perform this vector matrix operation, then you will have a three by one force of gravity
‫vector.
‫But then in the body frame, because this would give you the force of gravity in the body frame.
‫This expression here, and this is where I wanted you to stop.
‫So I wanted you to get something like this.
‫However, if you make the real calculations, then you will end up with this kind of expression.
‫You will have many times sine theta here, minus M.G. Times cosine theta times sine phi here as the
‫second element and the third element is minus M times G times cosine theta times cosine phi.
‫So if you multiply together the three year rotation matrices that we had, according to our convention,
‫then this is what you would get.
‫So this answer is when you.
‫Multiply these three matrices together like this in this order, because, first of all, you rotate
‫about the moving from the axis, then moving from y axis and then moving from x axis.
‫And so as a result, your rotation matrix is a product of these three rotation matrices here.
‫And if you multiply them together like this.
‫Well, then you get this as a result, and so if you take the inverse of it, if you want to find this
‫where you have the product of your three matrices and then you take the inverse of it, then you will
‫get the inverse of the rotation matrix, which is simply the transpose of this.
‫Remember the rotation matrices you could get there in versus if you just take their transposes because
‫they are also normal matrices.
‫So this here, this would be the inverse of your rotation matrix.
‫All right.
‫And this would be the force of gravity in the inertial frame.
‫All right.
‫So F g in the inertial frame.
‫And so if you multiply this matrix by this vector, then since these are zeroes here, then the only
‫thing that's going to happen is that in each row, only this column matters here.
‫All right.
‫Because if you take this element, then you have to multiply it by zero.
‫And then if you take this element, you have to multiply it by zero.
‫And the same thing here and here and also here and here you would be multiplying them by zero so they
‫don't matter.
‫However, here you would multiply minus sine theta times, minus M.G. and you would get plus M.G. times
‫sine theta that here you would multiply sine five times cosine theta times minus M.G. and that would
‫be minus M.G. times sine five times cosine theta.
‫And lastly, this element here, you would multiply it by minus M.G. So it would be minus Meji times
‫cosine, five times cosine theta.
‫And so that would be your force of gravity in the body frame.
‫This would be the body frame X direction.
‫This would be the body frame Y direction, and this would be the body frame Z direction.
‫And here I've simply rearranged the multiplication order.
‫So here now it's cosine theta times sine phi and then cosine theta times cosine phi and that's it.
‫And then you will have three zeros for the moments here and that's how your vector would look like.
‫As you can see, it's a six by one vector.
‫Now in many cases I'm going to use some abbreviations.
‫So in order to write less, I'm going to sometimes write s sub theta, which would be sine Seeta.
‫As flying would be signed, fly Essi would be signed.
‫So these will be the abbreviations for the cosine, cosine PHI cosine theta cosine BPCI.
‫And these will be for the tangent, so tension, fi, tangency, c10 tangent.
‫And there you go.
‫You have your first force and moment vector lambda g in the body frame.
‫And now let's look at other forces in moments now.
‫Thank you very much.
‫And see you in the next video.