Bifalgorithm post · Robotics and AI · A Simple Obstacle-Avoidance Algorithm
Decision Rule
Decision Rule (Robotics and AI · A Simple Obstacle-Avoidance Algorithm) — "The following Python example illustrates a basic decision rule. The distance value i…
Ideas in this flowchart
- A Python example implementing a basic distance-based decision rule
- The rule is implemented by the choose_action function
- The distance value is assumed to come from a working sensor driver
- The function evaluates the distance and selects an action
- Is distance_cm less than 20?
- If the condition is true, return STOP
- If the condition is false, return MOVE_FORWARD
- The example assigns distance the value 15
- The selected action is stored by calling choose_action(distance)
- The program prints the selected action
- Because 15 is less than 20, the expected output is STOP
