Skip to main content
© 2026 ePowerAI — instrumented learning, no login required.
CoursesContact
ePOWERAI
CoursesContact
Robotics Foundations: Sensors, Actions, and Motion
Robot Learning
01Robotics Foundations: Sensors, Actions, and Motion
02Week 1: Robot Modeling and Kinematics
03Robots Under Uncertainty: Estimating Position from Noisy Sensors
04Week 2: Dynamics and State Estimation
05Week 3: Control Fundamentals
06Week 4: Teleoperation and Data Collection
07Week 5: Imitation Learning
08Week 6: Reinforcement Learning for Robotics
09Week 7: Sim2Real Pipelines and IsaacLab
10Week 8: Foundation Models for Manipulation — ACT and Action Chunking
11Week 9: Flow Matching and Diffusion for Robot Policies
12Week 10: Vision–Language–Action Models
13Week 11: Fine-Tuning and Adaptation
14Week 12: Safety, Constraints, and Reliability
15Week 13: Multi-Robot and Multi-Task Learning
16Week 14: Sim2Real Capstone
Week 00· Robot Learning· Foundations19 min read

Robotics Foundations: Sensors, Actions, and Motion

Learning Outcomes
  • Describe the sense → decide → act loop, and explain why it must pass back through the world
  • Name the parts of a robot arm — base, links, joints, end effector — and describe where its workspace is
  • Predict which way a 2D arm's hand moves when one joint angle changes
  • Run and modify a forward-kinematics simulation, and say in one sentence what forward kinematics reports
Prerequisites

Nothing here is assumed beyond reading a point on a coordinate graph, such as (0.7, 1.7)(0.7,\ 1.7)(0.7, 1.7), and being willing to change two numbers in a browser cell and press Run.

No calculus, no matrices, no robotics, no hardware, no local install. The only trigonometry used is one sentence long: an arrow of length 1 pointing at angle θ\thetaθ ends at the point (cos⁡θ, sin⁡θ)(\cos\theta,\ \sin\theta)(cosθ, sinθ), so cos⁡θ\cos\thetacosθ is how far right it reaches and sin⁡θ\sin\thetasinθ is how far up. The figures put that picture before any formula.

What makes a machine a robot?#

A toaster on a timer is not a robot. It acts — it heats for however many minutes the dial says — but it never checks whether the toast came out burnt. Nothing measures the result, so nothing can notice that the command was wrong.

A robot vacuum is a robot, and the reason is a loop rather than a better motor. It measures the room with bumpers and infrared distance sensors. It decides what to do next from those measurements. It drives its wheels. Then, because the wheels moved it, the old measurements are out of date, so it measures again and decides again.

The sense, decide, act loop: sensors feed a decision, the decision drives motors, the motors change the world, and the changed world is what the sensors read next

The loop closes through the world. Acting is never the end of the story — it invalidates the reading that triggered the action.

Sense. Sensors turn physical quantities into numbers: a distance in meters, a count of wheel rotations, pixel brightness values. This is the only channel through which the robot can know anything about the world, and every sensor is imperfect — finite range, finite update rate, and noise.

Decide. A policy picks the next action from the current numbers. The policy can be a one-line rule (if the front bumper is pressed, stop and turn left) or a neural network trained on millions of examples. Both occupy the same slot; the difference is only how the mapping from measurement to action was written.

Act. Motors change the world: wheels turn, joints rotate, grippers close. This is the only stage where the robot has any physical effect, and it is also what makes the loop necessary — the action changes the very quantity the sensor was reading.

The load-bearing part is not any one box but the arrow from act back to sense. Control engineers call a system open-loop when it acts without measuring the result, and closed-loop when the effect of the action is measured and used to decide again. A machine becomes a robot when it closes that loop.

