|
|
In a programming language of your choice, implement the bottom level of the robot controller hierarchy.
Here is one possible solution: input variables: sensor, last_sensor, last_steer, goal output variables: sensor, last_sensor, last_steer, steer
Code:
steer = last_steer;
if (goal == true && sensor < last_sensor) {
steer = !steer;
}
if (goal == false && sensor > last_sensor) {
steer = !steer;
}
last_steer = steer;
last_sensor = sensor;
|
| Main Tools: Graph Searching | Consistency for CSP | SLS for CSP | Deduction | Belief and Decision Networks | Decision Trees | Neural Networks | STRIPS to CSP |