order to perform a simple task.

Line Follower
-------------

The line following robot is basically a robot, which given an environment with a marked path (i.e. a line), is able to follow exactly that path. It requires the use of one or more sensors, which is able to perceive what is beneath the robot. I have implemented a version using two Lego light sensors. By putting these sensors close to the floor, the robot is able to see whether it is moving on a line which is distinguishable from the rest of the floor (e.g. black line on white floor).

The two sensors are placed so that if the agent is on the line, both sensors will show bright values. Once the path is turning, one of the sensors will begin to read darker values, something the agent should react to.

The implementation basically consists of the following three lines (plus a few rules, which could have been explicitly written in each plan[^3]):

    +!move : light(S1, V1) & light(S2, V2) 
             & distinct_sensors(S1, S2) & on_line(V1, V2)
             <- forward([a,b],[60,60]); !!move.
    +!move : light(1, V1) & light(2, V2) & turning(V1,V2)
             <- rotate([a,b],[-30,15]); !!move.
    +!move : light(1, V1) & light(2, V2) & turning(V2,V1)
             