Two consequences follow, and both shape the rest of this lesson. First, a robot cannot trust its own commands: a wheel slips, a joint stops against its limit, a person moves the object being carried. Measuring after acting is the only way to find out. Second, to compare what it intended with what it sensed, the robot needs a model of its own body — how long its links are, which way its joints point, where its hand ends up once the joints are set. That model is the subject of the next two sections.

Exercise · Multiple choice

Which property turns a machine that acts into a machine that is a robot?

It has electric motors
It measures the result of its own actions and uses that measurement to decide again
It runs a neural network
It is expensive

A robot arm in 2D: base, links, joints, and end effector#

The simplest useful robot is an arm, and the simplest arm lives in a flat plane. Everything here carries over to a six-joint industrial arm in three dimensions; the planar version is the one you can check by eye.

An arm is a chain of rigid segments, described by four words.

  • The base is the part fixed to the world — bolted to a table, a floor, or a mobile platform. Every measurement is made relative to the base.
  • A link is a rigid segment. It cannot bend, stretch, or change length; its whole job is to hold the next joint a fixed distance away.
  • A joint is the movable connection between two links. A revolute joint is a motorized hinge: it rotates, and one number — its angle — describes it. Each independent angle is a degree of freedom (DOF), so an arm with two revolute joints is a 2-DOF arm.
  • The end effector is whatever sits at the tip: a two-finger gripper, a suction cup, a welding torch. It is the part that touches the world, so tasks are usually stated in terms of it — put the end effector here.

A two-link planar arm: the base is bolted at the bottom, link 1 rises to the elbow joint, link 2 carries the end-effector gripper at the top right

Base, joint 1 (the shoulder), link 1, joint 2 (the elbow), link 2, and the end effector. Read it with one constraint in mind: a joint can change only its own angle. It cannot move the base, and it cannot stretch a link.

Turning joint 1 therefore swings everything above it — link 2 and the hand included. Turning joint 2 changes only the angle between the two links, which leaves the elbow where it is and swings the hand around it.

Angles. Every angle is measured from the positive xxx-axis of the base frame, counterclockwise positive. Joint 2's angle is the exception worth marking now: it is measured from link 1, not from the xxx-axis. That detail decides the formula in the next section. All angles in this lesson are in degrees.

Exercise · Fill in the blank

In the diagram above, the rigid segment that connects joint 1 to joint 2 is a ______.

Where can the hand go? The workspace is the set of positions the end effector can reach with some joint angles. Two limits bound it. The farthest the hand can be from the base is l1+l2l_1 + l_2l1​+l2​, with both links straight in a line. The closest it can be is ∣l1−l2∣|l_1 - l_2|∣l1​−l2​∣, with the links folded back on each other — which is 000 when the links are equal. For our arm, l1=l2=1l_1 = l_2 = 1l1​=l2​=1, so the workspace is a disk of radius 2 centered on the base.

The reachable workspace as a dashed disk of radius 2 around the base, with a reachable target inside it and an unreachable target outside it

The workspace is everything within one link-pair length of the base. The target outside the dashed circle has no joint angles that reach it.

A target outside that disk is unreachable: no joint angles place the hand there, and running the motors harder does not change that. This is worth internalizing before writing any control code, because a controller that does not know its own workspace will cheerfully command the arm toward an impossible target, drive both joints into their limits, and report nothing worse than still not there.

Exercise · Multiple choice

With both links of length 1, which target position can the end effector never reach?

(0.5, 0.5)
(2.3, 0.0)
(1.0, 1.0)
(0.0, 1.0)

From joint angles to hand position: forward kinematics#

Here is the question a robot must answer constantly, thousands of times a second: given the two joint angles, where is the hand? The answer is a function called forward kinematics.

Build it in two steps. Start with one link. Joint 1 sits at the base at angle θ1\theta_1θ1​, so the far end of link 1 — the elbow — is at

elbow=(l1cos⁡θ1, l1sin⁡θ1).\text{elbow} = (l_1 \cos\theta_1,\ l_1 \sin\theta_1).elbow=(l1​cosθ1​, l1​sinθ1​).

