| Algorithm 1. Avoid Obstacles Pseudocode. |
| AvoidingObstacleAngle = 0; |
| Check the distance measurements of 18 different laser points (6 for left, 6 for front, and 6 for right) that imply a high probability of CornerDetected either in front, left or right; |
| if CornerDetected then |
| AvoidingObstacleAngle = an orthogonal angle towards the detected corner side; |
| else |
| Find nearest obstacle location and distance within laser scanner data; |
| if Nearest Obstacle Distance < Aware of Obstacles Distance then |
| if Nearest Obstacle Distance is too close then |
| do a fixed backwards translation to preserve the robot's integrity; |
| else |
| AvoidingObstacleAngle = an orthogonal angle towards the nearest obstacle location; |
| end |
| else |
| if Any Kins' Distance < Aware of Kin Distance then |
| With 30% chance, do a fixed translation to preserve the robot's integrity; |
| With 70% chance, AvoidingObstacleAngle = an orthogonal angle towards the nearby kin's location; |
| else |
| Do nothing; |
| end |
| end |
| end |
| return AvoidingObstacleAngle; |