04 Perception and state

Home | Previous: 03 Dynamics and Feedback | Next: 05 Training Neural Policies

The state is everything needed to predict the world’s future given an action. The observation is what sensors reveal. A camera cannot directly show an object’s hidden side, friction, or exact velocity. Learning often happens under partial observability.

From 3D to pixels

For a point expressed in camera coordinates, an ideal pinhole camera gives

are focal lengths in pixel units and is the principal point. Doubling depth halves displacement from the principal point when stay fixed. Real cameras require distortion calibration; a planar image location alone does not determine depth.

A point 0.3 m off the optical axis with px: its offset is 180, 90 and 45 px at depths of 1, 2 and 4 m. Points at , and m share one ray and one pixel. Source: Tools/animations/ch04_pinhole_projection.py.

You need intrinsic calibration for the camera’s imaging model and extrinsic calibration for its pose relative to the robot. Confusing those two leads to systematic reaching errors. Existing notes on Object Detection and Segmentation and Convolutional Neural Networks fit here.

Estimation combines measurements with prediction

A simple linear model is

is process noise and is measurement noise. For a scalar estimate with prior variance and measurement variance , the Kalman gain is . The update is with posterior variance under the scalar Gaussian assumptions.

If the measurement is noisy, is large and you trust it less. If the prediction is uncertain, is large and the measurement matters more. Learned perception also has uncertainty, but a network’s softmax output is not automatically a calibrated probability of physical correctness.

bayes_update.png

Illustrative scalar Gaussian prior, likelihood, and posterior.

The scalar update as and change, with prior mean and measurement . The numbers differ from the exercise below, so the exercise is still yours. Source: Tools/animations/ch04_kalman_update.py.

Ten predict-then-update cycles for a robot commanded +1 per step, with and . Each predict adds to the variance and each update shrinks it; settles at , the positive root of , and the gain at . Source: Tools/animations/ch04_kalman_filter.py.

What this means for a policy

Stacking recent images and joint states can reveal motion a single frame hides. A recurrent model can summarize a longer history. Neither guarantees that hidden physical quantities are identifiable. A transparent cup, occluded gripper, or shifted camera may create ambiguity that more training cannot fully remove without additional sensing.

Exercise: a prior mean of 0 has variance 4; a measurement of 3 has variance 1. Find the posterior mean and variance.

In your experiments, log camera pose, resolution, exposure changes, timestamp alignment, and whether proprioception (the robot’s own joint measurements) is supplied. For manipulation perception and geometry, see MIT Robotic Manipulation.