# AI and Vision Based Autonomous Navigation of Nano-Drones in Partially-Known Environments

Mattia Sartori, Chetna Singhal, Neelabhro Roy, Davide Brunelli, James Gross

► To cite this version:

Mattia Sartori, Chetna Singhal, Neelabhro Roy, Davide Brunelli, James Gross. AI and Vision Based Autonomous Navigation of Nano-Drones in Partially-Known Environments. DCOSS-IoT 2025 - 21st International Conference on Distributed Computing in Smart Systems and the Internet of Things, Jun 2025, Lucca, Italy. pp.307-314, 10.1109/DCOSS-IoT65416.2025.00058. hal-05448933

HAL Id: hal-05448933

https://inria.hal.science/hal-05448933v1

Submitted on 8 Jan 2026

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
# AI and Vision based Autonomous Navigation of Nano-Drones in Partially-Known Environments

Mattia Sartori* , Chetna Singhal† , Neelabhro Roy* , Davide Brunelli‡ , James Gross*

*KTH Royal Institute of Technology, Sweden.

†Inria France.

‡University of Trento, Italy.

**Abstract**—The miniaturisation of sensors and processors, the advancements in connected edge intelligence, and the exponential interest in Artificial Intelligence are boosting the affirmation of autonomous nano-size drones in the Internet of Robotic Things ecosystem. However, achieving safe autonomous navigation and high-level tasks such as exploration and surveillance with these tiny platforms is extremely challenging due to their limited resources. This work focuses on enabling the safe and autonomous flight of a pocket-size, 30-gram platform called Crazyflie 2.1 in a partially known environment. We propose a novel AI-aided, vision-based reactive planning method for obstacle avoidance under the ambit of Integrated Sensing, Computing and Communication paradigm. We deal with the constraints of the nano-drone by splitting the navigation task into two parts: a deep learning-based object detector runs on the edge (external hardware) while the planning algorithm is executed onboard. The results show the ability to command the drone at ~ 8 frames-per-second and a model performance reaching a COCO mean-average-precision of 60.8. Field experiments demonstrate the feasibility of the solution with the drone flying at a top speed of 1m/s while steering away from an obstacle placed in an unknown position and reaching the target destination. The outcome highlights the compatibility of the communication delay and the model performance with the requirements of the real-time navigation task. We provide a feasible alternative to a fully onboard implementation that can be extended to autonomous exploration with nano-drones.

**Index Terms**—Obstacle Avoidance, Reactive Planning, Vision-based Autonomous Navigation, Nano Drones.

## I. INTRODUCTION

The Internet of Robotic Things (IoRT) is an emerging Internet of Things paradigm where robots are provided advanced situational awareness thanks to sensors and data analytics methods implemented onboard and on the edge [1]. Among other platforms, small-sized drones have attracted increasing interest due to their high flexibility and cost-effectiveness. Use-case specific payload makes these platforms viable in tasks such as exploration, search and rescue, infrastructure inspection, precision agriculture, and many more [2].

The ongoing endeavour is to empower Unmanned Aerial Vehicles (UAVs) with advanced autonomy while tackling their intrinsic limitations using the Integrated Sensing, Computing and Communication (ISCC) technology [3]. A fundamental challenge for mobile robots and UAVs is to perform safe autonomous navigation between two points in the presence of obstacles or under variable weather conditions [4]. This is even more challenging for the tiny UAVs considering Size, Weight and Power constraints [5].

We have developed an ISCC framework for the safe navigation of a nano-drone, called Crazyflie, relying only on visual

input and an Inertial Measurement Unit. Vision comes from a monocular, Ultra Low Power (ULP), low-resolution, greyscale camera with limited Field of View (FOV). We circumvent the lack of depth information (knowledge of the relative distance from potential obstacles) by empowering the drone with a reactive planning method for obstacle avoidance based on visual obstacle detection. Moreover, we explore the performance of splitting the navigation task between onboard resources and external Hardware (HW) capable of more intensive computing. This strategy resembles the concept of Split Computing, which can be defined as the distribution of the computing load across a mobile device (e.g. a UAV) and an edge server [6]. Usually, the split is employed in the execution of a Deep Neural Network (DNN) that is divided into sub-models that run separately on two or more devices [7] [8]. In our work, we offload the AI inference task that processes the available visual sensory input, and we use the resulting predictions on the nano-drone to compute iteratively the desired actions needed to reach a waypoint while avoiding collisions.

We have implemented the framework to execute the high-level tasks for low-power UAVs by leveraging edge device capabilities. We summarise the key contributions as follows:

* Developed a minimal working solution for nano-drones (Crazyflie 2.1) that can be adapted for autonomous surveillance and exploration of a semi-unknown environment.

* Created a low-resolution, greyscale image dataset for supervised learning and fine-tuning of an object detection model.

* Proposed a heuristic, vision-based, reactive planning method for obstacle avoidance that does not rely on distance information. We have validated it with field experiments.

* Analysed the effects of splitting the navigation computational task between the edge and nano-drone platform.

## II. RELATED WORK

Drones are an integral part of IoRT and can be classified according to size, weight, and power, as in Table I [9]. In our work, we employ a nano drone called *Crazyflie 2.1* mounting an expansion board called *AI-deck* based on a GAP8 processor [10].

