Chapter 7: Sensors in Robotics
Lesson 1: Proprioceptive vs. Exteroceptive Sensors
This lesson introduces the two fundamental categories of sensors used in robots: proprioceptive sensors that measure the robot’s internal state, and exteroceptive sensors that measure the external world. We formalize both types through measurement models, analyze their information content using observability, and illustrate why real robots rely on both.
1. Sensor Taxonomy and Intuition
A robot is a physical dynamical system with an internal state \( \mathbf{x}(t)\in\mathbb{R}^n \) and control input \( \mathbf{u}(t)\in\mathbb{R}^m \). Sensors provide measurements \( \mathbf{y}(t)\in\mathbb{R}^p \). The key distinction is:
- Proprioceptive sensors: measure quantities internal to the robot (joint position/velocity, motor current, IMU body rates, internal temperatures).
- Exteroceptive sensors: measure the environment or robot’s relation to it (range to obstacles, light intensity, magnetic field, images, GPS).
flowchart LR
S["Sensors in robotics"] --> P["Proprioceptive (internal)"]
S --> E["Exteroceptive (external)"]
P --> P1["Examples"]
P1 --> P11["Encoders (joint position/velocity)"]
P1 --> P12["IMU (gyro/accel)"]
P1 --> P13["Motor current / torque sensors"]
E --> E1["Examples"]
E1 --> E11["Range sensors (ultrasonic, lidar)"]
E1 --> E12["Vision (camera, depth)"]
E1 --> E13["GPS / magnetometer / beacons"]
Intuitively, proprioception tells a robot what it is doing, while exteroception tells it what is around it. Many tasks require both: proprioceptive control for stability and exteroceptive correction for global accuracy.
2. Mathematical Measurement Models
We formalize sensing as a mapping from robot state and environment to measurements. In continuous time,
\[ \mathbf{y}(t)=\mathbf{h}\!\big(\mathbf{x}(t),\mathbf{u}(t),\mathbf{e}(t)\big)+\mathbf{v}(t), \]
where \( \mathbf{e}(t) \) is an external (environment) variable and \( \mathbf{v}(t) \) is measurement noise. We partition \( \mathbf{y} \) as \( \mathbf{y}=[\mathbf{y}_p^\top\ \mathbf{y}_e^\top]^\top \) with:
Proprioceptive measurement model.
\[ \mathbf{y}_p(t)=\mathbf{h}_p\!\big(\mathbf{x}(t),\mathbf{u}(t)\big)+\mathbf{v}_p(t). \]
Exteroceptive measurement model.
\[ \mathbf{y}_e(t)=\mathbf{h}_e\!\big(\mathbf{x}(t),\mathbf{e}(t)\big)+\mathbf{v}_e(t). \]
In discrete time (sampling period \( T_s \)), the dynamics and measurements are commonly written as:
\[ \mathbf{x}_{k+1}= \mathbf{f}(\mathbf{x}_k,\mathbf{u}_k)+\mathbf{w}_k,\qquad \mathbf{y}_k=\mathbf{h}(\mathbf{x}_k,\mathbf{u}_k,\mathbf{e}_k)+\mathbf{v}_k. \]
Here \( \mathbf{w}_k \) is process disturbance. We will study noise and drift in detail in Lesson 5; for now note that proprioceptive sensors often have low noise but can drift in integrated quantities, whereas exteroceptive sensors can correct drift but may be noisier or intermittent.
3. Linearized Models and Information Content
Near an operating point, we approximate dynamics and measurements as linear:
\[ \mathbf{x}_{k+1}=\mathbf{A}\mathbf{x}_k+\mathbf{B}\mathbf{u}_k+\mathbf{w}_k,\qquad \mathbf{y}_k=\mathbf{C}\mathbf{x}_k+\mathbf{D}\mathbf{u}_k+\mathbf{v}_k. \]
Partition the measurement matrix: \( \mathbf{C}=\begin{bmatrix}\mathbf{C}_p\\ \mathbf{C}_e\end{bmatrix} \), giving
\[ \mathbf{y}_{p,k}=\mathbf{C}_p\mathbf{x}_k+\mathbf{D}_p\mathbf{u}_k+\mathbf{v}_{p,k},\qquad \mathbf{y}_{e,k}=\mathbf{C}_e\mathbf{x}_k+\mathbf{D}_e\mathbf{u}_k+\mathbf{v}_{e,k}. \]
Because students know linear control, we use observability to quantify how much state information a sensor set provides.
Definition (Observability). The pair \( (\mathbf{A},\mathbf{C}) \) is observable if the observability matrix
\[ \mathcal{O}= \begin{bmatrix} \mathbf{C}\\ \mathbf{C}\mathbf{A}\\ \mathbf{C}\mathbf{A}^2\\ \vdots\\ \mathbf{C}\mathbf{A}^{n-1} \end{bmatrix} \]
has full column rank \( n \).
Theorem 1 (Adding exteroceptive sensors never reduces observability).
Let \( \mathbf{C}=\begin{bmatrix}\mathbf{C}_p\\ \mathbf{C}_e\end{bmatrix} \). If \( (\mathbf{A},\mathbf{C}_p) \) is observable, then \( (\mathbf{A},\mathbf{C}) \) is observable.
Proof. The observability matrix with both sensor types is \( \mathcal{O}=\begin{bmatrix}\mathcal{O}_p\\ \mathcal{O}_e\end{bmatrix} \), where \( \mathcal{O}_p \) is built from \( \mathbf{C}_p \). If \( \operatorname{rank}(\mathcal{O}_p)=n \), then adding more rows (from \( \mathcal{O}_e \)) cannot decrease rank, so \( \operatorname{rank}(\mathcal{O})=n \). ∎
Corollary. If \( (\mathbf{A},\mathbf{C}_p) \) is not observable, adding suitable exteroceptive sensors may make the pair observable.
This provides a rigorous way to explain why robots often combine internal sensors (good for control) with external sensors (good for global referencing).
4. Example — 1D Robot With Drift
Consider a 1D cart (or mobile base along a line). Define state \( \mathbf{x}_k=[p_k\ v_k]^\top \) (position, velocity) and input \( u_k \) (commanded acceleration). A simple sampled model is
\[ \mathbf{x}_{k+1}= \begin{bmatrix} 1 & T_s\\ 0 & 1 \end{bmatrix}\mathbf{x}_k + \begin{bmatrix} \tfrac{1}{2}T_s^2\\ T_s \end{bmatrix}u_k + \mathbf{w}_k. \]
Suppose we only have a proprioceptive “encoder-like” velocity sensor with bias \( b \):
\[ y_{p,k}=v_k + b + v_{p,k}. \]
If we integrate \( y_{p,k} \) to estimate position, the bias accumulates:
\[ \hat{p}_k = \hat{p}_0 + T_s\sum_{i=0}^{k-1} y_{p,i} = p_k + kT_s b + \text{noise terms}. \]
Hence \( |\hat{p}_k-p_k| \) grows linearly with time if \( b\neq 0 \).
Now add an exteroceptive range-to-beacon measurement:
\[ y_{e,k}=p_k + v_{e,k}. \]
This provides direct information about \( p_k \) and arrests drift. Mathematically, with only velocity measurement: \( \mathbf{C}_p=[0\ 1] \) yields \( \operatorname{rank}(\mathcal{O}_p)=1 < 2 \), so the system is not observable. Adding position measurement \( \mathbf{C}_e=[1\ 0] \) gives \( \operatorname{rank}(\mathcal{O})=2 \).
5. Proprio vs. Extero in State Estimation (Observer View)
A Luenberger observer (from linear control) uses \( \mathbf{y}_k \) to estimate state:
\[ \hat{\mathbf{x}}_{k+1}=\mathbf{A}\hat{\mathbf{x}}_k+\mathbf{B}\mathbf{u}_k+ \mathbf{L}\big(\mathbf{y}_k-\mathbf{C}\hat{\mathbf{x}}_k\big). \]
The estimation error \( \tilde{\mathbf{x}}_k=\mathbf{x}_k-\hat{\mathbf{x}}_k \) satisfies
\[ \tilde{\mathbf{x}}_{k+1}=(\mathbf{A}-\mathbf{L}\mathbf{C})\tilde{\mathbf{x}}_k + \mathbf{w}_k-\mathbf{L}\mathbf{v}_k. \]
If \( (\mathbf{A},\mathbf{C}) \) is observable, we can choose \( \mathbf{L} \) so that \( \mathbf{A}-\mathbf{L}\mathbf{C} \) is stable. The previous example shows that relying only on internal sensing may fail observability, making consistent estimation impossible.
flowchart TD
U["u_k"] --> DYN["Robot dynamics A,B"]
DYN --> X["state x_k"]
X --> CP["Proprio sensors C_p"]
X --> CE["Extero sensors C_e"]
CP --> Y["measurements y_k"]
CE --> Y
Y --> OBS["Observer / estimator"]
OBS --> XH["estimated state x_hat_k"]
XH --> CTRL["Controller"]
CTRL --> U
6. Minimal Implementations (Python, C++, Java, MATLAB/Simulink)
This lesson is primarily conceptual, but we include small simulations to reinforce the difference between internal and external measurements.
6.1 Python (NumPy) — Drift With Only Proprioception
import numpy as np
# 1D robot: x=[p, v]^T
Ts = 0.1
A = np.array([[1, Ts],
[0, 1]])
B = np.array([[0.5*Ts**2],
[Ts]])
# true state
x = np.array([[0.0],
[1.0]])
# proprio velocity sensor bias
b = 0.05
sigma_p = 0.02
sigma_e = 0.05
p_hat_from_proprio = 0.0
N = 200
p_true_hist, p_hat_hist, p_extero_hist = [], [], []
for k in range(N):
u = np.array([[0.0]]) # constant velocity case
w = np.zeros((2,1))
x = A @ x + B @ u + w
# proprio sensor: velocity with bias
y_p = x[1,0] + b + np.random.randn()*sigma_p
p_hat_from_proprio += Ts * y_p
# extero sensor: position
y_e = x[0,0] + np.random.randn()*sigma_e
p_true_hist.append(x[0,0])
p_hat_hist.append(p_hat_from_proprio)
p_extero_hist.append(y_e)
print("Final true position:", p_true_hist[-1])
print("Final proprio-integrated estimate:", p_hat_hist[-1])
print("Final extero measurement:", p_extero_hist[-1])
You should observe the proprio-integrated estimate drifting away from true position due to bias, while the extero measurement stays centered on truth.
6.2 C++ — Sensor Interface Skeleton
#include <iostream>
#include <random>
class Sensor {
public:
virtual double read(double state_p, double state_v) = 0;
virtual ~Sensor() {}
};
class ProprioVelocitySensor : public Sensor {
double bias, sigma;
std::default_random_engine gen;
std::normal_distribution<double> noise;
public:
ProprioVelocitySensor(double b, double s)
: bias(b), sigma(s), noise(0.0, s) {}
double read(double p, double v) override {
return v + bias + noise(gen);
}
};
class ExteroPositionSensor : public Sensor {
double sigma;
std::default_random_engine gen;
std::normal_distribution<double> noise;
public:
ExteroPositionSensor(double s)
: sigma(s), noise(0.0, s) {}
double read(double p, double v) override {
return p + noise(gen);
}
};
int main() {
ProprioVelocitySensor enc(0.05, 0.02);
ExteroPositionSensor rng(0.05);
double p = 0.0, v = 1.0, Ts = 0.1;
double p_hat = 0.0;
for(int k=0;k<200;k++){
p += Ts*v; // true motion
double y_p = enc.read(p, v);
double y_e = rng.read(p, v);
p_hat += Ts*y_p; // drift-prone integration
if(k % 50 == 0){
std::cout << "k=" << k
<< " true p=" << p
<< " proprio p_hat=" << p_hat
<< " extero y_e=" << y_e << "\n";
}
}
}
6.3 Java — Same Idea Using Interfaces
import java.util.Random;
interface Sensor {
double read(double p, double v);
}
class ProprioVelocitySensor implements Sensor {
private final double bias, sigma;
private final Random rng = new Random();
public ProprioVelocitySensor(double bias, double sigma){
this.bias = bias; this.sigma = sigma;
}
public double read(double p, double v){
return v + bias + sigma * rng.nextGaussian();
}
}
class ExteroPositionSensor implements Sensor {
private final double sigma;
private final Random rng = new Random();
public ExteroPositionSensor(double sigma){
this.sigma = sigma;
}
public double read(double p, double v){
return p + sigma * rng.nextGaussian();
}
}
public class SensorDemo {
public static void main(String[] args){
Sensor enc = new ProprioVelocitySensor(0.05, 0.02);
Sensor rng = new ExteroPositionSensor(0.05);
double p=0.0, v=1.0, Ts=0.1, pHat=0.0;
for(int k=0;k<200;k++){
p += Ts*v;
double yP = enc.read(p,v);
double yE = rng.read(p,v);
pHat += Ts*yP;
if(k % 50 == 0){
System.out.println("k="+k+
" true p="+p+
" proprio pHat="+pHat+
" extero yE="+yE);
}
}
}
}
6.4 MATLAB / Simulink — Script + Block Guidance
Ts = 0.1;
A = [1 Ts; 0 1];
B = [0.5*Ts^2; Ts];
x = [0;1];
b = 0.05; sigma_p = 0.02; sigma_e = 0.05;
p_hat = 0;
N = 200;
p_true = zeros(N,1);
p_hat_hist = zeros(N,1);
p_extero = zeros(N,1);
for k=1:N
u = 0;
x = A*x + B*u;
y_p = x(2) + b + sigma_p*randn; % proprio (velocity)
y_e = x(1) + sigma_e*randn; % extero (position)
p_hat = p_hat + Ts*y_p;
p_true(k) = x(1);
p_hat_hist(k) = p_hat;
p_extero(k) = y_e;
end
disp([p_true(end), p_hat_hist(end), p_extero(end)])
Simulink hint: Use a Discrete State-Space block for \( \mathbf{A},\mathbf{B} \); add two measurement blocks: (i) velocity with bias and noise (Sum + Random Number + Constant), and (ii) position with noise. Integrate velocity with Discrete-Time Integrator to visualize drift versus direct position sensing.
7. Problems and Solutions
Problem 1 (Classification): For each sensor below, state whether it is proprioceptive or exteroceptive, and justify in one sentence: (a) joint encoder, (b) IMU gyroscope, (c) LiDAR, (d) camera, (e) motor current sensor.
Solution:
- (a) Proprioceptive — measures internal joint angle/state.
- (b) Proprioceptive — measures body angular rate (internal motion).
- (c) Exteroceptive — measures distance to external surfaces.
- (d) Exteroceptive — measures external light/image patterns.
- (e) Proprioceptive — measures internal actuator effort.
Problem 2 (Observability With Only Proprioception): The 1D model in Section 4 has \( \mathbf{A}=\begin{bmatrix}1 & T_s\\ 0 & 1\end{bmatrix} \). If the only measurement is velocity \( y_{p,k}= [0\ 1]\mathbf{x}_k \), show the pair is not observable.
Solution: The observability matrix is
\[ \mathcal{O}_p= \begin{bmatrix} 0 & 1\\ 0 & 1 \end{bmatrix}, \quad \operatorname{rank}(\mathcal{O}_p)=1 < 2. \]
Therefore the state cannot be uniquely reconstructed from velocity measurements alone. ∎
Problem 3 (Adding Exteroception Restores Observability): Add a position measurement \( y_{e,k}= [1\ 0]\mathbf{x}_k \). Prove that the new sensor set is observable.
Solution: Now \( \mathbf{C}=\begin{bmatrix}0 & 1\\ 1 & 0\end{bmatrix} \). The observability matrix is
\[ \mathcal{O}= \begin{bmatrix} 0 & 1\\ 1 & 0\\ 0 & 1\\ 1 & T_s \end{bmatrix}. \]
The first two rows already form an invertible matrix, hence \( \operatorname{rank}(\mathcal{O})=2 \). Observable. ∎
Problem 4 (Bias-Induced Drift): Let a proprioceptive velocity sensor measure \( y_{p,k}=v_k+b \) with constant bias \( b \). Suppose \( v_k=v \) is constant and position is estimated by integration: \( \hat{p}_k=\hat{p}_0+T_s\sum_{i=0}^{k-1}y_{p,i} \). Derive the position error \( \hat{p}_k-p_k \).
Solution: True position is \( p_k=p_0+kT_s v \). Estimate is \( \hat{p}_k=\hat{p}_0 + kT_s(v+b) \). If \( \hat{p}_0=p_0 \), then
\[ \hat{p}_k-p_k = kT_s b, \]
which grows unbounded with time for \( b\neq 0 \). ∎
8. Summary
We defined proprioceptive sensors as internal-state measurements and exteroceptive sensors as environment-related measurements. Using linear measurement models, we showed via observability that proprioception alone can be insufficient, especially when biases cause drift in integrated quantities. Exteroception provides global referencing that complements internal sensing, motivating the mixed sensor suites seen in real robots.
9. References
- Durrant-Whyte, H., & Bailey, T. (2006). Simultaneous localization and mapping: Part I. IEEE Robotics & Automation Magazine, 13(2), 99–110.
- Hermann, R., & Krener, A.J. (1977). Nonlinear controllability and observability. IEEE Transactions on Automatic Control, 22(5), 728–740.
- Thrun, S. (2002). Robotic mapping: A survey. Exploring Artificial Intelligence in the New Millennium, 1–35.
- Maybeck, P.S. (1979). Stochastic models, estimation, and control, Vol. 1 (sensor modeling foundations). Academic Press (theoretical chapters widely cited).
- Luo, R.C., & Kay, M.G. (1989). Multisensor integration and fusion in intelligent systems. IEEE Transactions on Systems, Man, and Cybernetics, 19(5), 901–931.