**3.1 Navigation algorithm**

*Industrial Robotics - New Paradigms*

The K parameter indicates the position that the UAV must maintain, while the tunnel inspection is defined as the ratio between the distance of the UAV with the

In the hypothesis in which K has been defined equal to 1, the drone will carry out the mission remaining in a central position with respect to the left and right walls. In the same way, with K = 2, the distance held to the left wall by the UAV will be

The same ratio is maintained even during return to home navigation, when the

This positioning system was thus implemented to allow a 3D reconstruction of

Navigation and obstacle avoidance are one of the fundamental problems in mobile robotics, which are being already studied and analyzed by the researchers in the past 40 years. The goal of navigation is to find an optimal path from a starting to the goal point with obstacle avoidance competence. In order to guarantee an autonomous navigation, the robot must be able to safeguard a certain reliability in terms of position (IMU, GPS or other sensors) and ensure a map sufficiently precise

When the robot is in a complete unknown area and does not have information about the surrounding area, the global motion planning fails and does not produce any solution [11]. For this kind of situations, the local motion planning is more suitable. The objective of the obstacle avoidance is to move a robot towards an area that is free of collisions thanks to the information handled by the sensors during the

reference system of the drone will be rotated 180° on the *xy* plane.

to generate a path without collisions and faithful to the real one.

motion execution, which are steadily updated [12].

right and left walls of the tunnel (**Figure 6**).

doubled compared to the right distance.

**3. Flight system**

**Figure 6.** *K parameter logic.*

the tunnel inspected by using a single camera.

**154**

Given the application context, a blind tunnel of semi-circular or circular crosssection with a diameter ranging from 2 to 5 metres, it was necessary to develop a specific navigation algorithm that would allow the UAV to explore the surrounding environment avoiding obstacles that could arise during the investigation of the tunnel. The environment taken into consideration for the definition of the algorithm was structured in a tunnel with an entrance and an exit, where there were no bifurcations of the channel.

Within a dark and unknown environment, the use of a Lidar is crucial to carry out navigation in an appropriate manner and for the implementation of the obstacle avoidance algorithm.

Light detection and ranging (Lidar) is a remote sensing technique that allows to determine the distance of an object or a surface using a laser pulse. The distance of the object is determined by measuring the time elapsed between the pulse emission and the reception of the retro-diffused signal. In the same way, to define the height from the ground, the height sensor is necessary. It allows stabilization of the UAV and its navigation to a predefined altitude with the possibility, thanks to the autopilot, of enabling terrain following or the technology that in an automatic way maintains a constant relative distance with respect to the ground.

The main task of the Lidar sensor is to monitor three distances during the navigations. The three distances are one front to the drone navigation and the two laterals, considering a 20° of inclination with respect to the perpendicular drone (**Figure 7**).

**Figure 7.** *Monitoring of the three distances.*

This solution allows to monitor the frontal space to make sure that the path is free from obstacle, while the two lateral distances serve to guarantee the correct positioning within the UAV tunnel. Being that a single acquisition in any direction may not return completely valid information (optical sensor readings may be subject to disturbance and error depending on the type of surface, color and material on which the signal bounces), it is thought to acquire more data for each direction in a range of 10° in order to achieve a satisfactory level of consistency of the data.

The acquisition of the front distances is necessary to avoid hitting an obstacle present inside the tunnel and more importantly, once the tunnel is investigated in its entire length, recognize the end and be able to start the landing operation. The threshold set for the frontal control has been limited to 5 metres (maximum distance). This implies that until no obstacle is identified in this radius, the UAV will proceed to a predefined cruising speed (1 m/s); on the contrary, if an obstacle is detected, the speed will begin to decrease directly proportional to the distance between the UAV and the above obstacle.

At the minimum threshold value, 2 m from the obstruction, the drone resets its speed by stopping and remaining in hovering condition.

Recognizing the impossibility of advancing the UAV has two possible strategies to pursue: the first strategy involves the initialization of the landing operation, whereas the second includes first a 180° of rotation and then proceeding to the home positioning. Which of the two operations carried out is decided by the operator during the planning of the mission?

Another crucial point of the project was the planning of the rotations that had to be carried out when the anti-collision system recognized the end of the tunnel.

This phase was managed with the aid of the rotation matrices, with the aim of maintaining, during the rotation phase of 180°, the position saved immediately before the start of the rotation. This system had to be studied due to the problem brought by the vibrations and the imperfect balance of the payload installed on the UAV which meant that, in the hovering phase, considering only the rotation along the *z* axis, the system results are unstable and difficult to control.

With the use of this mechanism during the rotation phase, in addition to the angular speed, there is a continuous contribution of the linear speed along the *x* and *y* axis whose goal is to bring and keep the drone in the initial position (*x0*, *y0*) of rotation.

Considering this aspect, the 180° rotation is managed in two steps:


This positioning system defined using a constant K as a function of the ratio between the distance from the two right and left walls and the other parameters mentioned above, **Table 1**, has thus been implemented to meet the future need of performing a 3D reconstruction of the tunnel inspected (**Figure 8**).

### **3.2 Test in simulative environment**

