0:00

The outcome of the last handful of lectures was that we can really use a

Â layered architecture to make our robots act like a simpler system.

Â Like x dot = u, in our case. And they key idea was to plan using the

Â simple dynamics. And then track using some clever

Â controller. And what we saw last time was we could

Â use a PID regulator, for instance for, controlling the heading of the robot, and

Â then simply set the velocity of the robot equal to the magnitude of the planned

Â velocity, u. Well, today, I want to discuss another

Â twist to this theme. In fact, I want to be even more clever.

Â And there is a particularly eloquent and cute way you can think about unicycles.

Â And in general I'm not a big fan of clever tricks for the sake of clever

Â tricks, but because differential drive mobile robots are so common.

Â And we know that unicycles model them well, then this trick becomes more than

Â just a piece of mathematical curiosity, becomes an effective way of thinking

Â about a large, a large and rich class of mobile robots.

Â So, instead of doing tracking, we're going to transform the unicycle dynamics.

Â So recall that we have the position xy, we have the heading phi, and we have the

Â dynamics as seen here. Well, typically, what we've seen so far

Â is, we want the robot not to slam into things, we want the robot to end up on

Â top of goal points we want the robot to folow walls.

Â We don't particularly care which way it's pointing, so the first thing we're going

Â to do is say, you know what let's just pretend that we don't worry about

Â orientation whatsoever. Well, we still have a rather awkward

Â looking nonlinear differential equation but let, now, pick another point.

Â Let's not pick x, y, which as you remember, was really the point right in

Â between the wheels of the differential-drive mobile robot.

Â What if we picked another point, instead? Let's pick this point.

Â The red point here. And let's say, that the distance between,

Â the red point and the black point. That's, that's some distance l, where l

Â is some small number. What would happen if we looked at this

Â new point, instead? Well, let's place the new point at x tilde y tilde The next

Â tilde is simply x + l cosine phi. Simple geometry.

Â And y tilde is y + l sine phi. Where, again, l is the distance removing

Â our point along the heading of, of the robot.

Â Well, let's see what the dynamics of this new point.

Â The tilde point actually looks like. Well, this is our old dynamics this how X

Â and Y and phata actually behaves. This is our new point and now, what we

Â need to do is put dots over the tildes to see.

Â What do the time derivatives actually look like? Well, it's not so complicated.

Â X till the dot, well, it's x dot + the time derivative of this thing, and, the

Â time derivative of cosine phi, and remember phi is a function of t, if I

Â take ddt of this thing, then. What I get, is, I get - phi dot * sin

Â phi. Well, that's what we have here, x tilde

Â dot, is x dot - l phi dot sin phi, and similarly for y, tilde dot.

Â Alright, this still doesn't seem all that helpful, to be completely honest, so lets

Â simplify this a little bit. Well, first of all, I know what x dot is.

Â It's this thing here, so instead of that, I'm just plugging in v cosine phi.

Â I also know what phi dot is. It's, it's omega.

Â So, now I end up with a slightly, less scary-looking expression.

Â And, then we do the same thing for y tilde dot.

Â Well okay, where does this lead us? Well, let's assume for a second that we can

Â control this new point directly. That this new point is indeed, the point

Â that we before have called x dot = to u, as a way of generating reference

Â velocities. Let's assume that we can actually

Â immediately control this new point. What would that tell us? Well, x tilde

Â dot as you recall, was given by this mouthful of an expression.

Â Well, let's set this equal to u1 which is our desired velocity in the x direction.

Â And similarly, we set y tilde dot = u2. Now, all we need to do at least, well I

Â can say all we need to do, I don't know if we can do it.

Â But, all we would like to do is actually solve this equation with respect to V and

Â omega. Because, if we did that, we would relate

Â the actual velocities of the unicycle to these u1 and u2 velocities, which are The

Â planned velocities. So let's see if we can do that.

Â Well the first thing we do is we pull out the cosine and the sine terms.

Â So we get that cosine * v - sine * l omega well that's that thing, that's

Â equal to u1. And similarly for the y tilde dot, or the

Â u2 dot, sorry, the u2 equation. I don't know, this equation still looks a

Â little hairy but, as you hopefully recall, this matrix right here is a

Â rather nice matrix. It is, in fact, a rotation matrix.

Â All it's doing is it's taking a vector and rotating it theta degrees.

Â Actually, it's rotating it phi degrees, but it is a very well behaved and well

Â understood matrix, okay?

Â I don't particularly like l there, because l is not part of what I would

Â like. I would like v and omega and, no l.

Â So, what I can do, is I can rewrite this thing as, a matrix, a diagonal matrix,

Â with one on the first diagonal, and l on the second diagonal, simply times v, and

Â omega. And if I do that,

Â I get the following expression. Rotation matrix phi, sorry, yeah, phi, *

Â this matrix, v omega. Well, these are all invertable.

Â What is the inverse of the rotation matrix? Well, the rotation matrix rotates

Â something phi degrees. Well, the inverse would be to rotate it

Â back, right? Then you're back where you started.

Â That's -5. So, R inverse phi always exists and it

Â corresponds to rotating it back five degrees.

Â So, we can invert this matrix easily. Well, this is a diagonal matrix, and the

Â inverse of this thing is simply the inverse of the diagonal, 1 / 1 00 1 / l.

Â So the inverse of this thing is also trivial.

Â That means that I can actually solve directly for V and omega, no problem.

Â No questions asked, no tracking, no approximation, just bam, I get the right

Â velocities out. So if I have my low level plan producing

Â U1 and U2, then I can transform that into V and omega directly.

Â And this seems almost too good to be true, and it is too good to be true,

Â because remember We're actually not making x y behave perfectly, we're making

Â this new point that we call x tilde y tilde, we're making that point behave

Â perfectly. And then we have l, that tells us how far

Â away we are, and by making l small, we're getting closer to x and y, so you

Â practice. You pick l tiny and then you go to work.

Â So what does this mean, it means that before we had a planner we used our

Â complicated navigation algorithm to spid out u1 and u2 all right and then we had a

Â tracker and in our case we use the PID tracker for the heading and simply set

Â the velocity equal to the magnitude of u and from that we got v and omega out.

Â Well now, we don't have to deal with trackers.

Â We've actually replaced second part with a transformation of the unicycle where

Â we're simply saying that V and omega, or these 2 matrices * u1, u2.

Â And again, these matrices are, not particularly complicated to compute.

Â This, is simply the rotation matrix and phi of course we have.

Â This is one, easy to compute, it's just one.

Â And ;; is something that we decide, so what we put here, this is 1 / l, l should

Â be small so 1 / l should be some large number, right? And the larger this number

Â becomes the closer the tilde the point and the actual point approach each other.

Â I should put out a little warning though that if you make this number too large,

Â then you get a behavior where the robot starts turning quite a bit, because this

Â going to hit omega directly. Okay but, this gives us a direct

Â transformation, instead of a tracker, to produce the desired velocities.

Â And the reason why I like this trick, and why this trick shouldn't be thought of as

Â simply, an interesting little curiosity because it is kind of interesting is that

Â so many robots are differential drive robots, and this transformation applies

Â to all of them, because all of them can be mapped onto the unicycle dynamics.

Â So, that takes care of, how do we actually go from low-level plans.

Â To executable, desired velocities for differential drive mobile robots.

Â