That is the one piece of trigonometry: cos⁡θ1\cos\theta_1cosθ1​ is the horizontal part of link 1 and sin⁡θ1\sin\theta_1sinθ1​ is the vertical part. At θ1=0∘\theta_1 = 0^\circθ1​=0∘ the elbow is (l1,0)(l_1, 0)(l1​,0), pointing right; at θ1=90∘\theta_1 = 90^\circθ1​=90∘ it is (0,l1)(0, l_1)(0,l1​), straight up.

Now add link 2, and with it the one trap in the whole idea. The angle θ2\theta_2θ2​ is measured from link 1, not from the xxx-axis — the detail flagged in the previous section. So link 2's direction in the world is θ1+θ2\theta_1 + \theta_2θ1​+θ2​. If θ1=0∘\theta_1 = 0^\circθ1​=0∘ and θ2=90∘\theta_2 = 90^\circθ2​=90∘, link 2 points straight up; if θ1=90∘\theta_1 = 90^\circθ1​=90∘ and θ2=90∘\theta_2 = 90^\circθ2​=90∘, link 2 points left, along 180∘180^\circ180∘. The second link's direction depends on both angles, and that is exactly what makes an arm a chain rather than two independent pointers.

Geometry of a two-link arm: link 1 leaves the base at angle theta-1, and link 2 leaves the elbow at the absolute angle theta-1 plus theta-2, with dashed lines projecting the hand position onto the x and y axes

Link 1's absolute angle is θ1\theta_1θ1​; link 2's absolute angle is θ1+θ2\theta_1 + \theta_2θ1​+θ2​, because its joint angle is measured from link 1. The hand is the elbow plus link 2's contribution.

The hand is the elbow plus link 2's own contribution, which gives the two formulas:

x=l1cos⁡θ1+l2cos⁡(θ1+θ2),y=l1sin⁡θ1+l2sin⁡(θ1+θ2).x = l_1\cos\theta_1 + l_2\cos(\theta_1+\theta_2), \qquad y = l_1\sin\theta_1 + l_2\sin(\theta_1+\theta_2).x=l1​cosθ1​+l2​cos(θ1​+θ2​),y=l1​sinθ1​+l2​sin(θ1​+θ2​).

Read them as one sentence: each link contributes its length times the cosine and sine of its absolute angle — θ1\theta_1θ1​ for link 1, and θ1+θ2\theta_1 + \theta_2θ1​+θ2​ for link 2.

Worked example. Take unit links, l1=l2=1l_1 = l_2 = 1l1​=l2​=1, and the pose θ1=0∘\theta_1 = 0^\circθ1​=0∘, θ2=90∘\theta_2 = 90^\circθ2​=90∘. The elbow is

elbow=(1⋅cos⁡0∘, 1⋅sin⁡0∘)=(1, 0),\text{elbow} = (1\cdot\cos 0^\circ,\ 1\cdot\sin 0^\circ) = (1,\ 0),elbow=(1⋅cos0∘, 1⋅sin0∘)=(1, 0),

and since θ1+θ2=90∘\theta_1 + \theta_2 = 90^\circθ1​+θ2​=90∘,

x=1⋅1+1⋅cos⁡90∘=1,y=1⋅0+1⋅sin⁡90∘=1.x = 1\cdot 1 + 1\cdot\cos 90^\circ = 1, \qquad y = 1\cdot 0 + 1\cdot\sin 90^\circ = 1.x=1⋅1+1⋅cos90∘=1,y=1⋅0+1⋅sin90∘=1.

The hand is at (1,1)(1, 1)(1,1). Check that by eye before trusting the formula: link 1 lies along the xxx-axis to the point (1,0)(1,0)(1,0), and then link 2 points straight up for one unit to (1,1)(1,1)(1,1). The browser lab starts in exactly this pose, so its printout can be compared against your own arithmetic.