<table><caption>TABLE I: Rotorcraft UAVs taxonomy by vehicle class-size</caption><thead><tr><td>Vehicle Class</td><td>⊙:Weight [cm:Kg]</td><td>Power [W]</td><td>On-board Device</td></tr></thead><tbody><tr><td>std-size</td><td>~ 50:≥ 1</td><td>≥ 100</td><td>Desktop</td></tr><tr><td>micro-size</td><td>~ 25:~ 0.5</td><td>~ 50</td><td>Embedded</td></tr><tr><td>nano-size</td><td>~ 10:~ 0.05</td><td>~ 5</td><td>MCU</td></tr><tr><td>pico-size</td><td>~ 2:~ 0.005</td><td>~ 0.1</td><td>ULP</td></tr></tbody></table>
The ISCC use cases, such as autonomous navigation and driving, depend on sensing environmental information using an array of onboard sensors (e.g. camera, LiDAR, and Radar) [5]. Previously, range measurements and wall- following behaviour were used for navigation and collision avoidance with Crazyflie [11], [12]. The AI-deck on our drone instead mounts a ULP camera, which does not provide depth information. Visual sensors are compact, light, and cheap and can provide rich environmental information which, however, requires real-time processing to allow safe navigation. This is challenging to achieve onboard and can leverage computing resources in an edge-offloading architecture [6].

Visual navigation methods with Crazyflie included optical flow estimation and balancing [13] and depth estimation [14]. However, the approach in [14] is computationally expensive and can run at only 1.24FPS at full resolution, thus not suitable for real-time flight control. SoA work also focused on embedding tiny DNNs trained end-to-end on the GAP8 aboard the drone to achieve different tasks such as pose estimation [15], object detection [16] and navigation [17]. The authors of [16] perform obstacle detection with a DNN based on SSD-Mobilenet V2 [18] achieving a throughput of 4.3FPS with their most quantised network. They do not use the detection information for obstacle avoidance. The methods in [17] and [19] extend the PULP-dronet framework [10] allowing safe autonomous navigation in an unknown environment. They implement a reactive control approach that steers the drone away from the direction of the highest estimated collision probability without considering a target location to reach. In our work instead, we want to exploit the information on the detected obstacle for reactive planning of the drone's motion around the obstacle and towards defined waypoints. Moreover, the previously cited tasks are computationally expensive relative to the onboard HW and leave very few resources available to analyse additional sensor inputs, execute additional navigation/control tasks and run other AI models [19]. Even if there are known limitations in the communications between an edge platform and a nano drone [20], split computing and edge offloading can significantly boost the drone's perception capabilities [8] and contribute to spare onboard resources.

<table><caption>TABLE II: Feature comparison with state-of-the-art.</caption><thead><tr><th>Features</th><th>[8]</th><th>[11]</th><th>[16]</th><th>[21]</th><th>[12]</th><th>[17]</th><th>[19]</th><th>[13]</th><th>[10]</th><th>Our</th></tr></thead><tbody><tr><td>Vision based navigation</td><td>✓</td><td>✗</td><td>✗</td><td>✓</td><td>✗</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td></tr><tr><td>AI-based object detection</td><td>✗</td><td>✗</td><td>✓</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td><td>✓</td><td>✓</td></tr><tr><td>Computation (On/Off-board)</td><td>Split</td><td>On</td><td>On</td><td>Off</td><td>Off</td><td>On</td><td>On</td><td>On</td><td>On</td><td>Split</td></tr><tr><td>Onboard state estimation</td><td>✓</td><td>✓</td><td>✓</td><td>✗</td><td>✗</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td></tr><tr><td>Waypoint navigation</td><td>✗</td><td>✗</td><td>✗</td><td>✓</td><td>✓</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td><td>✓</td></tr><tr><td>AI-based obstacle avoidance</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td></tr><tr><td>Unknown obstacle position</td><td>✗</td><td>✓</td><td>✗</td><td>✗</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td></tr><tr><td>Latency analysis</td><td>✓</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td><td>✓</td><td>✓</td></tr><tr><td>Planning and control focus</td><td>✗</td><td>✗</td><td>✗</td><td>✓</td><td>✓</td><td>✗</td><td>✗</td><td>✗</td><td>✗</td><td>✓</td></tr></tbody></table>

In Table II, we provide a feature comparison and fundamental differences in the objectives of our proposed framework compared to the state-of-the-art. We provide a feasible alternative to an onboard solution by exploiting the support of an edge device to run an obstacle-detection task based on SSD-Mobilenet. We use the information on the detected obstacles

<figure><img src="image_2.png" /><figcaption>Fig. 1: **High-level pipeline representation.** Nano-drone flies from point A to B and avoids obstacles using an AI-aided, vision-based reactive planning. The navigation task is split: obstacle detection on the external HW, planning on the UAV.</figcaption></figure>

in the planning algorithm for safe navigation. Additionally, we focus on the planning and control of the drone combining obstacle avoidance and the navigation towards a waypoint.

### III. AUTONOMOUS NANO-DRONE NAVIGATION SOLUTION

