0:00

So, in the last lecture, we saw that, even for rather un-, scary looking

Â environments. Let's say that we had, slight non

Â convexities, or even extended convex obstacles.

Â the dynamic duo of behaviors, go to goal and avoid obstacle,

Â no longer was enough to negotioate these environments.

Â And we saw that we really needed some way of flowing a long the boundary of an

Â obstacle in order to be able to get around in the world.

Â And today, I want to talk about this missing piece.

Â The missinig behavior which is a wall following behavior.

Â And what I want to do now is really just introduce it and then in the next lecture

Â introduce it in a more systematic way as to induce mode when you're trying to

Â avoid sliding or avoid type 1 Zeno. So, here is the question.

Â How do you actually follow walls? Or when I say walls what I really mean are

Â boundaries of. boundaries around obstacles.

Â So let's, let's start simple. Here is, as always, an obstacle and I

Â have a disk around it where, this is my safety disk.

Â Well, avoid obstacle is going to tell me, you know what, I want to move straight

Â away from this From this obstacle. Well, how do I , which direction do i go

Â in, in order to maintain a constant distance from this obstacle? Well what I

Â need to do is, I need to flow, right, along the boundary of this, this region.

Â Well, what this means is that here, I need to go in this direction.

Â And what I really need to do then is take The direction, given to me by my avoid

Â obstacle behavior, and flip it down, like this.

Â And this is a negative pi over 2, or a negative 90 degree flip.

Â So, that's what I need to do. I need to flip it down by 90 degrees,

Â like this. And now, I'm going to call this FW, for

Â Follow-wall, and follow-wall is now, simply, like I said, a flip down of 90

Â degrees, which this curious looking matrix here is actually achieving.

Â And I may want to scale it, so I may have some scaling that's making this Longer or

Â shorter, depending on, I don't know. Whatever concerns you may have.

Â Now, I should point out that, this matrix here, I can write as a rotation matrix,

Â that corresponds to a pi over 2. Sorry, negative pi over 2 flip.

Â so I can actually write this as alpha, which is the scale, times the rotation

Â matrix, that is, the flip, times u, avoid obstacle, because that is ultimately the

Â behavior that I'm, that I'm flipping. So, this tells me that the way to move

Â around this obstacle, is to simply take my avoid obstacle behavior, and flip it.

Â That's as simple as that. So, there is a problem though.

Â I can actually flip in 2 different directions.

Â Not only can I go like this, I can also go like that.

Â So 1 question 1 should ask of course is which direction should I go in, but the

Â other question is how do I even mathematically describe these 2 options?

Â Well, what I have, what we saw before was, we called it U clockwise follow

Â wall, and the clockwise follow wall corresponds to a negative pi over 2 flip

Â to avoid the obstacle. A counter clockwise follow wall, which

Â means follow it in the other direction, well that is simply a pi over 2 flip of

Â the void obstacle behavior. So if I introduce this thing that I've

Â already called the rotation matrix, this is simply an operation that does this

Â flip over vector. If I have a vector here.

Â V, and I want to flip it by phi. This new thing here, is simply r of, it's

Â not phi, it's theta. R of theta times v.

Â This is how I get this new, this new rotated vector.

Â So the rotation matrix is cosine theta negative sine cosine.

Â That's the form of this linear operator that's flipping vectors at certain angle.

Â Well what we've already seen is that the clockwise follow-wall it's a negative pi

Â over 2 flip so this behavior is simply equal to alpha times, this matrix times,

Â uAO. Now the counterclockwise, while I can

Â write that in the same way, it's just a pi over 2 flip instead of a negative pi

Â over 2 flip, which gives me the following expression.

Â So, I actually have very, very clean expressions for how I should make my

Â flip, meaning how I should proceed along the

Â boundary of the obstacle. And this works even if their obstacle is

Â not just a point, because all I really did was I took a void obstacle, a void

Â obstacle behavior and, and flipped it. Now we don't know which direction to go

Â with them. So lets say that we have this situation,

Â right. [SOUND] I'm going towards the goal,

Â and then let's say when I'm here, I now want to switch to a follow-wall behavior.

Â Which direction to choose? it's not entirely clear.

Â Right? I, if the robot only sees what's going on around here, for instance, how

Â does the robot know what the world looks like? We haven't built a map of anything.

Â So, you could either go clockwise, which in this case turned out to be the

Â long way around, or you can go counter-clockwise, but it's really not

Â clear how we should make this choice. But here's one thing one can observe, is

Â that go to goal here is wants to move you kind of upwards a little bit.

Â So maybe we can let go to goal make the choice for us.

Â Go to goal once the drive was a little bit in this direction, not at all in that

Â direction. So that's the idea we have here at, that

Â there is no obvious answer, there is not then obvious right choice given what

Â local information the robot has. The robot doesn't know globally what the

Â world looks like. So given that we only know locally what's

Â going on may be we can lack this goal to goal behavior.

Â Decide which direction we should go in. So let's, let's try to make this a little

Â bit more mathematically precise, what it means to let the goal to goal behavior

Â decide. Here, goal to goal, the angle was wrong

Â here. Goal to goal wants to go in this

Â direction. Right? So here, goal to goal wants to

Â drive us up. Limit up, so may be we should take

Â follow-wall up. So this would be u clockwise.

Â Well, u counter clockwise or u follow-wall counter clockwise wants to go

Â down. And note, that this angle is less than pi

Â over 2, but this angle, the absolute value of it, is greater than pi over 2.

Â So we should be able to look at this angle to determine.

Â Where we should go, but lucky for us there's a very simple way of checking

Â these angles. If I have two rectors v and w I can take

Â what is called the inner product of those t which is simple v transposed to w.

Â Well that's equal to the absolute values of, or the, the length of vectors times

Â cosine of this angle in between them. And if this angle is less than pi over 2,

Â then cosine is going to be positive. If it's greater than pi over 2, then

Â cosine is going to be negative. So all we need to do.

Â It's to look at the sine of this thing, to figure out whether or not we're kind

Â of pointing in the right direction. So, here is a test.

Â Check go to goal inner product with follow wall clockwise.

Â If that's positive, we should go clockwise.

Â So, in this scenario, again. Again, we're pointing in this direction,

Â here is the follow wall, so this, go to go.

Â Here is u clockwise. This angle, is less than pi over 2, which

Â means that, this situation is satisfied. Here is u counter-clockwise, so this

Â angle is greater than pi over 2. So, that means that the other condition

Â is not satisfied. So what we actually have is a local

Â check. We compute the direction that two

Â different follow-wall behaviors would take us in.

Â Then we just take this inner product with go-to-goal behavior, and we check the

Â sign. And whoever comes up with a positive sign

Â is the winner. and that's the direction we choose to go

Â in. Now, there is a problem with this of

Â course. And that's that if you remember our

Â labyrinth, or our little maze here, right.

Â If I'm following wall, you know what, I'm going to follow it all the way around.

Â And I don't want to keep going indefinitely around and around, right.

Â So then I'm just spiraling. At some point, if here's the goal.

Â I want to release and go towards the goal.

Â So one thing that we don't know yet is. When do we actually release the

Â follow-wall behavior? When do we stop following walls and start approaching

Â goals again? The other question is, you know what, we had avoid obstacle we had

Â the rotation matrix, that flips either up or down, depending when we're going

Â clockwise or counterclockwise. And then I have this little alpha there

Â Is there some natural or systematic way on which we can think about the alpha?

Â And that is going to one One of the things we will discuss in the next, the

Â next lecture.

Â