LESSON

# Relative pose in 2D

#### Share

#### Transcript

We’ve talked about how we can describe the position and orientation, the pose of one coordinate frame with respect to another. Here, we have two coordinate frames labeled A and B, and we use this symbol here to denote the pose of B with respect to A. I've introduced a point P and I can describe it by two vectors. I can describe it with respect to coordinate frame A; that's the blue arrow, or with respect to coordinate frame B; that the red arrow. I can relate the vector with respect to frame A to the vector with respect to frame B using the pose and this operator, the dot.

Now, let's consider that I introduce another coordinate frame, coordinate frame C and I have a relative pose that describes C with respect to B. And I can describe the point P in terms of a vector with respect to coordinate frame C. So, these relative poses can be compounded or composed, so I can get to the pose C by first of all getting to the pose B and then getting to the pose C. So, there's some way that I can add these two poses together, but we haven't described yet exactly what a pose is. I'm going to introduce another abstract operator. It is a plus sign inside a circle, I'm going to call that O+. So, the O+ operator allows us to join or add these two poses. So, the relative pose from frame A to frame B, O+ the relative pose from frame B to frame C gives us the relative pose of C with respect to A. This O+ operator performs what is called composition. It allows us to compose, to compound, to add, in inverted commas, two poses together. Then, I can use my dot operator to transform the vector from frame C to frame A, and we can extend this approach indefinitely. I can compound as many relative poses as I wish.

When we talk about things like relative motions, it's really important to keep in mind that the order in which you apply them is critically important. Now, consider the example where I move from the reference frame and I move a coordinate frame 30 centimetres in the x direction and then I rotate it by 45 degrees, and we defined the convention for rotation; this is a positive rotation of 45 degrees. Now, imagine that I do these operations in the reverse order. So, I take my reference coordinate frame and I rotate it by 45 degrees and then I translate it by 30 centimetres in the x direction. So, now I end up with a coordinate frame over here. So, you see that by changing the order in which I apply these elementary motions, the translation and the rotation, I end up with very different coordinate frames. Ordering is really important.

Let's look at a more complex example, and I've introduced here a world coordinate frame. Now, I introduce a coordinate frame which represents the pose of my robot on the table. And here's a coordinate frame which represents the pose of the little robot. And here is another coordinate frame which represents the hand of the big robot. And I can describe the pose of the hand of the robot with respect to the robot itself. I can introduce another coordinate frame which describes the pose of a camera which is looking at both of these robots. And, I can perhaps describe the pose of the camera with respect to my world coordinate frame. And perhaps the camera is able to tell where the robot is, with respect to the camera's coordinate frame. And, perhaps the camera can also tell me the pose of the little robot with respect to the camera's coordinate frame. And now, I might be interested in knowing, what's the pose of the little robot with respect to the big robot? Or I might want to know is, what's the relative pose from the hand of the big robot to the little robot, in case the big robot wanted to touch the little robot? Or, perhaps I might want to know, what's the pose of the hand of the big robot with respect to the world coordinate frame? I've introduced rather a lot of coordinate frames and relative poses. We can simplify this by introducing what I call a pose graph. So, I’ve kept the same colour coding and I kept the same labeling.

Now, instead of representing a pose by a two-dimensional coordinate frame, I represent it simply by a disc. The lines that join the discs represent the relative poses and notice that they are lines with an arrow so this thing is a directed graph. The solid lines represent relative poses that we know and the dashed lines represent poses that we don't know, but perhaps we can compute them.

So, let's highlight this particular relative pose here and say I want to determine the value of this particular relative pose. How do I do that? Well, what we’re going to do is to follow a path through the graph that's got the same starting point and the same ending point. The first leg of the journey is this arrow here, and then I go from pose C to pose R and then go to pose H. We can say then that this relative pose is equal to the composition of these other 3 relative poses. If I join this, this, and this together it gets me to the same place in the pose graph as this. So, this is a way I can compute an unknown relative pose in terms of relative poses that I know.

Let's have a look at a more complex example. Now, I want to know this relative pose where is the little robot with respect to the hand of the big robot. Same rule again. I want to find another path through this graph that takes me from H to L. The first leg of the journey is going to be this one. But in this case we need to go backwards along this arrow, so I've coloured it in red to indicate that I'm going backwards along this particular part of the graph. Then I'm going to go backwards along this part of the graph and then I'm going to go in the forward direction along this part of the graph. And now, when I write the pose expression, I've introduced two new symbols. It's a minor sign inside a circle and I'm going to refer to this operator as O-. So, for the case of the relative poses that are coded in red, where we went backwards along the arrow, I've prefixed that pose by a minus sign because I've gone in the reverse direction. Whereas this one here, I've used the O+ operator because I'm going in the forward direction along the arrow. So, here is a way that I can define an unknown pose in terms of previously known poses.

What we got now is some kind of pose algebra and there are just a few simple rules with a pose algebra. The first rule is concerned with the O+ operator. I can combine two relative poses to get another relative pose but there are some really important rules associated with all the subscripts here. The first rule is that these two subscripts, the one on the either side of the O+ operator, must be the same. And you can think of the miscancelling out. Then, this leading subscript is the same on both sides of the expression and this subscript is the same on both sides of the expression. The O+ operator is not commutative and that means that if I have a relative pose 1, and an O+ with relative pose 2, that is, in general, different to relative pose 2 O+ relative pose 1. You have to be really careful about the order and you can arbitrarily switch them around. Another rule is that O- operator applied to the relative pose is the same as swapping the leading and trailing labels. Another rule is that I have pose O- the same pose, the result is zero. It corresponds to no motion, no pose change and we use symbol zero to represent that. And, another way I can express that is to negate the pose and then add it to the pose, the result is zero. These two expressions are equivalent. Finally, if I add the zero relative pose to a pose, it makes no change. And, if I subtract the zero relative pose from a pose, it makes no change.

These are just a few simple algebraic rules that we can apply to these complex pose expressions which allows us to rearrange them to determine the things that we want in terms of the things that we know. There are a few rules also that apply to this dot operator where we combine a pose with a vector. And again, we have some rules that apply to the labels here. And once again, the innermost labels must be the same. And then, we can think of them as cancelling out and the leading labels are the same.

#### Code

We consider multiple objects each with its own coordinate frame. Now we can describe the relationships between the frames and find a vector describing a point with respect to any of these frames. We extend our algebraic notation to ease the manipulation of relative poses.

Try your hand at some online MATLAB problems. You’ll need to watch all the 2D “Spatial Maths” lessons to complete the problem set.

### Skill level

High school mathematics

This content assumes an understanding of high school-level mathematics, e.g. trigonometry, algebra, calculus, physics (optics) and some knowledge/experience of programming (any language).

### Rate this lesson

## Check your understanding

## Discussion

## Leave a comment

Please Sign In to leave a comment.

DOT PRODUCT IS VECTOR DOES THAT MEANS POSE VECTOR IS IN REALITY A SCALAR THING

Could you clarify your question. “DOT PRODUCT IS VECTOR” is not very precise, the dot product takes two vectors and results in a scalar.