We use the Crazyflie 2.1 quadcopter from Bitcraze AB (30-gram, 10 × 10 cm dimension, ≤ 8W power envelope, and ~ 7 minutes flight time [10]) with two Microcontroller Units (MCUs), STM32 (state estimation and control tasks) and nRF51822 (radio and power management). We extend the quadcopter with two decks, the Flow-deck (relative motion detection) and the AI-deck (GAP8 high-level computing visual engine, greyscale QVGA camera, and an ESP32-based Wi-Fi transceiver). A long-range open USB radio dongle called Crazyradio is used for wireless communication between the drone and external hardware.

Our framework overcomes the memory and computational resource limitations while providing miniaturised and energy-efficient intelligence and autonomy. The key elements of the autonomous navigation solution are (Figure 1) 1) synchronisation and state information exchange; 2) scene acquisition and transmission; 3) deep-learning based object detection; and 4) reactive planning and collision avoidance.

#### A. State-information and synchronisation

We have implemented a State Machine (SM) on the drone and the Offloading Computing Unit (OCU) to synchronise the execution of the split navigation task and to exchange state information over a radio link. The communication initialisation exploits the Bitcraze API and is performed with the drone on the ground. The SMs share the same set of states: ground (drone on the ground waiting for the takeoff command or after task completion), hovering (drone reaching nominal height and waiting the start), ready (drone ready for the task to start or already performing it), stopping (drone landing). Since the channels are initialised from the OCU, which knows when
the connection is established, it can directly command takeoff after the initialisation phase. We configure the OCU as the master that sends commands for synchronisation and triggers state transitions on the drone's SM. We achieve it by sending messages to/from the drone with a number encoding the current state or the command for state transition. The OCU sends a command to trigger the state transition and waits for a message with the desired state from the drone before updating its own state until state *ready* is reached. We perform the obstacle detection task when in this latter state. The state messages and detection data are sent over the wireless link every time a new image is received on the Wi-Fi channel and processed via the object detector. The drone uses the link also to send the pose estimate every 10ms for logging purposes and subsequent analysis. The drone communicates information regarding the execution of the navigation task and when it has reached an intermediate or final waypoint. This information is encoded with a number and then matched on the OCU side. Once the final waypoint is reached, the OCU triggers a task stop command and the drone lands.

## B. Scene acquisition, transmission, and dataset creation

The acquisition and streaming task is performed on the AI-deck with code running on its GAP8 processor. The drone SM executes only on the principal drone MCU and the streaming starts as soon as the drone is turned on using an adaptation of an open-source Bitcraze script. Initially, the camera and the Wi-Fi link are set up during an initialisation phase; thereafter, the images are collected, encoded (JPEG), and transmitted during the main loop. The images are collected with the ULP greyscale camera mounted on the AI-deck at full resolution (320x240 px, 8 bpp, RAW format), stored in a pre-allocated slot of the L2 memory, and then sent over Wi-Fi using Bitcraze's Crazyflye Package eXchange (CPX) protocol. In this case, CPX uses the TCP transport protocol with a Maximum Transmission Unit (MTU) of 1022bytes. The drone acts as a Wi-Fi access point thanks to the u-blox NINA module on the AI-deck. The real-time task requirements determine the number of images acquired per second; therefore, one of our experiments aims to identify all the delays involved in acquisition and streaming.

We consider 4 different classes of obstacles (see Figure 2). The boxes composing the obstacles are each of the dimension of 50 × 50 × 50 cm, and the predefined shapes are *cube*, as a single box, *short*, with two stacked boxes, *large*, with two boxes placed next to each other, and *column*, obtained by stacking three boxes. We built a balanced dataset collecting and labelling 1000 RAW images. The images were collected with the drone flying at constant height while moving back, front and sideways to cover the area in front and near the obstacle while having it on the image plane under many points of view from as far as ~3m from the obstacle to ~20cm. We collected samples for each object in multiple configurations and with different light conditions. The varying pitch and roll angles during collection caused scene rotation in the images. For these reasons, we did not apply specific augmentation

during training. Our data collection was carried out in an office environment with a cluttered background. We also included samples with highly occluded obstacles. Given the similarity between the objects, it is difficult, if not impossible, even for a human to guess the correct class when only a portion of the obstacle is visible. Even though this could bring noise into the training process, we wanted the model to detect the presence of an obstacle also in case of occlusions prioritising the detection and safety rather than the correct classification.

<figure><img src="image_3.png" /><figcaption>Fig. 2: **Dataset Example.** The original images (left) are collected from the drone. The same images after labelling (right).</figcaption></figure>

## C. Deep-learning based Obstacle Detection

We adopted a deep learning architecture for object detection called SSD MobileNet V2 renowned for being a fast object detector tailored for mobile and resource-constrained platforms [18]. The original model comes from the Tensorflow Model Zoo, has been trained on COCO 17 dataset and has an input dimension of 320 × 320 px. We performed fine-tuning to allow the detection of our 4 custom classes of obstacles. We randomly selected 80% samples for training, 10% for validation and 10% for testing. We trained the model for 20000 steps using a batch size of 16 samples and *random horizontal flip* and *ssd random crop* as data augmentation options. Apart from the learning rate that we set at 0.08, we used the standard training configuration included in the pre-trained model. Specifically, we used a momentum optimiser with a coefficient of 0.9 and a cosine decay schedule for the learning rate. Moreover, the total loss is split into two parts, one for classification and one for localisation. The standard ones are the weighted sigmoid focal loss and the weighted smooth L1 loss, respectively.