In this section, various tests will be presented to validate the operation of the entire system and the obtained results, which are evaluated in different unknown indoor environments such as tunnels, to describe the advantages and limitations of this project.

**157**

**Figure 9.**

**Figure 8.** *Tunnel exploration.*

*Visual-Inertial Indoor Navigation Systems and Algorithms for UAV Inspection Vehicles*

In order to validate the navigation algorithm presented in this document, before performing real field tests, it was preferred to apply a more precautionary approach

This kind of approach is preferred for UAV since the failure of navigation frequently involves serious damage to the hardware and therefore, in cascade, a strong

To assess the quality of the software developed, the first tests were performed in a simulative environment using a UAV model (**Figure 9**). The simulative environment was defined using Gazebo, while Rviz was used to display the results (both

by testing the logic of the software in the simulation field.

impact on the cost of the project.

tools are provided by ROS).

*UAV test in simulative environment.*

*DOI: http://dx.doi.org/10.5772/intechopen.90315*

*Visual-Inertial Indoor Navigation Systems and Algorithms for UAV Inspection Vehicles DOI: http://dx.doi.org/10.5772/intechopen.90315*

**Figure 8.** *Tunnel exploration.*

*Industrial Robotics - New Paradigms*

between the UAV and the above obstacle.

tor during the planning of the mission?

speed by stopping and remaining in hovering condition.

This solution allows to monitor the frontal space to make sure that the path is free from obstacle, while the two lateral distances serve to guarantee the correct positioning within the UAV tunnel. Being that a single acquisition in any direction may not return completely valid information (optical sensor readings may be subject to disturbance and error depending on the type of surface, color and material on which the signal bounces), it is thought to acquire more data for each direction in a range of 10° in order to achieve a satisfactory level of consistency of the data. The acquisition of the front distances is necessary to avoid hitting an obstacle present inside the tunnel and more importantly, once the tunnel is investigated in its entire length, recognize the end and be able to start the landing operation. The threshold set for the frontal control has been limited to 5 metres (maximum distance). This implies that until no obstacle is identified in this radius, the UAV will proceed to a predefined cruising speed (1 m/s); on the contrary, if an obstacle is detected, the speed will begin to decrease directly proportional to the distance

At the minimum threshold value, 2 m from the obstruction, the drone resets its

Recognizing the impossibility of advancing the UAV has two possible strategies to pursue: the first strategy involves the initialization of the landing operation, whereas the second includes first a 180° of rotation and then proceeding to the home positioning. Which of the two operations carried out is decided by the opera-

Another crucial point of the project was the planning of the rotations that had to

be carried out when the anti-collision system recognized the end of the tunnel. This phase was managed with the aid of the rotation matrices, with the aim of maintaining, during the rotation phase of 180°, the position saved immediately before the start of the rotation. This system had to be studied due to the problem brought by the vibrations and the imperfect balance of the payload installed on the UAV which meant that, in the hovering phase, considering only the rotation along

With the use of this mechanism during the rotation phase, in addition to the angular speed, there is a continuous contribution of the linear speed along the *x* and *y* axis whose goal is to bring and keep the drone in the initial position (*x0*, *y0*) of

• Phase 1: The drone makes a 90° counterclockwise rotation and makes a shift on the roll axis to bring the ratio between the two walls to the predefined K value.

• Phase 2: The drone makes a further rotation of 90°, positioning itself with the

This positioning system defined using a constant K as a function of the ratio between the distance from the two right and left walls and the other parameters mentioned above, **Table 1**, has thus been implemented to meet the future need of

In this section, various tests will be presented to validate the operation of the entire system and the obtained results, which are evaluated in different unknown indoor environments such as tunnels, to describe the advantages and limitations of

the *z* axis, the system results are unstable and difficult to control.

head towards the direction of round trip.

**3.2 Test in simulative environment**

Considering this aspect, the 180° rotation is managed in two steps:

performing a 3D reconstruction of the tunnel inspected (**Figure 8**).

**156**

this project.

rotation.

**Figure 9.** *UAV test in simulative environment.*

In order to validate the navigation algorithm presented in this document, before performing real field tests, it was preferred to apply a more precautionary approach by testing the logic of the software in the simulation field.

This kind of approach is preferred for UAV since the failure of navigation frequently involves serious damage to the hardware and therefore, in cascade, a strong impact on the cost of the project.

To assess the quality of the software developed, the first tests were performed in a simulative environment using a UAV model (**Figure 9**). The simulative environment was defined using Gazebo, while Rviz was used to display the results (both tools are provided by ROS).

The first, Gazebo, is a 3D simulator for rigid bodies and robots, which offers the possibility to simulate precisely and efficiently robots in complex indoor and outdoor environments, with the ability to faithfully reproduce the real situation. The advantage of this tool is the presence of an easy programmable interface, but even more the fact of being an open source software with a strong active community of developers in the world.

Rviz is a suitable tool to view the 3D status of the robot and the performance of the algorithms, to debug faulty behaviors and to record sensor data.

The main purpose was to evaluate the functioning ability of the navigation algorithm. To do this, various simulations were carried out with different parameters, to test the obstacle avoidance algorithm in every aspect.
