Lab 7 — Straight Driving, Accurate Turns & Localization¶
Practical focus¶
Use encoder and IMU feedback to correct the drift problem from Lab 1; drive a fixed distance; perform 90° turns; estimate position and heading between known points.
This is the payoff lab
Everything since Week 1 has been building the measurement and control tools needed to solve the problem the students met on day one. Say that out loud — it is the moment the course structure becomes visible to them.
Objectives¶
- Drive a straight line using feedback, and beat your Lab 1 drift figure.
- Execute a repeatable 90° turn.
- Drive a commanded distance and stop accurately.
- Estimate position and heading by dead reckoning between two known points.
Procedure outline¶
TODO — expand.
- Close a heading loop using the IMU, or a wheel-speed-matching loop using encoders — or both.
- Repeat the exact Lab 1 drift test. Same 4 m track, same 5 runs, same measurement.
-
Compare directly against the Lab 1 numbers.
Lab 1 (open loop) Lab 7 (closed loop) Mean drift over 4 m Spread across 5 runs -
Calibrate a 90° turn. Measure the actual angle; correct; repeat until consistent.
- Dead-reckon between two marked points and measure the final position error.
Dead reckoning accumulates error
Every small heading error integrates into a growing position error. Measure how far off the estimate is after 4 m, then after 8 m. The growth is the point — it is why Labs 9 and 10 keep an absolute reference in the loop.
Deliverable¶
Repeatable straight run + controlled turn + simple localization, reported against your Lab 1 baseline.