The obstacle detection follows the pseudocode in Algorithm 1. The received image `img` is first normalised as $\frac{img - \mu}{\sigma}$ where $\mu = \sigma = 127.5$. Using the APIs of the Tensorflow Interpreter we get the bounding box (BB) coordinates, class ID and the confidence score for each detected obstacle. Then, we look for the obstacle with the greatest confidence score, above a threshold of 0.5. The final detection contains the ID, confidence score, and BB coordinates of the most likely obstacle. The coordinates $xm,ym,xM,yM$ identify the top-left and bottom-right corners of the BB.

## D. Reactive Planning

In our reactive planning algorithm the outcome is a command in longitudinal velocity and yaw rate that is forwarded to the low-level hierarchical PID originally implemented in the
**Algorithm 1 Obstacle Detection**

**function** RUNINFERENCE(img)
img ← NORMALIZE(img)
boxes, classes, scores ← PREDICT(img)
max_score ← threshold
**for all** i in range(len(scores)) **do**
    **if** (scores[i] > max_score) & (scores[i] ≤ 1) **then**
        max_score ← scores[i]
        xM, yM, xM, yM ← GETCOORD(boxes[i])
        obst_id ← GETOBSTID classes[i])
        detection ← [obst_id, scores[i], xM, yM, xM, yM]
    **end if**
    **end for**
    **return** detection
**end function**

Crazyflie firmware. Overall, we compute a repulsive action that keeps the drone away from obstacles in a semi-unknown, or partially known environment. The known components are the dimensions of the area to explore and the shape of the obstacles (not their location). From the area dimensions, a plan is retrieved in terms of waypoints to traverse. We limited our study to the traversal of the space between two waypoints; the method can then be replicated for more target locations.

We use 2D coordinates in the path planning for simplicity. The drone starts from a waypoint $P_A$ to reach a target $P_B$. We denote the estimated pose as $\hat{P}$.

<figure><img src="image_4.png" /><figcaption>Fig. 3: **Reference frames and Variables of Interest.** The image illustrates the global (black) and body fixed (blue) reference frames. The variables of interest are the two waypoints $P_A$ and $P_B$, the drone's estimated pose in the global frame $(\hat{x}, \hat{y}, \hat{\psi})$, the coordinates of the distance from $P_B$ in the global frame $(x_g, y_g)$ and in the body fixed frame $(x_r, y_r)$, and the heading offset $\psi_r$.</figcaption></figure>

The origin of the global reference frame is in $P_A$ and with the x-axis directed towards $P_B$. We also consider a relative reference frame body fixed to the drone and with the x-axis pointing in the UAV forward direction. In each iteration, we compute the relative distance from the drone to the target point and obtain the angle offset $\psi_r$ from the current yaw to the heading that would lead the drone directly to the target. Figure 3 illustrates this setting.

The drone receives the BB information and computes a collision risk based on the width of the obstacle as follows:

* We add a safety margin of 20px to the obstacle edges in the horizontal direction. This is to enhance safety and take into account the drone dimensions. There is a risk of collision only if the inflated BB intersects the vertical line at the centre of the image plane. In terms of detecting a possible collision,

this is equal in concept to the drone looking for obstacles in a window of width 40px and centred in the middle of the image plane. We call critical FOV the one enclosing the window (Figure 4).

* We normalise and remap the collision risk in the range [0, 1] when the width of the detected obstacle is [20%, 80%] of the total image width $W$ as shown in Figure 5a. The lower limit is to prevent the drone from reacting too early to far objects, which are smaller in the image plane. The upper limit further enhances safety.

<figure><img src="image_5.png" /><figcaption>Fig. 4: **Safety margin and critical FOV.** (left) Inflation of the detected BB by a safety margin of 20px on each side. (right) Concept of critical FOV, i.e. the FOV enclosing a window of 40px centered in the middle of the image plane.</figcaption></figure>

We use the collision risk to modulate the longitudinal velocity. However, since it is monotonically increasing with the width of the obstacle, we transform it to a monotonically decreasing variable called safety factor $S_t$. This factor indicates the level of safety during flight at each iteration of the algorithm.

$$S_t = (coll_{risk,t} - 1)^2.$$

Since the safety factor is derived from the BB and, thus, depends on the deep learning model accuracy, we apply exponential smoothing to its value to filter out the model noise. The smoothing coefficient $\alpha = 0.5$ is empirically determined.

$$S_t = \alpha S_{t-1} + (1 - \alpha) S_{t-2}, \quad \alpha = 0.5$$

<figure><img src="image_6.png" /><figcaption>Fig. 5: (a) **Rescaling of the Collision Risk.** The Collision risk is derived from the width of the BB. $W$ represents the width of the image plane. (b) **Repulsive Velocity.** The repulsive velocity $v_{rep}$ is directed towards the less-occupied halfplane by the inflated BB. Its module is proportional to the width of interest, i.e. the width of the portion of the BB lying in the target halfplane.</figcaption></figure>
The smoothed safety factor multiplies the longitudinal ve-locity. The desired velocity command $v_d$ is constrained to a maximum speed $v_{max}$ of 1m/s.

