Obstacle Evasion
The mobile robot base is programmed to roam randomly within the building. During its wanderings, it utilizes a sonar sensor to detect any obstacles that could potentially collide with it. If the sensor's readings indicate a distance of less than 130mm to an obstacle, the robot halts its movement. It then remains stationary until the distance value alters, indicating a clear path. Upon sensing a change in distance, the robot randomly selects a new direction, either left or right, and resumes its movement. This obstacle avoidance mechanism ensures the robot's safe navigation through the building, minimizing the risk of collisions while it performs its sanitization duties.