Module 2 · Line Tracking
Lesson 2-6 · Two-Sensor Line Following — Knowledge ChecksAnswer key
The left sensor reads 0.8 and the right reads 0.2. What is the error, and which way has the robot drifted?
error = 0.8 − 0.2 = +0.6. The high reading is on the LEFT, so the line is off to the robot's left — meaning the robot itself has drifted right of the line. It needs to steer left to get back.
Why does the minus sign from Lesson 2-5 come out of arcade() here?
In Lesson 2-5 a positive error meant 'drifted onto white, steer right', a negative turn, so the correction was negated. With two sensors a positive error means 'drifted right, steer left', which is already a positive turn in arcade(), so the minus comes out.