$$v_{d,t} = \min(v_{max}, \sqrt{x_r^2 + y_r^2} \times S_t \times \left| \frac{\psi_{r,t}}{180} - 1 \right|).$$

Where $x_r, y_r$ and $\psi_r$ are as in Figure 3. The last multiplier is to reduce the forward velocity when $\psi_r$ is high, i.e., the drone is heading far away from the target.

The repulsive action is computed only if an obstacle is present and intersects the critical FOV. The first step in the computation of the desired yaw rate $\dot{\psi}_d$ is the calculation of a repulsive action that allows the drone to change heading and avoid obstacles, as shown in Figure 5b. We call it repulsive velocity $v_{rep}$ and derive it from the width of the inflated BB. In particular:

* It is directed towards the halfplane that has more free space, thus avoiding the region of the image plane that is occupied the most by the obstacle.

* Its value corresponds to the width of the part of the obstacle lying in the selected halfplane. The action is proportional to the “quantity” of the obstacle to avoid. We normalise $v_{rep}$ in a range [0, 1] corresponding to a width from [0, W/2] where W/2 is the width of the halfplane.

The width of interest, $WoI$, is shown in Figure 5b. The repulsive velocity is given as:

$$v_{rep,t} = k_{vel} \times \frac{WoI_t}{W/2}.$$

The coefficient $k_{vel}$ determines the strength of the repulsive action and directly impacts the obstacle avoidance manoeuvre. Its influence on the navigation task was studied in the experimental phase (see section IV). Since $v_{rep}$ is derived from the BB, similarly to the case of the safety factor, we smooth its value with a low pass filter and a smoothing coefficient $\beta = 0.5$.

$$v_{rep,t} = \beta v_{rep,t} + (1 - \beta)v_{rep,t-1}, \quad \beta = 0.5.$$

From the repulsive velocity we compute the repulsive yaw $\psi_{rep}$ as:

$$\psi_{rep,t} = atan2(v_{rep,t}, v_{d,t}).$$

Finally, we obtain the desired yaw rate command $\dot{\psi}_d$ by considering a balance between the repulsive yaw $\psi_{rep,t}$ and the attractive action, identified as the relative yaw $\psi_{r,t}$.

$$\dot{\psi}_{d,t} = (\psi_{r,t}S_t + \psi_{rep,t})/dt, \quad dt = 0.2.$$

The multiplication with the safety factor limits the contribution of the attractive action when the risk of collision is high. The term $dt$ is a time variable needed to transform the desired yaw (in the parenthesis) in an angular velocity. We chose $dt = 0.2s$ to approximate the period corresponding to the frequency at which a new command is sent to the controller. The desired yaw rate is constrained to a maximum angular velocity $\dot{\psi}_{max} = 60deg/s$. Algorithm 2 presents the pseudocode of the planning algorithm that has a $O(1)$ complexity.

## Algorithm 2 Reactive Planning

**procedure** PLANNINGTASK(dronepose, obstacle)

P ← drone_pos

T ← current_target

O ← obstacle

if TARGETREACHED(P, T) then

STAYONTARGET(T)

UPDATE TARGET(T)

return

end if

if O ≠ null then

coll_{risk,t} ← COLLISIONRISK(O)

$S_t ← (coll_{risk,t} - 1)^2$

if coll_{risk,t} > 0 then

$$v_{rep,t} ← k_{vel} \times \frac{WoI_t}{W/2}$$

end if

end if

$v_{rep,t} ← \beta v_{rep,t} + (1 - \beta)v_{rep,t-1}$

$S_t ← \alpha S_t + (1 - \alpha)S_{t-1}$

$x_r, y_r ← GLOBALDISTANCE(P, T)$

$dx_{rel}, dy_{rel} ← RELATIVE DISTANCE(P, x_r, y_r)$

$\psi_{r,t} ← atan2(dy_{rel}, dx_{rel})$

$v_{d,t} ← \min(v_{max}, \sqrt{x_r^2 + y_r^2} \times S_t \times \left| \frac{\psi_{r,t}}{180} - 1 \right|)$

$\psi_{rep,t} ← atan2(v_{rep,t}, v_{d,t})$

$\dot{\psi}_{d,t} ← (\psi_{r,t}S_t + \psi_{rep,t})/dt$

end procedure

# IV. PERFORMANCE EVALUATION AND RESULTS

## A. Delay and Timing

The latency between perception and actuation is the main component affecting the reactive capabilities of the system, hence the successful and safe navigation of the quadrotor. To evaluate such latency, we studied the streaming end-to-end delay, streaming rate, inference time, and planning time.

We assessed the end-to-end delay comprising of the image capture (raw format), encoding (JPEG), and transmission components as shown in Figure 6. The transmission duration depends on the amount of data to send and, therefore, on the image format. Indeed, an image weighs ~ 79kB in RAW format or ~ 6kB if encoded in JPEG format, requiring at least 79 or 6 CPX packages respectively. The lower transmission time for JPEG frames is countered by the encoding time. The peak observed in the transmission time for JPEG format is attributed to the changes in channel condition and associated loss of packets causing retransmission. In both cases, the overall average time is comparable and around 120ms.