A second pose worth doing by hand is θ1=45∘\theta_1 = 45^\circθ1​=45∘, θ2=45∘\theta_2 = 45^\circθ2​=45∘. Then θ1+θ2=90∘\theta_1 + \theta_2 = 90^\circθ1​+θ2​=90∘ and cos⁡45∘≈0.707\cos 45^\circ \approx 0.707cos45∘≈0.707, so the hand lands at (0.707, 1.707)(0.707,\ 1.707)(0.707, 1.707). That is the pose that satisfies the lab's task.

Predicting the direction. Both joints turn counterclockwise as their angle increases, but they pivot about different points, and knowing which is which lets you predict the picture before running it. Increasing θ1\theta_1θ1​ rotates the whole chain counterclockwise about the base — with the arm drawn above, the hand swings up and to the left. Increasing θ2\theta_2θ2​ leaves the elbow fixed and swings the hand counterclockwise about the elbow. If a plot ever shows increasing θ2\theta_2θ2​ moving the elbow, the code is not computing what this section describes.

Exercise · Multiple choice

The arm is at q1 = 0 degrees, q2 = 90 degrees, with the elbow at (1, 0) and the hand at (1, 1). You increase q1 to 20 degrees and leave q2 at 90 degrees. Which way does the hand move?

It moves straight up and the elbow stays put
It swings counterclockwise about the base, moving left and up
It swings clockwise about the base, moving right and down
It does not move; the change is absorbed by the second joint

What forward kinematics does and does not do#

It is single-valued: one pair of angles gives exactly one hand position. Nothing is searched, nothing is iterated, there is no ambiguity — which is why a robot can evaluate it constantly and treat the result as ground truth about its own body.

It is only as good as the model. Link lengths and zero-angle offsets come from calibration. If l2l_2l2​ is wrong by a centimeter, the formula reports a hand position that is wrong by a centimeter, with complete confidence. That error is not found by more computation; it is found by measuring the real hand and comparing.

It is cheap and smooth: built from cosines and sines, it costs microseconds, and how sensitively the hand responds to a small change in each angle is also cheap to compute. That is what lets a learning system push a gradient from an error in the hand position back into the joint angles, which is why kinematics stays inside modern robot-learning pipelines rather than being pre-processed away.

And it does not answer the reverse question. Which angles put the hand at this target? is inverse kinematics: harder, because a reachable target may have several valid answers. With unit links, the point (0.707, 1.707)(0.707,\ 1.707)(0.707, 1.707) is reached by (45∘,45∘)(45^\circ, 45^\circ)(45∘,45∘) and also by (90∘,−45∘)(90^\circ, -45^\circ)(90∘,−45∘) — two different poses, one hand position. The second one is worth checking in the lab. This lesson stays on the forward side; the advanced robot-learning week on kinematics takes up the reverse direction and the mathematics behind it.

Browser lab: move a 2-DOF arm#

The cell below is the entire simulation: two angles go in, the hand position comes out, and the arm is drawn. It defines its own forward-kinematics function and imports nothing but numpy and matplotlib, so it stands alone.

Work through it in this order.

  1. Predict first. For θ1=0∘\theta_1 = 0^\circθ1​=0∘, θ2=90∘\theta_2 = 90^\circθ2​=90∘ you computed (1,1)(1, 1)(1,1) above. Run the cell unchanged and check that the printout agrees with your arithmetic.
  2. Satisfy the task. The green circle is the target region. Set q1_deg and q2_deg to 45 and 45, run again, and confirm the hand is inside the region with a distance of about 0.01.
  3. Bend the other way. Set q1_deg = 45 and q2_deg = -45. Predict which part moves before you run it. The elbow should stay at (0.707, 0.707)(0.707,\ 0.707)(0.707, 0.707) while the hand swings to the right: a negative θ2\theta_2θ2​ bends the elbow the opposite way.
  4. Find a second solution. Find another angle pair that puts the hand inside the target region. The pair (90,−45)(90, -45)(90,−45) works — check it.
  5. Test the workspace. Change target to np.array([2.3, 0.0]), leave the tolerance at 0.25, and run. Even with both links straight, the distance never drops below about 0.300, because the target lies outside the disk of radius l1+l2=2l_1 + l_2 = 2l1​+l2​=2.
