In this blog post, we’ll be learning some math tools that will allow us to easily describe how rigid bodies (e.g. solid objects or arbitrary shape) move in Cartesian space.

This will be very important to our future task of programming a robotic arm, because in order to understand how the end-effector of our robot will move, we’ll need to understand how moving the **joints** of our robot arm causes the **links** (which are rigid bodies) to move in space.

If you are still a little rusty on your linear algebra, check out this quick refresher post I wrote that should get you back on your feet and ready to digest the rest of this post.

The problem is actually a little harder than this, because the joints and links of our arm are connected in a chain. To describe the motion of any link in the chain, we also need to incorporate the fact that there may be

severaljoints and links before it in the chain. So describing the motion of a link further along the chain also requires us to factor in several prior joints and links. This is the topic for our next post, where we talk about forward kinematics for robotic arms.

# Frames of Reference

If you remember back to our Cartesian coordinate system, we had a few basic objects that needed to be in place before we could assign coordinates to different points in space. We needed the *origin, *and the *axis’.* With these two things, we could then define any point in space using just three numbers: The x-coordinate, the y-coordinate, and the z-coordinate.

But where exactly is the origin? And how do we know which way the axis’ should point? Is there a marker somewhere on the earth that says: “*This is the origin, and here are the axis’.*”

Of course not! There is no “absolute origin”, just like there is no “center” of the universe. We can place our coordinate system anywhere that we want, and start measuring coordinates from there. We could assign the origin to the top of the Eiffel tower, or in the pilot’s seat of an airplane that is traveling near the speed of sound, or on the wheel of a moving bus. This assignment of a coordinate system to a particular place and orientation is called a **frame of reference.**

For instance, when you walk around your house and observe things, you see everything from* your frame of reference,* the origin of which is pinned to the front of your face, with the x-axis looking outward and the z-axis pointing up.

In this way, all frames of reference are **relative, **meaning that **the only way to describe the position and orientation of one frame of reference is by comparing it to anothe**r.

And we can define many frames of reference, not just one. And *this* is the key to describing how rigid bodies move. **We describe the location and orientation of each rigid body by assigning it it’s own frame of reference.**

Each rigid body is pinned to the origin of it’s respective frame of reference, and is static in its own frame.

By assigning a frame of reference for each rigid body in this way, we can accurately describe how objects move in space, and more importantly, their positions and orientations relative to each other.

Don’t worry, we’re going to walk through a few examples to show you how we’ll do this.

# Translation: A Simple Rigid Body Motion

Imagine two frames of reference, *O *and *O’ *(pronouned “O prime”)*. *Let *O* represent the initial position of the rigid body, and *O’** *will represent the position of the rigid body after the translation.

Translating a rigid body is the simplest kind of motion. All that it requires is a **displacement vector**, which describes the location of frame *O’*** **relative to the initial frame, frame

*O’.*

We usually represent a translation vector with subscripts to tell us what reference frames we are translating from and to.

To describe any point in frame *A *in the translated frame *B*, we would just add the translation vector to it:

So for instance, let’s define our rigid body object to be a cube, with 6 points (one point for each corner) in reference frame *O. W*e can see what our cube would look like in the translated frame *O’ *by adding the translation vector, to all six points.

# Rotation

Rotating a rigid body is the other kind of motion that a body can undergo. Assuming we have an object that undergoes a pure rotation (no translation), we can again define two reference frames: *O* is the initial reference frame of the object, *O’* is after the rotation.

In the diagram above, the black lines represent the initial reference frame *O, *and the green lines represent the rotated reference frame *O’.*

We can define a 3 X 3 rotation matrix, to show how any point in reference frame *O* would look like if we rotated it into reference frame *O’:*

So for instance, if we define our rigid body object to be a cube, with 6 points in reference frame *O*, we can multiply those points by to see what the cube would look like in the rotated reference frame *O’**.*

# Generalizing Motion: Rotation and Translation

In the real world, we rarely move by pure translation or pure rotation. Usually we move by both rotating and translating, like when we drive our car and turn left or right.

In the next blog post, we’ll be discussing a technique that we can use to describe this kind of complex motion very simply, and along the way we’ll explain how this relates to our robot arm.