Since the above does not account for the propagation and processing time, we also characterised the end-to-end delay using on-screen timer method [22]. Averaging the results from 25 measurements for each image format, we got $T_{stream}^{RAW} = (\mu : 326, \sigma : 48)$ ms and $T_{stream}^{JPEG} = (\mu : 223, \sigma : 54)$ ms. The greater amount of data to transmit with RAW images impacts the propagation and processing (reading) time, accounting for ~ 100 ms more in the end-to-end streaming delay.

Figure 7 shows the arrival time of consecutive images and we observe a higher variability for the JPEG compared to the RAW format. This is due to the processing of the images
<figure><img src="image_7.png" /><figcaption>Fig. 6: **Components of streaming delay for RAW and JPEG format.** Trace of the capturing, encoding and transmission times for 1000 streamed RAW and JPEG images. The pie charts show the impact of each component and the average total delay between consecutive transmissions.</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>Fig. 7: **Streaming Rate or Arrival Time.** The figure shows the traces of the amount of time elapsed between the reception of two following images. The samples refer to 1000 images collected in both formats.</figcaption></figure>

on the OCU side, likely for decoding purposes. We observe lower intervals following the peaks in the JPEG arrival time. This indicates that when the processing time is higher than the transmission process, the laptop still receives the following images and buffers them. When one frame is processed, another is already available in the buffer to be read and stored in memory. Comparing Figure 7 and Figure 6 we notice that the variability in the arrival time for the RAW images is directly connected to the variability in the transmission time. Considering the average time of arrival, we obtain 123ms and 119ms for RAW and JPEG. This results in ~8FPS on average for both formats.

We have also evaluated the inference time, i.e., the time the SSD MobileNet V2 model takes to process the input and return an output with the detection information. The model was running on the CPU of a ThinkPad-T450s laptop. The obtained average inference time over 1000 measurements was 51ms. Therefore, on average, an output is ready before the arrival of the following image, thus not decreasing the rate at which the output is sent to the drone for the planning task. Additionally, we have also measured the planning time, which refers to the time the drone takes to compute a command when an input message with object detection information is received. This quantity is on average lower than 1ms.

## B. Object Detection

A reliable perception of the environment is fundamental to avoiding obstacles. We based our assessment of the object detection model performance on the COCO mean Average Precision (mAP) metric [23] and a custom metric derived from it. We first evaluated the model on the test split of the original dataset. Then, we tested it on images streamed in real-time from the drone during the experiments for obstacle avoidance. This second time we assessed model performance with images in both RAW and JPEG format. As already mentioned, in the proposed framework we wanted to prioritise safe navigation to correct classification, indeed the planning algorithm works independently from the class of the detected BB. Therefore, we studied the model's performance by grouping all the obstacles into a single generic class. The overall COCO mAP averaged over all IoU thresholds for the generic obstacle class is summarised in Table III.

<table><caption>TABLE III: mAP results for the generic obstacle class</caption><thead><tr><th></th><th>Test Set</th><th>RAW</th><th>JPEG</th></tr></thead><tbody><tr><td>Overall mAP @.5 : .95</td><td>85.72</td><td>60.80</td><td>62.56</td></tr></tbody></table>

We note the following about the inference performance:

* The model achieved good localisation and most detections would allow safe navigation given that the bounding boxes cover the correct width of the visible obstacle.

* The mAP score drops if evaluated at high IoU thresholds (≥ 0.9). However, an IoU of 0.5 is often considered good and is for example the only value used in the Pascal VOC challenge.

* The model rarely produced erroneous detections on objects being part of the cluttered background (only few FPs detected). Also, we detected a significant amount of TPs, accounting for 84% of all positive samples.

Most importantly, we have formulated the planner to be robust to noise in the detection by introducing a low-pass filter on the safety factor and reactive action, which reduces the impact of false predictions and enhance safe navigation. In other words, if the model correctly detects an obstacle in most frames but fails in others, it can keep memory of the danger in terms of a safety factor and still avoid collisions. The existing metrics in literature do not consider this memory aspect. Therefore, we have formulated a new custom metric, called window mAP, obtained by computing the moving average of the mAP at IoU= 0.5 in a window of 10 consecutive frames. The result of the window mAP evaluation is presented in Figure 8.

We note that the score remains above 70% mostly, and the average score over all the windows results in a window mAP of 87.82%.

## C. Exploration and Obstacle Avoidance

We further evaluated the effectiveness of the developed nano-drone framework to complete the navigation task safely by scaled-down experiments in a semi-unknown environment. We evaluated the reactive planning method by means of
<figure><img src="image_9.png" /><figcaption>Fig. 8: **Window mAP metric** on a 10-frames window during real obstacle avoidance experiments.</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>Fig. 9: (a) **Experimental setting with a radio** Drone navigates towards the target point while avoiding the obstacle using the detections sent via the radio channel. (b) **Experiment Setting**. Position of start point, destination and obstacle during the experiments.</figcaption></figure>

repetitive tests with different objects while analysing the effect of the parameter $k_{vel}$ ruling the strength of the repulsive action.

The drone had to traverse the space between two waypoints, 4m apart, going from position A to position B. An obstacle was placed between the waypoints, at 2m from the start and blocking the direct way to destination, as illustrated in Fig. 9. The experiment was conducted only for the obstacles of class *short* and *large* and repeated 5 times to evaluate the reliability. We identify the best setting of parameters for the reactive planning algorithm among $k_{vel} = [0.5, 0.7, 1, 1.5, 2]$ comparing the effect of the different values by computing task completion time, length of the path and number of collisions.