python · runs in browser
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Circle

l1, l2 = 1.0, 1.0   # link lengths, in the same units as the plot

def forward_kinematics(q1_deg, q2_deg, l1=l1, l2=l2):
    """Joint angles in degrees -> (elbow, hand) positions in the plane."""
    q1, q2 = np.radians(q1_deg), np.radians(q2_deg)
    elbow = np.array([l1 * np.cos(q1), l1 * np.sin(q1)])
    # q2 is measured from link 1, so link 2's world angle is q1 + q2.
    hand = elbow + np.array([l2 * np.cos(q1 + q2), l2 * np.sin(q1 + q2)])
    return elbow, hand

# The pose you control - change these two numbers and press Run again.
q1_deg, q2_deg = 0.0, 90.0

# The task: get the hand inside this target region.
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.")
print("Notice: forward kinematics gives one hand position per angle pair - "
      "it is a report, not a search.")

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()

What the printout means. The elbow and hand lines are forward kinematics made concrete: the hand line is the formula evaluated for the two angles you set, and the distance line compares that prediction against the task. The double-check to train is arithmetic first, printout second — if the two disagree, one of them is wrong and the model needs fixing before it is trusted.

Reading the picture. The plot uses equal axis scaling, so one unit to the right is the same length as one unit up and the arm's shape is not distorted. The blue polyline is the chain, the red star is the hand, and the green disk is the tolerance around the target. When the star is inside the green disk, the printed distance is at most the tolerance — the picture and the number are two views of the same computation.

Why representations matter for AI and robotics#

Everything above is a choice of representation. The arm's state can be written as two joint angles, (θ1,θ2)(\theta_1, \theta_2)(θ1​,θ2​), or as one hand position, (x,y)(x, y)(x,y). Both describe the same physical arm, and forward kinematics is the map from the first to the second.

That choice decides what is easy, and the consequence propagates straight into the AI. In joint angles, computing the hand position is trivial and choosing angles to reach a target is a search. In hand coordinates, stating the goal is trivial — be at this point — and every policy must handle the harder inverse problem internally. A robot vacuum reasons about a grid and a pose; a grasping policy often outputs an end-effector pose; a walking controller outputs joint torques. These are not different kinds of robot. They are the same sense → decide → act loop written in different coordinates, and the coordinate system is what decides whether the decision is a simple mapping or a hard search.

The loop also explains why the sense side carries as much risk as the decide side. The hand position this lesson computes is true only if the angles are known — but angles arrive from encoders, encoder readings are noisy, and the base may have shifted. Forward kinematics can be no better than the state it is handed. Estimating a state from imperfect measurements is the next problem, and the next lesson in this track.

Knowledge Check#

Check the vocabulary and the one formula before moving on.

Exercise · Fill in the blank

Forward kinematics converts the joint ______ into the end-effector position.

Exercise · Multiple choice

Which statement about a joint is correct?

It is a rigid segment that holds the next joint at a fixed distance
It is the movable connection between two links; a revolute joint rotates about one axis
It is the part at the tip that touches the world
It is the set of all positions the hand can reach
Exercise · Multiple choice

With both links of length 1, q1 = 0 degrees and q2 = 90 degrees, forward kinematics reports the hand at:

(0, 1)
(1, 1)
(1, 0)
(1.41, 1.41)

Practical task#

