Configuration, State, and Degrees of Freedom

Configuration and C-Space

The first question to answer in robotics is, simply, where is the robot?.
A proper complete answer would require knowing position of every single point in the robot with respect to some global frame. This complete specification is called the robot's configuration.

Configuration of a robot specifies the position of every point of the robot

A configuration, denoted by q, is a set of parameters that uniquely defines the robot's state. The set of all possible configurations a robot can achieve is its configuration space, or C-space.
The C-space is a crazy concept because it transforms the complex geometric problem of a robot moving among obstacles in the physical workspace into a simpler problem of a single point moving in this higher-dimensional C-space. Configurations where the robot does not collide with obstacles are part of the collision-free C-space.

Degrees of Freedom (DOF)

The number of degrees of freedom (DOF) is the minimum number of independent parameters needed to completely specify the robot's configuration.
This means the DOF is also the dimension of the robot's C-space.

We can develop an intuition for this by considering the constraints on a rigid body. In 2D, once we fix the position of a point A (2 DOF), a second point B is constrained to lie on a circle around A (1 more DOF). Any other point C is then fully determined by its distances to A and B. The total is 2+1=3 DOF. In 3D, the circles become spheres, leading to 3+2+1=6 DOF.

Robot Joints

Robots are typically composed of rigid bodies called links connected by joints. Joints introduce constraints and reduce the overall DOF of the system.
Pasted image 20250921022014.png

Pasted image 20250921021902.png

Image taken from Modern Robotics: Mechanics, Planning, and Control

Grübler's Formula

To calculate the DOF of a mechanism, we can use Grübler's Formula. This formula is based on the principle of subtracting the constraints imposed by joints from the total possible freedoms of the links.

DOF=m(N1J)+i=1Jfi

where:

Example: A 3R Planar Arm
For a planar arm with three revolute joints connected in a series to a base:

Plugging this into the formula:

DOF=3(413)+(1+1+1)=3(0)+3=3

This confirms our intuition that the arm has 3 degrees of freedom.

Important Note: Grübler's formula is only valid if all joint constraints are independent. For some mechanisms with redundant constraints, it may yield an incorrect result.

Rigid Body Transformations in 2D

To describe a robot's configuration mathematically, we move from the notions of Euclidean geometry to the algebraic framework of Cartesian geometry. These are there in Co-ordinate-Transforms some what.

Coordinate Frames and Rotation

We attach coordinate frames to objects of interest.
A point P can be represented as a vector from the origin of its frame, for example, p=pxx^+pyy^. By convention, we use right-handed coordinate frames.

To describe a robot's motion, we need to relate points described in a local body frame {B} to a global world frame {W}. If frame {B} is rotated by an angle θ with respect to {W}, we can find the coordinates of a point p in the world frame, pW, from its coordinates in the body frame, pB.

The derivation proceeds as follows:

  1. The basis vectors of {B} in terms of {W} using trigonometry:
x^B=cosθx^W+sinθy^Wy^B=sinθx^W+cosθy^W
  1. A point vector in the body frame is pB=pxBx^B+pyBy^B. Substitute the expressions from step 1 to find the same point vector relative to the world frame, pW:
pW=pxB(cosθx^W+sinθy^W)+pyB(sinθx^W+cosθy^W)
  1. Group the x^W and y^W terms:
pW=(pxBcosθpyBsinθ)x^W+(pxBsinθ+pyBcosθ)y^W
  1. This can be written in matrix form, which gives us the 2D rotation matrix:
[pxWpyW]=[cosθsinθsinθcosθ][pxBpyB]

This relationship is compactly written as pW=RWBpB. The rotation matrix RWB transforms the coordinates of a point from frame {B} to frame {W}. This is very important distinction to make, the rotation matrix transforms the coordinates of a point from one frame to another, but if you apply the same rotation matrix to the basis vectors of the frame, it will give you the basis vectors of the other frame in the original frame's coordinates.

The Special Orthogonal Group SO(2)

Rotation matrices have several important properties:

The set of all 2×2 matrices that satisfy these properties forms the Special Orthogonal Group of dimension 2, denoted SO(2).

Homogeneous Transformations and SE(2)

When a frame is both rotated by R and translated by a vector t, the transformation is pW=RWBpB+tWB. This mixes matrix multiplication and vector addition, which is annoying. We can combine them into a single matrix multiplication using homogeneous coordinates. We augment our vectors and matrices:

Now, the transformation is a single, clean multiplication: p~W=TWBp~B.

[pxWpyW1]=[cosθsinθtxsinθcosθty001][pxBpyB1]

These 3×3 transformation matrices form the Special Euclidean Group of dimension 2, or SE(2). An advantage is that composing transformations is as simple as matrix multiplication: TWA=TWBTBA.
(That's because it's a property of SE(2) that the composition of two transformations is another transformation in SE(2).)

The fundamental insight is that the columns of a rotation matrix RWB are the basis vectors of the "new" frame {B} expressed in the coordinates of the "old" frame {W}. This allows us to transform the coordinates of any point from frame {B} to frame {W} via matrix multiplication:

pW=RWBpB