In the following, Figure 10 and Figure 11 illustrate a top view of the resulting paths from the best batch of experiments for the obstacles of type *short* and *large*, obtained with $k_{vel} = 1.5$ and $k_{vel} = 0.5$, respectively. In all completed tasks, the drone reached the dashed circle (radius 10cm) and landed inside it. We note one unsuccessful test highlighted with a star at the end of the path. In some runs, the displayed path overlaps the obstacle (in yellow) but there is no collision reported. This is because of a misalignment between the onboard state estimation and the known global position of the obstacle. The lack of ground truth data for the drone's trajectories prevented analysing the minimum distance to the cubes during the avoidance manoeuvre. During the experi-

ments some tests failed due to causes such as losing a propeller while flying, hitting other objects (not obstacles under test) in the environment or other unknown malfunctions. Figure 12 reports a bar graph of all the successful obstacle avoidance manoeuvres for each parameter's value and each obstacle. In the graph, a task is considered successful if the drone managed to go over the obstacle, no matter of a later malfunction.

In general, with the *short* obstacle, we obtained a higher number of avoided collisions accounting for the 76% of all runs compared to the 64% achieved for class *large*. This statistic shows that the wider object is more challenging to avoid, which is understandable given the nature of the reactive approach and the fact that the obstacle is 10 times larger than the drone size. The proposed percentages consider the experiments with all the tested values of $k_{vel}$, but our goal was to identify the best settings. We further present the data regarding the average time and average travelled distance in every batch of tests (only for the completed runs), in Figure 13a and Figure 13b. We note that in terms of the completion time, the best ($k_{vel} = 1.5$) and second best values apply for both classes.

Overall, we can consider $k_{vel} = 1.5$ the best parameter setting under all perspectives. Indeed, averaging the results of the two classes of obstacles for all the parameters, it obtained the higher percentage of successful avoidance manoeuvres (80%), the lower completion time (6918ms) and shorter path length (4.53m). However, the separate results for the two obstacles indicate potential advantages of a solution with settings that adapt dynamically to the obstacle class.

<figure><img src="image_11.png" /><figcaption>Fig. 10: **Obstacle Avoidance best experiments - class short.** Drone paths with class *short* at $k_{vel} = 1.5$.</figcaption></figure>

<figure><img src="image_12.png" /><figcaption>Fig. 11: **Obstacle Avoidance best experiments - class large.** Drone paths with class *large* at $k_{vel} = 0.5$.</figcaption></figure>
<figure><img src="image_13.png" /><figcaption>Fig. 12: Successful Obstacle Avoidance Manoeuvres.</figcaption></figure>

<table><thead><tr><th>k<sub>vel</sub></th><th>short</th><th>large</th></tr></thead><tbody><tr><td>0.5</td><td>7138</td><td>9129</td></tr><tr><td>0.7</td><td>8050</td><td>8495</td></tr><tr><td>1</td><td>7163</td><td>8934</td></tr><tr><td>1.5</td><td><b>6897</b></td><td><b>6939</b></td></tr><tr><td>2</td><td>7063</td><td>6983</td></tr></tbody></table><p>(a) Avg completion time (ms)</p><p>(b) Avg path length (m)</p>

Fig. 13: **Average completion time and path length.** The table shows the average completion time (in milliseconds) and path length (in metres) for the successful runs. The best value is in bold and the second best value in italic.

## V. CONCLUSIONS AND FUTURE WORK

We have developed a safe navigation ISCC solution for a Crazyflie nano-drone based on AI-aided visual reactive planning for obstacle avoidance in a partially known environment. The modules of the safe navigation pipeline include the deep learning based obstacle detection model and the path planning algorithm. We experimentally evaluated the latency involved in the communication between the drone and the OCU, the performance of the object detector, and the parameter based path planning algorithm. We studied the impact of each designed component on the safe navigation task. We successfully achieved a processing rate of 8 FPS and an object detection performance of 60.8 of COCO mAP. Through the field experiments we verified the solution feasibility and achieved the safe navigation of the drone flying at a top speed of 1m/s while steering away from an obstacle placed in an unknown position and reaching the target destination. Our framework successfully implements the real-time navigation task requirements for the resource constrained nano-drone platform. In future work, we will explore multi-point navigation, trajectory optimisation, and the tradeoff between an edge-offloaded obstacle detection and AI model execution aboard the drone.

## ACKNOWLEDGMENTS

This work was made possible by the industrial internship at RI.SE, Kista, Sweden and the double degree program Autonomous Systems and Intelligent Robots, coordinated by EIT Digital. The program has received funding from the European Community's DIGITAL Programme under Grant Agreement No. 101123118 (SPECTRO).

## REFERENCES

[1] P. P. Ray, “Internet of robotic things: Concept, technologies, and challenges,” *IEEE Access*, vol. 4, pp. 9489–9500, 2017.

[2] N. S. Labib, M. R. Brust, G. Danoy, and P. Bouvry, “The rise of drones in internet of things: A survey on the evolution, prospects and challenges of unmanned aerial vehicles,” *IEEE Access*, vol. 9, pp. 115 466–115 487, 2021.

