## 2 Materials and Methods
### Obstacle Avoidance System  
The obstacle avoidance system utilized sensor data from the Multi-Ranger Deck to detect obstacles in the front, back, left, and right directions. Unlike autonomous navigation systems that follow a predetermined path, this drone only moves in response to user hand gestures. While executing a commanded movement, the drone continuously scans its surroundings. Let the drone be situated in a 3D space with its local coordinate system aligned such that the front direction corresponds to the positive \(x\)-axis and left to the positive \(y\)-axis. To assess the proximity of obstacles, the system defines directional obstacle distances by \(\rho_{d}\in\{\rho_{F},\,\rho_{B},\,\rho_{L},\,\rho_{R}\}\) indicating the measured distances to obstacles in the front, back, left, and right directions. These distances are obtained using infrared time-of-flight (ToF) sensors on the Multi-Ranger Deck, which actively measure the shortest line-of-sight distance between the drone and any nearby surface in the specified directions. To ensure safe navigation, the obstacle avoidance algorithm uses a dynamic safety threshold, denoted as \(\rho_{th}\). This value accounts for the physical limitations of the Crazyflie drone and its ability to decelerate upon detecting an obstacle. This safety threshold is computed using principles derived from [PERSON]'s Laws of Motion, such that  
\[\rho_{th}=vt_{latency}+\frac{v^{2}}{2a} \tag{5}\]  
where \(v\) represents the drone's velocity, \(t_{latency}\) indicates the command execution latency, and \(a\) indicates the deceleration rate of the drone, respectively. This equation calculates how far ahead the drone should start reacting to an obstacle, based on its current velocity and ability to decelerate, including the first term _reaction distance_ and the second term _braking distance_. The reaction distance, \(vt_{latency}\), indicates the distance the drone travels during the delay in command execution, and the braking distance, \(v^{2}/(2a)\), indicates the distance needed to decelerate to a stop. The reaction distance contributes minimally to the threshold due to its small magnitude, making the braking distance the dominant factor at higher velocities. The deceleration rate is inherent to the drone's hardware and was verified through controlled testing. This formulation enables the safety threshold to scale dynamically with velocity, providing a greater margin at higher speeds to prevent collisions, while at lower speeds, decreasing the margin for more precise navigation. In this paper, specifically, we consider the maximum velocity of the Crazyflie, \(v_{max}=1\) m/s, according to Bitcraze Forums, the command execution latency, \(t_{latency}=5\) milliseconds (ms) (more details are provided in Section 3.4.3), and the deceleration rate of the drone \(a=1.5\) m/s\({}^{2}\). Here, the deceleration rate is obtained from experimental measurements, which vary depending on the different weights of the drones and the sensors equipped. Then, the safety threshold can be obtained as, \(\rho_{th}=0.3383\approx 0.35\) m, by substituting these specifications into (5). Furthermore, a reasonable avoidance distance is set by \(\rho_{avoid}=0.2\) m.  
When any detection distance \(\rho_{d}\) between the drone and the obstacles falls below this threshold, the system initiates an automatic avoidance maneuver, moving it by \(\rho_{avoid}=0.2\) m in the opposite direction to maintain a buffer from the obstacle. \[\Delta\mathbf{x}= \begin{cases}-\rho_{avoid},&\text{if }\rho_{F}<\rho_{th}\\ +\rho_{avoid},&\text{if }\rho_{B}<\rho_{th}\end{cases} \text{ and }\Delta \mathbf{y}= \begin{cases}-\rho_{avoid},&\text{if }\rho_{R}<\rho_{th}\\ +\rho_{avoid},&\text{if }\rho_{L}<\rho_{th}\end{cases}  \tag{6}\]  
These avoidance movements are issued using the Bitcraze Python API's Motion Commander interface, allowing precise, small-scale control of the Crazyflie drone's trajectory.