0:00

Hello and welcome to Glue Lecture 6. Today's lecture should kind of walk you

Â through a little bit of this idea of how robots are going to behave using the

Â framework introduced in Module 6 this week in Dr Edgersett's lecture.

Â So hopefully it'll help you with Quiz 6. So this week in lecture, Dr Edgersett

Â introduced this kind of scary looking hybrid automaton that has lots of

Â complicated guard conditions. And today we're just kind of going to

Â break through those and sort of show you how we might move through this automaton

Â as we try to navigate towards a goal. So we have these behaviors.

Â Go to goal, this is actually a controller, you go to goal, follow wall, navigating

Â around the obstacle counterclockwise. Avoid obstacle and follow the wall of the

Â obstacle navigating in the clockwise direction.

Â So, we're going to answer this question, what does this look like on a robot?

Â So in our little set up we have some robot here.

Â He has a heading, given by this black arrow.

Â We have our obstacle in red. Around this obstacle I've drawn a, a line

Â in grey that represents this delta distance away from the obstacle at which

Â we need to switch to avoid obstacles when we get inside.

Â And then here, the little orange star is our goal.

Â So now, where does the robot wake up in terms of this high level description of

Â the control? So this, this first arrow points right

Â here into u, u go to goal, which means the go to goal controller will be running

Â right when the robot wakes up. So this is the behavior we start with.

Â So what does this look like in our scenario?

Â We have this vector here drawn in red. It points to our goal.

Â And this is the direction along which u go to goal will drive us.

Â And remember that on the robot, kind of at that lower level, we're thinking of these

Â controllers with these equations. Right?

Â So our go to goal controller is going to cause us to drive our current state x to

Â this goal using some gain given in k. Likewise with the, with the avoid obstacle

Â controller. And then with follow wall, we're just

Â rotating the direction that you AO, avoid obstacle controller takes us and we're

Â rotating that by 90 degrees depending on whether we're going clockwise or

Â counterclockwise which way the 90 degrees goes.

Â And remember that's given by this rotation matrix here.

Â So, if you see something like, you know where you have, say 0,1,1,0, notice that

Â this could be a rotation matrix. You know, there might be some theta that

Â satisfies what this matrix looks like that means that this matrix is causing a

Â rotation of a vector. Anytime you see kind of, of a symmetrical

Â structure like this in a, in a matrix, say on Quiz 6, keep that in mind.

Â And remember that our robot is implementing this, this, controller up

Â here U in terms of VNW and our actuator wheel commands.

Â And we know how to go with, between VNW and the wheel commands back in Module 2,

Â that's where we learned that. So, while we have this high level kind of

Â controlling automaton, there are these other things going on kind of at the lower

Â level on the robot. But for now we'll just think okay we know

Â that the u go to goal is running, our robot is going to drive towards that star,

Â directly towards it. So let's watch that as it happens, they're

Â driving towards it and now . All of a sudden, we're at this point

Â where, where within delta away from our obstacle.

Â So let's go back to our automaton, and see if that changes anything.

Â And indeed, two of the guard conditions are that, when we're inside of this radius

Â delta, we might have the condition where we need to change.

Â So let's look at the other half of both of those conditions, where.

Â We're looking at this inner product between these vectors defined by this,

Â these control laws, the, the go to goal controller and the follow wall controller,

Â both clockwise and counterclockwise. And this is really going to determine,

Â once we're inside this delta range, do we follow the obstacle clockwise or

Â counterclockwise. And we were talking about vec-, vectors

Â here in the Euclidean space. This, so we have our follow wall vector

Â and our UA, avoid obstacle director this -- vector, this is the direction we would

Â drive in if we were operating under this controller or this controller or this

Â controller. So now, how do we kind of decode this

Â condition of this inner product? So with these, with these vectors in

Â Euclidean space our dot, our inner product is just a dot product.

Â And so we can write it as the magnitudes of both of these vectors here, for

Â example, with the clockwise follow wall controller.

Â And then the angle between those two guys. So, this is really the important term,

Â right? Because this is going to vary between 1

Â and negative 1, in the following way. So if the two vectors are, are collinear,

Â then the angle between them is 0. The cosine of that is 1.

Â So that would satisfy this condition, right?

Â When they're perpendirect, you know, exact perpendicular to each other, the cosine of

Â that is 0. So we did not satisfy this condition.

Â And then of course, when they're completely open and the angle between them

Â is pi, we get this negative 1 value. So we know that our vector is this cosine

Â term is going to vary between these values and if it's 0 or negative 1, no matter

Â what these magnitudes are, it's kind of irrelevant.

Â So really, what we're worried about is when we're in between these two cases

Â between 0 and 1 where this is going to be greater than 0.

Â So you can kind of see now directly from the picture in this case, my angle between

Â the clockwise and the avoid obstacle is a little bit smaller than between these two.

Â Right? Because these are going to add up to 180.

Â This one looks like a little bit less than 90.

Â So that means we're going to follow that clockwise rotation that way.

Â So we can see that these two conditions are satisfied now.

Â And so we move from operating under the go to goal controller to now the clockwise

Â follow wall. And at this point when this is true, we

Â note the time detail because that's the important condition for whether we switch

Â later given by this guy down here. So we note the, the detail what time it is

Â or not, not what time it is but, how far away we are at the goal.

Â Here at d tal, so we, we mark the distance from our goal at d tal.

Â And now we follow wall. So we're going to follow this new kind of

Â pink vector. The robot's going to keep moving forward.

Â And now, we've actually gotten a little bit closer to the goal, right?

Â So let's go back to that automaton. Let's look at the condition that might

Â cause us here, we're in this state now. What might cause us to leave is if we get,

Â within the distance delta. Well that's not going to happen, right?

Â Because we're following the wall. Or if we get closer to the goal than we

Â were at time detail or at time tell so the distance at time tell.

Â And then again this other inner product that we need to consider.

Â So lets look at those two vectors now so here we have follow wall, avoid obstacle,

Â and go to goal. Now, we're interested in whether the

Â cosine of the angle between these two vectors avoid obstacle and go to goal is

Â between 90 and 0. And of course in this case we can see that

Â that's more than ninety so we're going to stay with following wall because we don't

Â satisfy both of the conditions to go back to go to goal.

Â So we continue to follow wall Continue to follow wall and now, we're getting closer

Â to that point where, now this angle here is less than 90.

Â Our inner product between these two vectors is now greater than 0, and so we

Â switch. These are our two conditions we needed to

Â satisfy right, we switch back from follow wall to go to goal.

Â We've made it all the way, and this is kind of where we're home free.

Â Because we're not going to encounter any more obstacles.

Â But, if we did, we'd kind of go through that whole process again.

Â So you can see how this overall hybrid automaton switching our controllers.

Â We get to these, to this what we did, right?

Â This path around the obstacle. And it would make the goal.

Â So I hope that this helps you with some of the kind of high-level behavior questions

Â you are going to have on quiz six this week and check the forums for more help.

Â And good luck.

Â