[3] M. Pourjabar, A. AlKatheeri, M. Rusci, A. Barcis, V. Niculescu, E. Ferrante, D. Palossi, and L. Benini, “Land & Localize: An Infrastructure-free and Scalable Nano-Drones Swarm with UWB-based Localization,” in *Proc. IEEE DCOSS-IoT*, Jun. 2023, pp. 654–660.

[4] A. Albanese, Y. Wang, D. Brunelli, and D. Boyle, “Is that rain? understanding effects on visual odometry performance for autonomous uavs and efficient dnn-based rain classification at the edge,” *IEEE Internet of Things Journal*, pp. 1–1, 2025.

[5] M. Bohmer, A. Schmidt, P. Gil Pereira, and T. Herfet, “Latency-aware and -predictable Communication with Open Protocol Stacks for Remote Drone Control,” in *Proc. IEEE DCOSS*, May 2020, pp. 304–311.

[6] C. Singhal, Y. Wu, F. Malandrino, M. Levorato, and C. F. Chiasserini, “Resource-aware deployment of dynamic dnn s over multi-tiered interconnected systems,” in *IEEE INFOCOM*, 2024, pp. 1621–1630.

[7] C. Singhal, Y. Wu, S. Ladron de Guevara Contreras, F. Malandrino, M. Levorato, and C. F. Chiasserini, “Resource-efficient sensor fusion via system-wide dynamic gated neural networks,” in *IEEE SECON*, 2024.

[8] E. Cereda, A. Giusti, and D. Palossi, “Secure deep learning-based distributed intelligence on pocket-sized drones,” in *Proc. ACM EWSN*, 2023, p. 409–414.

[9] D. Palossi, F. Conti, and L. Benini, “An open source and open hardware deep learning-powered visual navigation engine for autonomous nano-uavs,” in *Proc. IEEE DCOSS*, 2019, pp. 604–611.

[10] D. Palossi, A. Loquercio, F. Conti, E. Flamand, D. Scaramuzza, and L. Benini, “A 64-mW DNN-Based Visual Navigation Engine for Autonomous Nano-Drones,” *IEEE Internet Things J.*, vol. 6, no. 5, pp. 8357–8371, Oct. 2019.

[11] K. Mcguire, C. De Wagter, K. Tuyls, H. Kappen, and G. Croon, “Minimal navigation solution for a swarm of tiny flying robots to explore an unknown environment,” *Science Robotics*, vol. 4, Oct. 2019.

[12] C. Liu, E.-J. van Kampen, and G. C. de Croon, “Adaptive risk-tendency: Nano drone navigation in cluttered environments with distributional reinforcement learning,” in *Proc. IEEE ICRA*, 2023, pp. 7198–7204.

[13] R. J. Bouwmeester, F. Paredes-Vallés, and G. C. H. E. de Croon, “NanoFlowNet: Real-time Dense Optical Flow on a Nano Quadcopter,” in *Proc. IEEE ICRA*, May 2023, pp. 1996–2003.

[14] N. Zhang, F. Nex, G. Vosselman, and N. Kerle, “End-to-end nano-drone obstacle avoidance for indoor exploration,” *Drones*, vol. 8, no. 2, 2024.

[15] D. Palossi et al., “Fully Onboard AI-Powered Human-Drone Pose Estimation on Ultralow-Power Autonomous Flying Nano-UAVs,” *IEEE Internet Things J.*, vol. 9, no. 3, pp. 1913–1929, Feb. 2022.

[16] L. Lamberti, L. Bompani, V. J. Kartsch, M. Rusci, D. Palossi, and L. Benini, “Bio-inspired autonomous exploration policies with CNN-based object detection on nano-drones,” in *Proc. DATE*, 2023, pp. 1–6.

[17] L. Lamberti et al., “A sim-to-real deep learning-based framework for autonomous nano-drone racing,” *IEEE Robot. Autom. Lett.*, vol. 9, no. 2, pp. 1899–1906, 2024.

[18] M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L.-C. Chen, “MobileNetV2: Inverted Residuals and Linear Bottlenecks,” in *Proc. IEEE CVPR*, Jun. 2018, pp. 4510–4520.

[19] L. Lamberti, L. Bellone, L. Macan, E. Natalizio, F. Conti, D. Palossi, and L. Benini, “Distilling tiny and ultrafast deep neural networks for autonomous navigation on nano-uavs,” *IEEE Internet Things J.*, vol. 11, no. 20, pp. 33 269–33 281, 2024.

[20] M. Navardi, E. Humes, and T. Mohsenin, “E2edgeai: Energy-efficient edge computing for deployment of vision-based dnn s on autonomous tiny drones,” in *IEEE/ACM SEC*, 2022, pp. 504–509.

[21] E. Soria, F. Schiano, and D. Floreano, “Predictive control of aerial swarms in cluttered environments,” *Nature Machine Intelligence*, vol. 3, no. 6, pp. 545–554, Jun. 2021.

[22] C. Singhal, S. Rafiei, and K. Brunnström, “Real-time live-video streaming in delay-critical application: Remote-controlled moving platform,” in *Proc. IEEE Vehicular Tech. Conf. (VTC-Fall)*, Oct. 2023, pp. 1–7.

[23] B. Wang, “A parallel implementation of computing mean average precision,” *arXiv*, 2022.