RL Robotics LabSearch ↗
Lesson / authored

Week 18 · Learn: A landmark adds independent information

Session 1 of 4 · Correct drift · Phase 5

Plan about 15 minutes for explanation, 30 minutes for practical work and 10–15 minutes for documentation. A longer build may continue into the next session: stop safely, commit the current state and record the next check. Desktop simulations count as software evidence; label them clearly and record physical validation separately.

Engineering challenge

When does a known landmark improve position, and when can it mislead you? This session focuses on a landmark adds independent information.

Before you start

The previous week’s recorded baseline and Week 17, Improve. For later sessions this week, retain the preceding session’s files and predictions.

Equipment: Desktop Python, editor, paper and ruler; for physical work, the configured 3pi+ 2040, clear floor mat and hardware checklist. Week 3 additionally uses the separate low-voltage LED circuit described in its procedure.

For any motion, verify the stop button, short time limit and clear floor area first. Keep the wheels raised for a new device program until its commands and stop behaviour are checked. A hazard or uncertain input is a reason to stop and document, not to force the trial to finish.

Theory and mathematics

A landmark adds independent information

A landmark has a known position in the course map and a detectable signature. A floor line can constrain position perpendicular to that line, but usually does not determine location along it. Seeing dark material alone does not identify which line you crossed. Use route context, an expected crossing window and a distinct pattern to reduce ambiguity. This course uses measured floor landmarks and stopped ruler checks; it does not promise camera-based mapping or precise indoor GPS. Record how you surveyed each landmark and its uncertainty.

Worked example — illustrative values

A known line at x = 0.50 m is observed when estimated x = 0.54 m. With α = 0.5, x_new = 0.54 + 0.5(0.50 − 0.54) = 0.52 m. y and heading remain unchanged. This calculation assumes the centre offset has already been accounted for and the line identity is correct.

Write the calculation in your notebook before running code. State which values you measured, which you assumed and which the program calculates. A correct numerical calculation cannot rescue an incorrect physical assumption.

Run and explain the model

The following is desktop Python, not a ready-to-run motor program. Download this week’s example, save it in your student repository and run python3 code/w18.py from the repository root. The same small model is reused across the week so you can learn it, build with it, test it and revise it.

# Desktop Python teaching example. Numerical inputs are illustrative.
def correct_x(x_est, landmark_x, alpha, expected, fresh, gate_m=0.08):
    if not 0 <= alpha <= 1:
        raise ValueError("alpha outside [0, 1]")
    residual = landmark_x - x_est
    if not expected or not fresh or abs(residual) > gate_m:
        return x_est, "rejected"
    return x_est + alpha * residual, "accepted"

for case in [(0.54, True, True), (0.8, True, True), (0.54, False, True)]:
    x, expected, fresh = case
    print(correct_x(x, 0.5, 0.5, expected, fresh))

Predict the example’s output by hand. Mark the inputs, units and assumptions; explain where this model could fail. If an exception appears, read its final line, identify the input or assumption that caused it and make the smallest explained correction. Do not delete validation merely to obtain output.

Understanding the model and its limits

The gate rejects a correction unless landmark identity is expected, the reading is fresh and the coordinate residual lies within the declared window. Accepted corrections blend only x. With α=0, detection changes no estimate; with α=1, it trusts the known coordinate fully. A large residual could mean accumulated drift, but could also mean the wrong line was associated. The gate is a heuristic, not a complete probabilistic estimator. Record acceptance/rejection reasons and check a separate surveyed checkpoint afterward. Reusing the correction line as the only accuracy test would force the desired answer by construction.

Practical instructions

  1. Survey one known floor line and an independent checkpoint with a ruler.
  2. Draw the line, centre/sensor offset and direction of crossing.
  3. Explain which coordinate the observation constrains and which remain unknown.
  4. Design an identity rule using route context and a distinctive pattern.

Experiment

Move a paper pose parallel to a line: explain why the same detection cannot determine its coordinate along the line.

Before testing, record your prediction, changed factor, measured response, fixed conditions and stopping rule. Save every attempted run, including failures, with a condition and source version. If hardware is unavailable, use an explicitly labelled synthetic/replay dataset and list the physical question it cannot answer. Do not invent completed trials.

Deliverable

A surveyed map and an observability explanation that does not claim full pose from one line.

Save notebook/w18-s1.md, the relevant code revision, raw CSV or test-case records, and one labelled diagram/plot/table. Link the files relatively from your notebook. Use the entry template and report guide.

Completion criteria

A documented failed prediction can meet the learning criteria. A missing physical trial must remain marked untested; software success alone does not validate the robot.

Reading and video

Reflection and next step

Which assumption most affected your result? Point to one observation that supports your explanation and one alternative explanation the evidence has not ruled out. Write a specific next test with a changed factor and measurable outcome, then proceed through the week’s Learn → Build → Experiment → Improve cycle.

← Previous sessionCourse roadmapNext session →