## 5 Reactive Control for Collision Avoidance
### Collision Prediction within \(k_{p}\) Sample-Steps in the Future  
The robot's velocity command at each sample-step is set for avoiding a collision with an object detected at the moment. In other words, the robot's velocity command is set at every sample-step. Suppose that the robot's velocity vector at sample-step \(k\) is \(\mathbf{v}\in\mathcal{R}^{2}\). We address how to evade the situation where the robot and an objectBoundaryPoint, say \(\mathbf{O}\in\mathcal{R}^{2}\), collide between sample-step \(k\) and \(k+k_{p}\). Here, \(k_{p}>0\) indicates the prediction window size, set by the robot's operator. \(\mathbf{v}_{o}(k)\in\mathcal{R}^{2}\) denotes the velocity of \(\mathbf{O}\in\mathcal{R}^{2}\) at sample-step \(k\). In the collision prediction, one assumes that \(\mathbf{O}\) maintains its velocity as \(\mathbf{v}_{o}(k)\) between sample-step \(k\) and \(k+k_{p}\). This assumption is required, since the robot at sample-step \(k\) needs to set its velocity vector, considering the predicted motion of an object. This assumption is trivial as we set \(k_{p}=1\). However, \(k_{p}=1\) may lead to collision of the robot, since the prediction window size is too short. Let _objectCircle_ define the circle with radius \(r(k)\), centered at an objectBoundaryPoint \(\mathbf{O}(k)\in\mathcal{R}^{2}\). Here, \(r(k)\) denotes the safety margin and is defined in (3). Note that \(r(k)\) is set considering \(\|\mathbf{v}_{o}(k)\|\). No collision happens between sample-step \(k\) and \(k+k_{p}\) if  
\[\|(\mathbf{q}(k)+\mathbf{v}*u*dt)-(\mathbf{O}(k)+\mathbf{v}_{o}(k)*u*dt)\|>r(k) \tag{5}\]  
for all \(0\leq u\leq k_{p}\). Rearranging (5), we obtain  
\[\|\mathbf{q}(k)+(\mathbf{v}-\mathbf{v}_{o}(k))*u*dt-\mathbf{O}(k)\|>r(k) \tag{6}\]  
for all \(0\leq u\leq k_{p}\). As one increases \(u\) in (6) from \(0\) to \(k_{p}\), \(\mathbf{q}(k)+(\mathbf{v}-\mathbf{v}_{o}(k))*u*dt\) generates the straight line segment \(L(\mathbf{q}(k),\mathbf{q}(k)+(\mathbf{v}-\mathbf{v}_{o}(k))*k_{p}*dt)\). Utilizing (6), Lemma 1 follows. The robot's velocity vector is \(\mathbf{v}\in\mathcal{R}^{2}\). Assume that an objectBoundaryPoint maintains its velocity as \(\mathbf{v}_{o}(k)\in\mathcal{R}^{2}\) between sample-step \(k\) and \(k+k_{p}\). Assume that \(\mathbf{q}(k)\in\mathcal{R}^{2}\) is outside the objectCircle centered at \(\mathbf{O}(k)\). Between sample-step \(k\) and \(k+k_{p}\), the robot does not collide with the objectBoundaryPoint, as long as \(L(\mathbf{q}(k),\mathbf{q}(k)+(\mathbf{v}-\mathbf{v}_{o}(k))*k_{p}*dt)\) does not cross the objectCircle centered at \(\mathbf{O}(k)\). Under Lemma 1, the robot can anticipate a collision within \(k_{p}\) sample-steps in the future. The robot examines if its velocity vector \(\mathbf{v}\) meets the following _safety requirement_: \(L(\mathbf{q}(k),\mathbf{q}(k)+(\mathbf{v}-\mathbf{v}_{o}(k))*k_{p}*dt)\)_does not cross the objectCircle, centered at \(\mathbf{O}(k)\). If \(L(\mathbf{q}(k),\mathbf{q}(k)+(\mathbf{v}-\mathbf{v}_{o}(k))*k_{p}*dt)\) does not cross the objectCircle centered at \(\mathbf{O}(k)\), then this implies that the robot's velocity vector \(\mathbf{v}\) avoids collision within \(k_{p}\) sample-steps in the future. If \(L(\mathbf{q}(k),\mathbf{q}(k)+(\mathbf{v}-\mathbf{v}_{o}(k))*k_{p}*dt)\) does not cross the objectCircle centered at \(\mathbf{O}(k)\), then the robot utilizes \(\mathbf{v}\) as the velocity direction for a single sample duration. Note that the robot's velocity vector is reset at every sample-step. For collision avoidance between sample-step \(k\) and \(k+k_{p}\), Lemma 1 uses the following assumption: _Between sample-step \(k\) and \(k+k_{p}\), an objectBoundaryPoint maintains its velocity as \(\mathbf{v}_{o}(k)\in\mathcal{R}^{2}\)._  
This assumption implies that an objectBoundaryPoint maintains its velocity as \(\mathbf{v}_{o}(k)\in\mathcal{R}^{2}\) for \(k_{p}*dt\) seconds. As the sampling interval \(dt\) decreases, \(k_{p}*dt\) decreases. Thus, the above assumption becomes easier to be satisfied.