What Is a Robot? The Sense-Think-Act Loop
Every robot failure traces back to a broken link in the sense-think-act loop — know the loop, know the failure.
🎯 By the end you'll understand
Why feedback is the defining feature of a robot (not motors or software). The four nodes of the sense-think-act loop — sense, estimate, plan, act — and the characteristic failure class living at each one. The latency chain: the hard engineering constraint that runs from photon to motor command. How FollowBot's hardware maps to each node. And why diagnosing a field failure starts with asking "which node broke?" not "what did the code do?"
KEY INSIGHTA robot is a loop, not a machine
An industrial arm that stamps 10,000 parts identically is an impressive machine. The moment it can sense that the part moved and correct for it, it becomes something qualitatively different — a robot.
Most people define robots by what they look like: wheels, arms, sensors, code. That's a mistake. The right definition is architectural. A robot is a closed-loop embodied agent — a system that uses feedback from the world to continuously update its actions. Remove the feedback and you have an open-loop machine. Open-loop machines are precise, cheap, and brittle. Closed-loop robots are messier, harder to build, and can act in a world they don't control.
Every robotics algorithm you will learn in this course — from Kalman filters to DWA planners — exists to solve a problem that only appears inside a closed loop: uncertainty. An open-loop machine doesn't need a filter because it never listens. A robot does. The moment you close the loop, you must deal with noisy sensors, uncertain state, and actuators that don't deliver exactly what you command. The sense-think-act loop is the minimal formal description of that closed-loop architecture.
CORE CONCEPTFeedback changes everything — and introduces everything hard
Here is a concrete way to feel the difference. Imagine you want a differential-drive robot to drive a 2 m straight line.
Open-loop approach: compute "run the left motor at 200 rpm and the right motor at 200 rpm for exactly 3.2 seconds." Hit go. On a fresh battery, on flat tile, the robot ends up roughly right. On carpet, or with a worn motor, or on a 1° slope, it curves. The machine has no way to know it curved; it never looked.
Closed-loop approach: run the motors, read the wheel encoders 100 times per second, compute the estimated displacement, compare to the target, adjust the motor commands. The robot corrects the curve in real time. But now you have problems the open-loop machine never faced: what if the encoder ticks are wrong? What if the heading estimate drifts? What if the planner commands a correction faster than the motors can execute? Every one of these is a failure at a specific node of the loop — and identifying which node is the entire art of robotics debugging.
A control loop running at 10 Hz sees the world ten times per second. At 100 Hz it sees it a hundred times. The physics of the system — how fast the robot can drift off course, how fast the motors respond — determines the minimum useful loop rate. Set it too low and the controller always overcorrects. Set it higher than the sensor can deliver and you're extrapolating, not measuring. This is introduced carefully in Lesson 1.7 (Actuators) and is load-bearing throughout Stage 3.
HOW IT WORKSAnatomy of the loop: four nodes, four failure classes
The sense-think-act loop is usually taught as three nodes. That's pedagogically clean but practically misleading — it collapses "thinking" into one box that actually contains two fundamentally different operations. The four-node model is more honest:
Let's be precise about what each node does and where it can break.
Sense — transducing physical signals to numbers
LIDAR measures time-of-flight of laser pulses and returns range arrays. A camera integrates photons on a 2D sensor grid and returns pixel intensities. An IMU measures acceleration and angular rate via micro-electromechanical structures. A wheel encoder counts magnet transitions as the wheel turns. Every transducer converts a physical quantity into a number — and every transduction introduces noise, quantization, bias, and bounded range. Characteristic failure: sensor saturation. The LIDAR returns inf for a mirror, the camera clips highlights to 255, the encoder wraps at 65535. The value is structurally valid but physically wrong, and downstream nodes have no way to tell without explicit validity checks.
Estimate — inferring state from noisy data
Raw sensor data tells you something happened; state estimation tells you what the robot currently is: its 6-DOF pose, its velocity, whether the tracked person is to the left or right. This node fuses multiple imperfect sensors over time using probabilistic models — Extended Kalman Filters, particle filters, SLAM. The output is a distribution, not a point: a best estimate plus an uncertainty covariance. Characteristic failure: state divergence. When the state estimate drifts far from reality — because the noise model is wrong, a sensor failed silently, or the filter was initialized badly — every downstream decision is made on a lie. The filter might still produce confident-looking numbers. That is exactly what makes it dangerous.
Plan — computing what to do
Given the current state estimate, the planner decides what action achieves the goal: follow the person at 1.2 m, stop if within 0.5 m, recover if person is lost. This includes behavior-level decisions (follow vs. stop vs. search) and geometric decisions (which path avoids the obstacle). The planner consumes the state estimate and produces a target trajectory or velocity. Characteristic failure: planning infeasibility. The planner receives a geometrically impossible goal (the target is inside an obstacle in the map), takes too long to compute (the 300 ms path planning computation races against a 10 Hz control loop), or produces a plan that was valid when computed but is stale by the time the robot executes it.
Act — commanding physical motion
The controller converts the planner's trajectory into motor commands: a left wheel velocity and a right wheel velocity in the differential-drive case. It runs at high frequency (typically 50–200 Hz) and must close the velocity loop in real time. The actuators — brushless DC motors with 3-phase ESC drivers — receive those commands and move. Characteristic failure: actuator saturation. The controller commands a velocity the motor cannot physically deliver. The motor saturates, the commanded and delivered velocities diverge, and if the controller doesn't account for saturation (integrator windup), it will increasingly over-command. The robot lurches, oscillates, or crashes.
Raw sensor data is not robot state. A LIDAR scan is an array of 360 range values — it says nothing by itself about where the robot is in the room. State estimation takes raw data across time, weights it by the sensor's noise model, fuses multiple sources, and produces a posterior distribution over the robot's state. This distinction is load-bearing: sensor saturation failures live at node 1 and are fixed with outlier rejection; state divergence failures live at node 2 and require re-initialization or richer sensor fusion. Conflating them produces wrong diagnoses.
SEE ITInject a failure — watch the cascade
The loop is not a linear pipeline. A failure at one node does not stop there — it propagates. Click each node below to inject its characteristic failure and see what breaks downstream on FollowBot. The goal: the robot is following a person at 1.5 m distance. Pay particular attention to which nodes fail silently vs. noisily.
Notice the asymmetry: Act failures are loud (the robot physically does the wrong thing). Estimate failures are silent (the robot does the right thing relative to a wrong state estimate). This is why robotics practitioners are trained to first ask "is the state estimate correct?" before debugging any behavior anomaly. A confident but wrong EKF is more dangerous than a crashed node, because a crashed node raises an alarm.
CORE CONCEPTThe latency chain: from photon to motor command
The closed loop has a physical clock. From the moment a photon leaves the person's jacket and hits the LIDAR's detector, until the motor responds to the resulting velocity command, time passes. This total latency is the core engineering constraint of mobile robotics. Too long and the control loop becomes unstable.
Here is a representative latency breakdown for FollowBot on a standard laptop-class onboard computer running ROS 2 Humble:
| Stage | Node | Typical latency | Dominant factor |
|---|---|---|---|
| Sensor acquisition | Sense | 1–3 ms | LIDAR integration time; USB/serial DMA |
| Driver → ROS 2 topic | Sense | 2–6 ms | DDS serialization; OS scheduler jitter |
| EKF update | Estimate | 1–4 ms | Matrix inversion (5×5); Python overhead |
| Person tracker update | Estimate | 3–8 ms | DBSCAN clustering on 360 points |
| DWA local planner | Plan | 10–30 ms | Trajectory rollout sampling (200 candidates) |
| Velocity controller | Act | 1–3 ms | PID arithmetic; PWM generation |
| Total (typical) | 18–54 ms | ||
| Total (worst case) | ~100 ms | DDS queue backup + planner spike |
At 1.2 m/s (FollowBot's top speed), 100 ms of latency means the robot acts on sensor data that is already 12 cm stale. For a slow person-following task this is usually manageable. For an arm catching a thrown object, it is catastrophic. The latency chain is the reason control engineers care obsessively about loop rates, and why ROS 2's QoS policies — specifically the deadline setting — exist as first-class concepts rather than debug afterthoughts.
Sense, Estimate, and Act are relatively deterministic: hardware triggers, matrix operations, PID arithmetic. The Plan node is not. A path planner that spikes to 100 ms on a complex obstacle configuration is a timing hazard that the control loop cannot absorb. This is why production systems separate the control loop (Act, 50–200 Hz, hard-realtime) from the planning loop (Plan, 5–20 Hz, soft-realtime) and use separate ROS 2 nodes with explicit rate controls for each. You will implement this architecture for FollowBot in Lesson 1.8.
FOLLOWBOTIntroducing FollowBot: the project thread
Every lesson in this course is grounded in a single concrete robot. FollowBot is a differential-drive mobile robot tasked with one mission: follow a person at a safe distance, in an indoor environment, using onboard sensors and compute only. No GPS. No external tracking.
Why this robot specifically? Because it is simultaneously simple enough to build and hard enough to force every algorithm in the course. A purely open-loop machine could follow a person on rails. FollowBot cannot use rails — it must estimate where the person is, plan around obstacles, and control its motion without knowing the exact state of its actuators. Each of those requirements maps directly to a stage of this course.
The design choices you make in this stage have downstream consequences you will feel in Stage 4. The sensor choices constrain the EKF state vector. The EKF state vector constrains what the person tracker can output. The person tracker output constrains what the DWA planner can accept. Nothing in a well-designed robot is accidental. Stage 1 milestone: URDF built, TF tree complete (map → odom → base_link → laser → camera), sensor topics publishing simulated data in Gazebo, first custom ROS 2 node running.
Here is a minimal ROS 2 node that reads a LIDAR topic and prints the number of valid returns — your first concrete piece of FollowBot code. It compiles and runs on ROS 2 Humble without modification:
import rclpy from rclpy.node import Node from sensor_msgs.msg import LaserScan import math class LidarEcho(Node): def __init__(self): super().__init__('lidar_echo') self.create_subscription( LaserScan, '/scan', self.cb, 10 # depth-10 queue ) def cb(self, msg): # count finite ranges (inf = no return; nan = invalid) valid = [r for r in msg.ranges if not math.isinf(r) and not math.isnan(r)] self.get_logger().info( f'LIDAR: {len(valid)}/{len(msg.ranges)} valid returns' ) def main(): rclpy.init() rclpy.spin(LidarEcho()) # blocks, calls cb each scan rclpy.shutdown() if __name__ == '__main__': main()
Three things to notice in this code. First, rclpy.spin() is the Sense loop — it blocks and calls your callback every time a new /scan message arrives. Second, the validity check (not math.isinf(r) and not math.isnan(r)) is your first sensor-saturation guard — exactly the failure mode from the widget above. Third, the queue depth of 10 is a QoS choice with consequences you will study in Lesson 1.4. Leave it at 1 and messages get dropped under load. Leave it at 100 and you process stale data during spikes. 10 is a reasonable default for a 10 Hz sensor on local loopback — not on a stressed network.
COMPARISONWhat is NOT a robot — and why the boundary matters
The closed-loop definition cleanly excludes things that are sometimes called robots in popular discourse, and includes things that are not:
| System | Senses environment? | Closed-loop feedback? | Verdict |
|---|---|---|---|
| Industrial CNC mill (fixed program) | No | No | Machine, not a robot |
| Industrial CNC mill with force feedback | Yes (force sensor) | Yes | Robot |
| Roomba (original, random-bounce) | Yes (bump sensor) | Yes (reactive) | Simple robot |
| Tesla Autopilot | Yes | Yes | Robot (in the architectural sense) |
| ChatGPT | Yes (text input) | No physical actuation | Agent, not a robot — no embodiment |
| Drone flying a fixed GPS waypoint route | Yes (GPS + IMU) | Yes (stabilization loop) | Robot |
The distinction matters because embodiment is load-bearing. A robot must deal with physics: latency, actuator limits, sensor noise correlated with the physical environment. An LLM agent that calls a web API does not. The algorithms are different because the constraints are different. When AI/robotics papers blur this boundary — "robot learning from language" — track carefully whether the "robot" part is doing the hard physics work or just executing a motion primitive pre-engineered by someone else. Usually the latter.
Within the robot category, there is a second important distinction: purely reactive robots (like early Roomba) have no internal world model — they directly map sensor input to action. Deliberative robots build an internal model and plan ahead. Hybrid architectures (which is what FollowBot uses) run a fast reactive layer (the velocity controller) beneath a slow deliberative layer (the path planner). Most production robots are hybrid. The sense-think-act loop applies to all three; the Estimate and Plan nodes are simplified or absent in pure reactive systems.
WEAKNESSWhere this mental model bites
"The robot is drifting right." That is a behavior description. Without the four-node model, you rerun the PID tuning, try a different planner, add waypoints. With the model, you first ask: which node produced the wrong information? Systematic diagnosis: check the state estimate first (is the pose correct in RViz?), then the plan (is the commanded trajectory correct?), then the actuation (are the wheel velocities being delivered?). In field robotics, skipping to "fix the behavior" without locating the node wastes hours. The mental model's job is to make you systematic before you are curious.
A surprisingly common mistake among engineers coming from software: "the robot is slow in simulation, we'll optimize it before deployment." Latency in the sense-think-act loop is not a performance problem to be optimized later — it is a stability constraint to be satisfied during design. A 200 ms planning cycle running at a 10 Hz control rate is not "a bit slow." It means the robot is acting on state information that is two control periods old, and it will oscillate or diverge under any but the gentlest dynamics. The latency budget must be laid out before the architecture is chosen, not discovered in field trials.
Terminology collision: the four logical nodes of the sense-think-act loop (Sense, Estimate, Plan, Act) are architectural concepts. A ROS 2 "node" is a software process. The two are not one-to-one. In FollowBot's implementation, the Estimate logical node contains at least three ROS 2 nodes (EKF, person tracker, costmap server). The Plan logical node contains the behavior tree executor and the DWA local planner as separate ROS 2 nodes. Conflating them causes architectural confusions that compound when you try to debug timing issues across ROS 2 node boundaries. Use "logical node" and "ROS 2 node" as distinct terms from day one.
KEY INSIGHTHow this connects
- Coordinate Frames and Homogeneous Transforms (1.2) — every vector passed between nodes lives in a coordinate frame; getting the frame wrong makes all four nodes compute correctly but produce garbage. This lesson establishes the grammar the rest of Stage 1 uses.
- ROS 2 Architecture: Nodes, Topics, Services, and Actions (1.4) — the software implementation of the loop: how FollowBot's logical nodes communicate, which QoS policies govern them, and how to diagnose silent failures from QoS mismatches.
- Sensors: Physics, Noise Models, and Failure Modes (1.6) — the deep treatment of every Sense node failure introduced here: LIDAR saturation, camera motion blur, IMU bias, encoder slip. Each sensor's noise model is derived, not assumed.
- FollowBot System Architecture: Requirements to Block Diagram (1.8) — the stage milestone: translating the person-following mission into a formal requirements spec, full node graph, topic graph, and TF tree. Every component in this lesson's block diagram gets a justified role there.
The sense-think-act loop is the organizing principle of the entire course, not just Stage 1. Every algorithm in Stages 2–6 lives at a specific node: kinematics and dynamics at Act, Kalman filters at Estimate, SLAM at the boundary of Sense and Estimate, path planners at Plan. When a new algorithm appears in a later stage, ask first: which node does it improve, and which failure class does it address? That question will always be answerable, and always useful.
GLOSSARYKey terms introduced
- Closed-loop system
- A control architecture in which the system's output is fed back and used to modify future inputs. The defining architectural feature of a robot, as opposed to an open-loop machine.
- Sense-think-act loop
- The four-node architectural model (Sense → Estimate → Plan → Act → World → Sense…) describing how a robot continuously processes information and takes action. Each node has a characteristic failure class.
- State estimation
- The inference of a robot's current state (pose, velocity, environment map) from noisy sensor measurements over time. The Estimate node of the loop; produces a distribution, not a point.
- Actuator saturation
- The condition in which a commanded motor torque or velocity exceeds the physical limit the actuator can deliver. Causes divergence between commanded and delivered motion; triggers integrator windup in PID controllers.
- Latency chain
- The total elapsed time from sensor observation to motor command. The fundamental timing constraint of the control loop; sets the minimum useful control rate and the maximum tolerable planning computation time.
- Integrator windup
- The accumulation of large error in a PID integrator when the actuator cannot respond to large commands, leading to overshoot and oscillation when the error finally reduces. Mitigated by anti-windup clamping.
- Differential-drive robot
- A mobile robot with two independently driven wheels (plus passive casters) whose heading is controlled by the difference in wheel velocities. FollowBot's base platform. Kinematic model derived in Lesson 2.1.
- ROS 2 (Robot Operating System 2)
- A middleware framework providing a distributed message-passing backbone, standardized message types, and a rich ecosystem of algorithms for robotics software. Built on DDS. FollowBot's runtime environment. Architecture covered in Lesson 1.4.
ACTIVE RECALLCheck your understanding
Answer in your own words first, then reveal.
1What is the architectural definition of a robot, and why does it exclude a CNC mill running a fixed G-code program?›
A robot is a closed-loop embodied agent: a system that uses feedback from the physical environment to continuously modify its actions. A CNC mill running fixed G-code is open-loop — it executes a predetermined sequence regardless of what the material does. It has no Estimate or feedback path. Add a force sensor that adjusts feed rate when cutting resistance increases, and you've closed the loop — it becomes a robot by this definition. The distinction matters because closed-loop systems require all four loop nodes (and their associated failure modes), while open-loop machines do not.
2FollowBot is following a person and suddenly starts curving right for no apparent reason. Which loop node do you check first, and why?›
Check the Estimate node first. The symptom — systematic directional error — is the fingerprint of a state divergence failure: the robot believes it is driving straight because its pose estimate is wrong (e.g., a misconfigured EKF with incorrect process noise for heading). Checking the Act node (PID tuning, motor asymmetry) is the intuitive first step but is often wrong. The systematic nature of the curve (consistent direction, not random) rules out sensor saturation (which would produce random spikes) and favors a biased state estimate. Verify by visualizing the robot's pose estimate in RViz and comparing to a ground-truth reference. If the estimate looks straight while the robot curves, you have confirmed the Estimate node is at fault before touching any controller code.
3Why is "sensor saturation" a more dangerous failure than "sensor crash"?›
A sensor crash is detected immediately: the topic stops publishing, the subscriber node logs a warning, the watchdog triggers. Sensor saturation produces structurally valid data that is physically wrong — the LIDAR returns inf (a valid IEEE 754 float), the camera clips pixels to 255 (a valid pixel value). The downstream Estimate node receives the data, passes schema validation, and updates its state belief — with garbage. The failure propagates silently through Estimate into Plan, appearing as a planner or behavior problem, not a sensor problem. This is why production robotics systems build explicit validity checks at the Sense layer (range gating, outlier rejection, confidence thresholds) rather than relying on downstream nodes to discover the corruption.
4The sense-think-act loop is described as "four nodes" here rather than the classic three. What does splitting "think" into "estimate" and "plan" buy you as a practitioner?›
The four-node model makes failure localization unambiguous. In the three-node model, "think" contains both state estimation (probabilistic inference, runs continuously, fails with divergence) and planning (combinatorial search, runs at a lower rate, fails with infeasibility or timeout). These have completely different failure modes, different timing requirements, and different fix strategies. A diverging EKF is fixed by changing the noise model or adding a sensor — nothing in the planner is relevant. A timing-infeasible planner is fixed by simplifying the search or increasing the planning horizon — nothing in the EKF is relevant. The four-node model makes these distinctions first-class rather than buried inside an undifferentiated "think" box.