\subsection{Collision Avoidance}\label{caalgo}

When the user commands the wheelchair to move towards the front, left or right directions, his or her command will be executed only if that direction is free from any imminent risk of collision. Since the user's command must be respected at all times except for emergency cases, the thresholds used in this assistive mode were taken as half of the corresponding thresholds used in Obstacle Avoidance. This relates to the condition where the wheelchair would collide with an obstacle within the next second. Hence, if the wheelchair has crossed the safety threshold of collision, the user's command to move in the direction of the obstacle is ignored. Any of the sensors located along the front of the wheelchair detecting an obstacle within the threshold of collision risk, will prevent the wheelchair from moving forward. The decision for moving left or right is made by checking the corresponding corner and side sensors. The user is expected to respond to this blocking behaviour by reversing the wheelchair and adequately adjusting its position to face a direction that is free from the risk of collision.