When we need to account for both rotation and translation, we use homogeneous coordinates. This combines the rotation matrix R and a translation vector t into a single transformation matrix T, allowing us to represent a full rigid body motion with a single matrix multiplication:

[pW1]=[Rt01][pB1]

Example

A point pB=(2,3,5) is defined on a body {B}, which is initially coincident with the world frame {W}. The body is first rotated about its own Z-axis by π/2, then rotated about its new, local X-axis by π/2. Finally, it is translated by t=(8,1,0) with respect to the world frame. Find the final coordinates of the point in the world frame, pW.

The first rotation is by θ1=π/2 about the Z-axis.

R1=Rz(π/2)=[cos(π/2)sin(π/2)0sin(π/2)cos(π/2)0001]=[010100001]

The second rotation is by θ2=π/2 about the new local X-axis.

R2=Rx(π/2)=[1000cos(π/2)sin(π/2)0sin(π/2)cos(π/2)]=[100001010]

To find the final orientation of the body, we post-multiply the first rotation by the second.

RWB=R1R2=Rz(π/2)Rx(π/2)=[010100001][100001010]=[001100010]

Now we can find the final coordinates pW by applying the combined rotation and the final translation to the original point pB.

pW=RWBpB+tpW=[001100010][235]+[810]=[(02+03+15)(12+03+05)(02+13+05)]+[810]pW=[523]+[810]=[1333]

The final coordinates of the point are (13,3,3).

Singularities in Orientation: Gimbal Lock

While representing orientation with a sequence of three rotations (Euler angles) is intuitive, it suffers from a critical problem known as gimbal lock. This is a singularity where the alignment of two rotation axes causes the loss of one degree of rotational freedom. I cover this in more detail in my EULER ANGLES note.

Let's examine the mathematical reason for this. Consider a ZYX roll-pitch-yaw convention. The final rotation is R=Rz(y)Ry(p)Rx(r). If the pitch angle p is set to π/2:

Ry(π/2)=[001010100]

The full rotation becomes:

R=Rz(y)Ry(π/2)Rx(r)

A useful property of rotation matrices states that Ry(π/2)Rx(r)=Rz(r)Ry(π/2). Substituting this in:

R=Rz(y)Rz(r)Ry(π/2)=Rz(y+r)Ry(π/2)

The final orientation now depends only on the sum of the yaw and roll angles, not their individual values. We can no longer distinguish between a yaw and a roll motion; the system has become degenerate and lost a degree of freedom.


Axis-Angle Representation

An alternative, non-singular way to represent orientation is the axis-angle form. Euler's rotation theorem states that any orientation in 3D space can be described as a single rotation by an angle θ about a single unit axis w^. This is often more intuitive than a sequence of three separate rotations.

Rodrigues' Formula Derivation

Rodrigues' formula provides a direct mapping from an axis w^ and angle θ to the equivalent 3×3 rotation matrix R(w^,θ). The slides note this was a derivation on the board, so here are the steps.

Step 1: Decompose the Vector

We want to rotate a vector v around the unit axis w^. We can decompose v into two components: one parallel to w^ and one perpendicular to w^.

v=v||+v

The parallel component is the projection of v onto w^:

v||=(w^v)w^

The perpendicular component is what remains:

v=vv||=v(w^v)w^

Step 2: Rotate the Components

The rotation only affects the perpendicular component. The parallel component lies on the axis of rotation and is therefore unchanged.

v||,rot=v||

The component v rotates by angle θ in the plane whose normal is w^. The rotated vector, v,rot, can be described as a sum of a component along the original v and a component along the vector orthogonal to both w^ and v (which is given by w^×v).

v,rot=(cosθ)v+(sinθ)(w^×v)

Since w^ and v|| are parallel, their cross product is zero, meaning w^×v=w^×(v||+v)=w^×v. So we can write:

v,rot=(cosθ)v+(sinθ)(w^×v)

Step 3: Recombine and Simplify

The final rotated vector, vrot, is the sum of the rotated components.

vrot=v||,rot+v,rot=v||+(cosθ)v+(sinθ)(w^×v)

Substitute the expressions for v|| and v:

vrot=(w^v)w^+cosθ(v(w^v)w^)+sinθ(w^×v)

Grouping terms for v and (w^v)w^:

vrot=vcosθ+(w^v)w^(1cosθ)+(w^×v)sinθ

This is the vector form of Rodrigues' formula.

Step 4: Convert to Matrix Form

To get the matrix R such that vrot=Rv, we can represent the cross product as a matrix multiplication using the skew-symmetric matrix of w^, denoted [w^]:

[w^]v=w^×v[w^]=[0wzwywz0wxwywx0]

The term (w^v)w^ can be written as (w^w^T)v. Also, a useful identity is [w^]2=w^w^TI.
Substituting these into the vector formula gives the final matrix form of Rodrigues' formula:

R(w^,θ)=Icosθ+(w^w^T)(1cosθ)+[w^]sinθ

Using the identity for [w^]2, this is more commonly written as:

R(w^,θ)=I+sinθ[w^]+(1cosθ)[w^]2