A stick arm reaches across a table. Move either joint.
Hand (0.71, 1.71). Joints (45°, 45°).
The amber dot is the shoulder. The teal dot is the elbow. The open circle is the hand. Both links have length 1. The shoulder angle is measured from the horizontal. The elbow angle is measured from the first link, so the second link's direction in the room is the sum of the two angles. With the sliders at and , the hand sits near .
Press the toggle. The lower plot is configuration space. Its axes are the two joint angles, and the point is this same pose. The stick arm stays on the canvas. One pose, two pictures.
Sense, decide, act#
A toaster on a timer heats and then stops. It never checks the toast. A robot vacuum measures the room, decides, drives, and then measures again, because the drive made the old reading stale.
The loop closes through the world. Moving the arm invalidates the reading that triggered the move.
The arm above is the act. The joint sliders are the command. The hand position is what a later sensor would have to check.
What the picture is made of#
A joint is the hinge between two rigid links. This arm has two of them, so it has two degrees of freedom. The base does not move. The hand, also called the end effector, is the open circle.
Base, shoulder, link 1, elbow, link 2, and the hand. A joint changes only its own angle.
The workspace is every point that circle can reach. With two links of length 1, that set is the disk of radius 2. A target outside that disk is unreachable.
The workspace is the disk of radius 2. The target outside it has no joint angles that reach it.
Forward kinematics reports the hand from the angles. It does not search for the angles that would hit a target.
Link 2's direction in the room is , because its joint is measured from link 1.
Set the shoulder to and the elbow to . The hand goes to . The same pair is one point in the lower plot when the toggle is on. Many angle pairs can share one hand position. is another way to reach near the lab's target. That is why the configuration point and the hand are not the same object.
Browser lab: move a 2-DOF arm#
The cell is the same arm. The green disk is a target. Change q1_deg and q2_deg, press Run, and compare the printed hand with the widget.
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Circle
l1, l2 = 1.0, 1.0
def forward_kinematics(q1_deg, q2_deg, l1=l1, l2=l2):
q1, q2 = np.radians(q1_deg), np.radians(q2_deg)
elbow = np.array([l1 * np.cos(q1), l1 * np.sin(q1)])
hand = elbow + np.array([l2 * np.cos(q1 + q2), l2 * np.sin(q1 + q2)])
return elbow, hand
q1_deg, q2_deg = 0.0, 90.0
target = np.array([0.7, 1.7])
tolerance = 0.25
elbow, hand = forward_kinematics(q1_deg, q2_deg)
distance = np.linalg.norm(hand - target)
print(f"q1 = {q1_deg:5.1f} deg q2 = {q2_deg:5.1f} deg")
print(f"elbow ({elbow[0]:+.3f}, {elbow[1]:+.3f})")
print(f"hand ({hand[0]:+.3f}, {hand[1]:+.3f})")
print(f"distance to target {target} = {distance:.3f} (tolerance {tolerance})")
print("Inside the target region." if distance <= tolerance
else "Outside the target region - adjust q1_deg or q2_deg.")
fig, ax = plt.subplots(figsize=(5, 5))
ax.add_patch(Circle(target, tolerance, color="tab:green", alpha=0.25, label="target region"))
ax.plot([0, elbow[0]], [0, elbow[1]], "-o", color="tab:blue", lw=3, ms=6, label="links")
ax.plot([elbow[0], hand[0]], [elbow[1], hand[1]], "-o", color="tab:blue", lw=3, ms=6)
ax.plot(hand[0], hand[1], "*", color="tab:red", ms=16, label="hand")
ax.set_xlim(-2.2, 2.2)
ax.set_ylim(-2.2, 2.2)
ax.set_aspect("equal")
ax.grid(alpha=0.3)
ax.axhline(0, color="gray", lw=0.8)
ax.axvline(0, color="gray", lw=0.8)
ax.legend(loc="upper left", fontsize=8)
ax.set_title("2-DOF planar arm")
plt.show()
45 and 45 put the hand inside the disk. 45 and -45 leave the elbow where it is and swing the hand the other way. A target at (2.3, 0) stays outside, because the arm cannot reach past radius 2.
Knowledge Check#
Forward kinematics converts the joint ______ into the hand position.
Which statement about a joint is correct?
You raise the shoulder slider and leave the elbow slider fixed. What changes?
Key takeaways#
- A robot closes a loop through the world. After the arm moves, the old reading is stale.
- Two joints, two links of length 1, one hand. The workspace is a disk of radius 2.
- Forward kinematics turns the joint pair into the hand position. It does not choose the angles.
- Configuration space is the joint pair drawn as a point. It is the same pose as the stick arm.
Where this leads#
The next step on this path is Robots Under Uncertainty. The coordinates in the picture are the vectors of Linear Algebra Week 1. The three-dimensional arm, with matrices, is Robot Learning Week 1. This page does not rewrite that lesson.
Further reading#
- John J. Craig, Introduction to Robotics: Mechanics and Control (4th ed., Pearson, 2018). Chapters 1 and 2.
- Kevin M. Lynch and Frank C. Park, Modern Robotics (Cambridge University Press, 2017). Chapter 4. The preprint is free at modernrobotics.org.
- Peter Corke, Robotics, Vision and Control (2nd ed., Springer, 2017). Chapter 7, and the short videos at robotacademy.net.au.
Reading is free. PDF and ePub unlock with the newsletter. Join once and every lesson opens in this browser.