\section{Shared Control Algorithms}\label{myalgorithms}

After sensor data is collected every second, the shared control routines are called, which aid in assisting the user with three types of behaviours - Obstacle Avoidance, Wall Following and Collision Avoidance. In the former two assistive modes, the shared control functionality attempts to modify the direction of the wheelchair, if necessary, after the user has issued a command. Hence the user's commands are not directly modified and he or she can also override the commands issued by the controller. This approach maintains the superiority of the user over the wheelchair. Collision Avoidance, however, is in place to ensure the safety of the users and prevents them from moving in the direction of an impending obstacle by ignoring their commands. Obstacle Avoidance and Collision Avoidance are provided by default. Wall Following is an extra functionality that can be activated, provided that there are no obstacles in the path of the wheelchair, since the Obstacle Avoidance capabilities are not fully functional in this mode. Further testing is required to integrate them and verify their synergy in the shared control framework. In all assistive modes, shared control is not active when the wheelchair moves in \textquoteleft{Reverse}' state due to the absence of sensors at the rear of the wheelchair. The assistive behaviours are explained in detail in the following sub-sections.

\input{chap4_4.1.1_oa}

\input{chap4_4.1.2_ca}

\input{chap4_4.1.3_wf}