Do this in the lab cell above, then move on.

  1. Reach the target. Set the two angles so the printout reports a distance of at most 0.25. Record the angles and the hand position. One pair that works is (45∘,45∘)(45^\circ, 45^\circ)(45∘,45∘) giving (0.707, 1.707)(0.707,\ 1.707)(0.707, 1.707); find a second pair as well.
  2. Find the wall. Point the target at np.array([2.3, 0.0]) with the tolerance at 0.25 and run again. Report the smallest distance you can reach; it should be about 0.300.
  3. Explain it. In one sentence, say what forward kinematics reports and what it does not.

You are done when step 1 prints a distance inside the tolerance, step 2 cannot get below about 0.300, and your sentence says something equivalent to: forward kinematics turns the joint angles into the end-effector position; it does not choose the angles needed to reach a target.

Key takeaways#

  • A machine is a robot when it closes the loop: sense, decide, act, then sense the changed world. Acting invalidates the previous measurement, so the loop never stops.
  • An arm is a chain of links joined by joints, anchored at a fixed base, ending in an end effector. Each joint adds one degree of freedom — one angle a motor can command.
  • The workspace is the set of reachable hand positions. For two unit links it is a disk of radius 2, and targets outside it are unreachable no matter how the joints move.
  • Forward kinematics is x=l1cos⁡θ1+l2cos⁡(θ1+θ2)x = l_1\cos\theta_1 + l_2\cos(\theta_1+\theta_2)x=l1​cosθ1​+l2​cos(θ1​+θ2​) and y=l1sin⁡θ1+l2sin⁡(θ1+θ2)y = l_1\sin\theta_1 + l_2\sin(\theta_1+\theta_2)y=l1​sinθ1​+l2​sin(θ1​+θ2​): each link contributes its length times the cosine and sine of its absolute angle. Joint 2's angle is measured from link 1, so its absolute direction is θ1+θ2\theta_1 + \theta_2θ1​+θ2​.
  • It reports where the hand is — single-valued, cheap, and only as accurate as the calibrated model. It does not choose the angles needed to reach a target; that reverse direction is inverse kinematics.

Where this leads#

The next step in this beginner track is Robots Under Uncertainty: Estimating Position from Noisy Sensors. It takes the sense side of the loop seriously: why a sensor reading is not the truth, and how a prediction and a measurement combine into an estimate. The mathematics now within reach is Linear Algebra Week 1: Vectors and Linear Combinations, which turns the coordinates used here into a general tool.

For the full three-dimensional treatment — screw axes, Jacobians, and singularities — continue to Robot Learning Week 1: Robot Modeling and Kinematics. It assumes matrices and calculus; this lesson is the part of it you can do with a graph and two numbers.

Further reading#

  • John J. Craig, Introduction to Robotics: Mechanics and Control (4th ed., Pearson, 2018). Chapters 1–2 introduce manipulators, joints, and forward kinematics using no more mathematics than this lesson.
  • Kevin M. Lynch and Frank C. Park, Modern Robotics: Mechanics, Planning, and Control (Cambridge University Press, 2017). Chapter 4 is the rigorous treatment of forward kinematics; the preprint is free at modernrobotics.org.
  • Peter Corke, Robotics, Vision and Control (2nd ed., Springer, 2017). Chapter 7 covers arm kinematics with runnable examples, and the companion Robot Academy hosts free short videos.
  • Stuart Russell and Peter Norvig, Artificial Intelligence: A Modern Approach (4th ed., Pearson, 2020). Chapter 25 frames robots as agents that sense, plan, and act — the loop in the first section.
Next →
Week 1: Robot Modeling and Kinematics
On this page
  • What makes a machine a robot?
  • A robot arm in 2D: base, links, joints, and end effector
  • From joint angles to hand position: forward kinematics
  • What forward kinematics does and does not do
  • Browser lab: move a 2-DOF arm
  • Why representations matter for AI and robotics
  • Knowledge Check
  • Practical task
  • Key takeaways
  • Where this leads
  • Further reading