‫Welcome back.
‫Let's now do the conversion exercise, you had a rotation matrix called R, sub Z, Y, X using the
‫oil or angles.
‫So that was our convention.
‫Or you can write it down like this are sabzi times are sub Y, times are sub X, but for simplicity
‫let's just call it are now each matrix here was a three by three rotation matrix.
‫So if you multiply them together in this sequence, then this would be a result.
‫So you can use this rotation matrix to take measurements in the body frame and convert them into the
‫inertia frame.
‫But careful rotation matrices were only good for translational velocities, not angular velocities for
‫the angle of velocities.
‫You had this special transfer matrix, if you remember, and the reason for that was because when we
‫dealt with the rotations, we had a specific convention and then we had to derive a specific transfer
‫matrix for that specific convention, Zywiec using the oil or angles, meaning that you first rotate
‫about the body from Z axis, then you rotate about the body frame, y axis.
‫So about the moving frame and then you rotate about the body frame or moving frame x axis.
‫So anyway, if you have your you the N.W., which are your translation of the losses in the body frame,
‫what will you get if you take this rotation matrix and you multiply it by this vector, what will you
‫get?
‫You will get X, dot, why dot and Z that in the inertia frame.
‫And now if you have your body frame, angular velocity P, Q and R, then what will you get?
‫If you take the transfer matrix and you multiply it by this vector, you will get five that theta that
‫and upside that.
‫It makes sense, right?
‫Translation of last in the body frame and then you get a translation of velocities in the initial frame.
‫And here you have the angular velocities in the body frame and then you get your angular velocities
‫in the initial frame.
‫We can also rewrite it in a more compact way.
‫This entire vector in the inertia frame equals this matrix times.
‫This vector, so we managed to incorporate the rotation matrix and the transfer matrix in one big matrix
‫and we called it Matrix J and you multiply it by this vector and that's how you convert between body
‫and inertial frames and then you just perform the same kind of integration for the states in the initial
‫frame.
‫So here I have used the oilor method, the easier but more imprecise method, and soon you will learn
‫the wrong Akutan method.
‫So that's how you do it.
‫And let's complete the schematics now.
‫So what you definitely need to have in your plan box.
‫Is this Jay Matrix that was a function of our matrix and transfer matrix?
‫In fact, to be more precise than Jay.
‫Was a function of R.A., but then the rotation matrix itself was a function of.
‫Fi, Seeta and BPCI, so we have here Fi, Seeta and Passi.
‫And the transfer matrix was a function of Phi and Theta.
‫So Phi and theater like this, that means that this box will need values.
‫There are five Seeta and Passi.
‫And of course, since you have your states in your body frame, you just take your state's.
‫And you put them through this Jay box and then what you will get is X dot.
‫Y and Z dot and then find that C to that and upside that, and then you put them through another integrated
‫box, which is now this one in purple, if you use oilor or you can also use around Akutan, which we
‫are going to do soon.
‫So either Oilor or Runga Kuta.
‫And of course what we'll get out of this box will be your X, Y, Z, and then Fifita and Passi.
‫So you're five feet and I can now go into your matrix and one final thing, your integrated box here
‫now will also need your states now so all your six inertial frame states will go into this second integrated
‫box.
‫And then, of course, together with the body frame states, your inertial frame states, they will
‫go into your controller and then the controller will compute your use.
‫And that's how the loop will operate throughout your maneuver or throughout following your trajectory.
‫So I would say that this is a pretty detailed schematics that tells you what's going on in the plan
‫box.
‫And so we only have two things to do before we finish with our plans.
‫I need to teach you Runga quota so that you would only rely on oilor and then I need to teach you and
‫show you what's inside this or megabucks, and then you will be completely done with the planned part.
‫And then we can move to the controller part where we're going to use two types of controllers.
‫One will be the more predictive control which you learned in the previous course in this core series.
‫And so this time the section on model predictive control will be easier and shorter, because now I'm
‫just going to take what I had taught you in the previous course, and I'm just going to brutally apply
‫it to this system.
‫And you see that there are very many similarities between the vehicle case that we had in terms of the
‫lateral control case and this case where we have a USV and then we want to make it follow a 3D trajectory
‫while controlling it states.
‫But in combination with the model predictive control, there will be another controller working with
‫it so they will be synchronized with each other.
‫So we're going to spend a little bit more time with the other controller.
‫But the more primitive controller, you already know what it is and how to apply it.
‫And now you're just going to see how to apply it to a different system.
‫Now, in the next video, I'm going to spend just a little bit of more time on the oilor integration
‫method, and then right away we're going to move into Runga Kutta method.
‫So thank you very much and see you in the next video.