Towards Autonomous Bridge Inspection: Sensor Mounting Using Aerial Manipulators

vehicles (UAVs) to attach a sensor to a bridge using a two-component adhesive in order to perform an inspection. Constant pressure must be applied for several minutes to form a bond between two adhesives. Therefore, one UAV sprays the colored component of an adhesive while the aerial manipulator transports the sensor, detects the contact point and attaches the sensor to it. A trajectory planning algorithm was developed around the dynamic model of the UAV and the manipulator attached to it, ensuring that the end-effector is parallel to the wall normal. Finally, the aerial manipulator achieves and maintains contact with a predeﬁned force through an adaptive impedance control approach. Abstract: Periodic bridge inspections are required every several years to determine the state of a bridge. Most commonly, the inspection is performed using specialized trucks allowing human inspectors to review the conditions underneath the bridge, which requires a road closure. The aim of this paper was to use aerial manipulators to mount sensors on the bridge to collect the necessary data, thus eliminating the need for the road closure. To do so, a two-step approach is proposed: an unmanned aerial vehicle (UAV) equipped with a pressurized canister sprays the ﬁrst glue component onto the target area; afterward, the aerial manipulator detects the precise location of the sprayed area, and mounts the required sensor coated with the second glue component. The visual detection is based on an Red Green Blue - Depth (RGB-D) sensor and provides the target position and orientation. A trajectory is then planned based on the detected contact point, and it is executed through the adaptive impedance control capable of achieving and maintaining a desired force reference. Such an approach allows for the two glue components to form a solid bond. The described pipeline is validated in a simulation environment while the visual detection is tested in an experimental environment.


Introduction
The world of unmanned aerial vehicles (UAVs) has been rapidly growing in recent years. As their design and control are perfected, these aerial vehicles have become more and more available. Nowadays, off-the-shelf ready-to-fly UAVs can be found and bought in shops, which makes them available to virtually anybody. This, in turn, has sparked a great deal of public interest in UAVs since their potential can be found in applications such as agriculture, various inspections (bridges, buildings, wind turbines), geodetic terrain mapping, the film industry, and even for hobby enthusiasts to fly and record videos from a first-person perspective. The vast majority of commercially available UAVs are equipped with a camera, while more specialized vehicles for terrain mapping or crop spraying offer a more diverse sensor suite.
All of the aforementioned systems primarily observe and gather data about the environment, while having little to no ability to interact with and change the environment. One way to augment these vehicles for physical interaction is to attach a lightweight manipulator to their body, which is the main interest of the aerial manipulation field. Although such vehicles are more complex for both modeling and control, their benefit lies in performing versatile tasks that require interaction with the environment.
In general, there are three types of bridge inspections: periodic, special and damage inspections. Periodic bridge inspections differ from country to country according to national standards, and are usually performed at least once every two to three years. Special inspections are typically used to monitor the condition of deficient elements at specific locations based on predefined requirements. Damage inspections are usually performed after events that have occurred due to environmental impacts or human actions. The aim of a bridge inspection is to evaluate and assess structural safety and reliability. Current techniques are based on traditional visual inspection with a combination of nondestructive methods (NDTs). Traditional visual inspection is performed by experienced (trained) engineers and using specialized trucks equipped with the cranes and basket, that allow inspectors to review the conditions underneath the bridge. During the inspection, the engineers are equipped with various NDT [1] tools to detect construction faults and defects such as corrosion, cracks, voids, weakening connections, and concrete delamination. Some of these NDTs require mounting small sensors to collect data, such as accelerometers, strain gauges, tilt meters and various transducers for acoustic or pressure measurements. Afterwards, the bridge is excited with vibrations, sound waves, tapping, etc., and mounted sensors record responses to these specific excitations. Furthermore, there are usually requirements for performing measurements during the bridge inspection, such as the short-and long-term monitoring of vibrations, strains, displacements, etc. Mainly, these inspections offer valuable information about the current bridge conditions, but there are a number of disadvantages. The use of trucks during inspections requires total or temporary road closures, which at the same time require safety measures to keep traffic flowing as freely as possible. In addition, inspectors often encounter challenges in reaching all portions or elements in narrow areas, such as tight spaces between girders, beams and vaults. The aforementioned significantly increases the time and overall cost of the inspection. An aerial robot, with the potential to reach these challenging locations on the bridge, could significantly reduce the time and cost of these inspections and improve worker safety. Moreover, we note that the aforementioned sensors are relatively lightweight, which makes them suitable for transportation and mounting with an aerial robot.

Concept
We envision a team of robots working together to attach sensors to bridges and similar grade separation infrastructure. In theory, such a task could be accomplished with a single aerial robot, at the cost of a complex mechanical design. The proposed team shown in Figure 1 consists of two drones. One drone applies the adhesive material, and the other attaches sensors. We envision a two-stage process using two-component adhesives which form a solid bond from two separate reactive components: the "resin" and the "hardener". The first UAV applies the resin by spraying it onto the surface, while the second one attaches the sensor with the hardener already applied before the flight.
It is important to follow the prescribed ratio of the resin and the hardener to achieve the desired physical properties of the adhesive. Only when mixed together do the two components form the adhesive. The reaction typically begins immediately after the two components are mixed and the bond strength depends both on maintaining the contact and the viscosity of the mixed adhesive during the process. Manufacturers can control the cure rate to achieve various working times (worklife) until final bond strength is achieved, ranging from minutes to weeks. Resin bases are usually more viscous than their respective hardener and are generally applied by brush, roller, applicator or spray. In this work, we propose attaching a canister of pressurized resin to the UAV, and spray it through a nozzle onto the infrastructure surface. In this scenario, the spray needs to be softer and less turbulent to reduce the amount of material lost due to bouncing and it must be colored for the detection in the second stage. Spraying with drones is not a novel concept [2,3], so without loss of generality, we will omit the details of this design and instead focus on detecting, navigating to, and sustaining contact with the sprayed surface.
In typical applications, the assemblies are usually kept in contact until the sufficient strength of the bond is achieved. When fully cured, two-component adhesives are typically tough and rigid with good temperature and chemical resistance. We rely on the robotic arm attached to the second aerial vehicle to apply a controlled contact force between the sensor and the surface. Maintaining this fixed assembly contact through the impedance control system enables us to achieve a successful curing process and create a permanent bond between the sensor and the infrastructure. After the first UAV sprays the resin onto the surface, the second aerial robot finds the sprayed part and applies the contact with the sensor's surface. Before takeoff, the surface of the sensor is brushed with a hardener. Once contact is made, it is maintained for the prescribed curing time, after which the aerial robot disembarks and leaves the sensor attached to the surface. Two aerial robots working together to attach sensors to different parts of a bridge and similar grade separation infrastructure. The one on the left is used to spray the resin onto the surface, while the aerial robot on the right maintains contact to the surface with the sensor attached to its end-effector.

Contributions
This paper focuses on developing a method for mounting sensors on a bridge wall using an aerial manipulator. The first contribution is augmenting the model-based motion planning with the adaptive impedance controller. The motion planning method accounts for the underactuated nature of the multirotor UAV and corrects the end-effector configuration for an appropriate approach. This method also relies on the dexterity analysis which keeps the manipulator configuration within its optimal region, ensuring that the manipulator is never fully extended or contracted while mounting a sensor. The second contribution is the visual blob detection which locates and tracks the appropriate sensor mounting point. The blob detection has been experimentally verified in an indoor environment, yielding the reliable and robust tracking of the mount location, as well as the blob plane orientation. Finally, the third contribution is the simulation analysis of the system's performance, conducted on a straight and inclined wall approach. The simulation concentrates on testing the motion planning together with the impedance controller, performing a repeatability analysis and ensuring that the desired contact force is achieved.

Related Work
In the world of aerial inspections, a number of UAV-based solutions are being proposed by researchers. In [4], a technical survey for bridge inspections is given. Researchers in [5] present the project AERIAL COgnitive Integrated Multi-task Robotic System with Extended Operation Range and Safety (AERIAL-CORE) which focuses on power lines inspection, maintenance and installing bird diverters and line spacers. Most of these approaches are based in conjunction with new technologies to ensure faster and cheaper inspections. Nowadays, UAVs use high-resolution cameras for visual inspections and employ point cloud methods based on digital photogrammetry [6], Light Detection And Ranging (LiDAR)-based methods [7], digital image correlation [8], etc. There are also reports for visual compensation during aerial grasping [9], aerial grasping in strong winds [10], and the development of a fully actuated aerial manipulator for performing inspections underneath a bridge [11]. According to the experimental testing of contact-based bridge inspections, there is a need to develop a solution for mounting application sensors (such as accelerometers, strain gauges and tilt meters) on a bridge using a UAV. It is expected that a sophisticated system with the possibility of automatic sensor mounting will increase the frequency of measurements without interrupting traffic, ensure the safety of inspectors as well as reduce inspection time and overall costs.
As mentioned earlier, the second UAV needs to be aware of the position of the sprayed adhesive which is applied in a blob-like pattern. For this purpose, an Red Green Blue -Depth (RGB-D) camera is used due to its favorable dimensions and weight. It provides image and depth information about the environment which proves useful for object localization and UAV navigation. Such cameras were commonly found on UAVs and unmanned ground vehicles (UGVs) present at the recent MBZIRC 2020 competition. In [12,13], RGB-D information is used for color-based brick detection and localization for the wall-building challenge using UAVs and UGVs, respectively, while in [14] the authors use a Convolutional Neural Network (CNN)-based UAV detection and tracking method for the intruder UAV interception challenge. Furthermore, visual sensors proved useful in [15], where the authors performed a contact-based inspection of a flat surface with an aerial manipulator. The surface position and orientation was obtained by applying random sample consensus (RANSAC) on the RGB-D information. A thorough survey of 2D object detection methods from UAVs was given in [16]. In this paper, the authors present a modular framework for object detection in which a simple contour-based blob detector is implemented. The goal is to use RGB-D information to enable an autonomous inspection workflow. The blob position is obtained by segmenting the depth data at the points where the object is detected in the image, while RANSAC [17] is used to determine its orientation.
After the successful detection of a blob-like pattern, it is necessary to attach the inspection sensor. The first phase of the sensor attachment is achieving contact, and the second is maintaining that contact to allow for the two adhesive components to form a bond. Generally, the contact can be achieved with or without force measurements. In [18], contact with the wall is performed and maintained. Researchers in [19] performed wall contact and aerial writing experiments. The work presented in [20] modeled and exploited the effects of the ceiling effect to perform an inspection underneath a bridge. The common denominator in the former approaches is maintaining the contact without any force feedback. Although mounting a force sensor on a UAV increases both mechanical and control complexity, an immediate benefit is the ability to maintain precise contact force regardless of the environment. In [21], the researchers used a force/torque sensor to achieve compliant control while pulling a rope and a semi-flexible bar. A fully actuated UAV with a manipulator has been employed in [22] to compare force feedback control with and without the force/torque sensor. Researchers in [23] used a single degree of freedom manipulator with a force sensor mounted at the end-effector to press an emergency switch.
Relying on the blob-like pattern detection and the impedance control, a trajectory for achieving contact is required to steer the aerial manipulator towards the contact point. While mounting the sensor, it is essential that the approach and contact are perpendicular to the wall plane. This can be considered as a task constraint imposed on the planner which the aerial manipulator has to satisfy. Researchers in [24] propose a task constrained planner for a redundant robotic manipulator that enables them to do everyday tasks such as opening drawers or picking up objects. In [25], a task-constrained planner was developed for underactuated manipulators. Since multirotor UAVs are typically underactuated systems, it is necessary to address dynamics and kinematics while planning the endeffector trajectory. Aerial manipulator 6D end-effector trajectory tracking based on the differential flatness principle was presented in [26]. The underactuated nature of multirotor UAVs can cause unexpected deviations in end-effector configuration. Researchers in [27] address this particular problem by including the dynamic model of the system into the planning procedure. In our previous work [28], a trajectory planning method based on the full dynamic model of an aerial manipulator was developed. In this paper, we further augmented this method to plan for the desired force required by the impedance controller.

Mathematical Model
In this section, the mathematical model of the aerial manipulator is presented. The coordinate systems convention is depicted in Figure 2. Furthermore, an analysis for the manipulator dexterity and reach was performed.

Kinematics
The inertial frame is defined as L W . The body-fixed frame L B is attached to the center of gravity of the UAV. The position of the UAV in the world frame is given Combining the position and attitude vectors defined the generalized coordinates of the UAV as Written in a matrix form T B W , the transformation contains both the position and orientation of the UAV obtained through an on-board sensor fusion or through an external positioning system (i.e., GPS). The notation T b a ∈ R 4×4 was used to denote a homogeneous transformation matrix between frames a and b.
A rigid attachment between the body of the UAV and the base of the manipulator L 0 was considered, denoted with the transformation matrix T 0 B . The manipulator used in this work was a M = 3 degree-of-freedom (DoF) serial chain manipulator with the end-effector attached to the last joint. The DH parameters of the arm are given in Table 1. Using this notation, one can write a transformation matrix T ee 0 between the manipulator base and its end-effector as a function of joint variables q 1 , q 2 and q 3 . For brevity, the expression for the entire matrix T ee 0 is left out and only the end-effector position and its approach vector equations are written using the well-known abbreviation cos(q 1 + q 2 ) := C 12 : Table 1. DH parameters of the 3-DoF manipulator attached to the UAV. A virtual joint q * 4 is added to fully comply with the DH convention. Link sizes a 1 and d 3 are omitted for clarity. Putting it all together, the full kinematic chain of the aerial manipulator can be constructed as combining the fixed transformation T 0 B with T B W and T ee 0 depend on UAV and manipulator motion. Since there is obvious coupling between the motion of the body and the manipulator arm, a β ∈ [0, 1] parameter is introduced to distribute the end-effector motion commands either to the UAV global position control or manipulator joint position control. To this end, the following distribution relationship is used: where ∆P is used to denote the desired aerial manipulator displacement expressed as the following combination body and arm motion: The manipulator displacement is denoted by ∆P arm and the UAV displacement by ∆P UAV , where both ∆P arm and ∆P UAV are expressed in the coordinate system L 0 . With β = 1, the UAV motion is used to control the position of the end-effector. When β = 0, the situation is reversed and the manipulator motion is used to move the end-effector. For every other β, the end-effector motion is obtained in part by the UAV body and the manipulator arm motion.
There are obvious advantages in combining the motion of the UAV and the manipulator arm. The UAV can move in 3D space beyond the reach of the arm; however, the motion of the UAV is not as precise and dynamically decoupled. The kinematics of the arm enable the end-effector to obtain the desired approach angle z ee 0 = [cos(δ), sin(δ), 0] T , which under the hovering assumption, becomes equal to the global approach vector z ee W pointing towards the contact point on the infrastructure. The straightforward mathematical manipulation of Equation (1) allows for writing the constraint equation: which ensures that the manipulator points in the right direction, where δ is the desired manipulator inclination in the body x-z plane.
To find the optimal manipulator pose during contact, the dexterity D and the reach R of the pose were taken into account, while considering that the joints are as far as possible from their physical limits L. Since the motion of the arm is constrained with its approach axis condition, a reduced form of a Jacobian matrix was used J = δp ee 0 δq 1 , δp ee 0 δq 2 to derive the pose dexterity index D = J T · J and determine how far the current pose is from the null space of the manipulator [29]. The reach of the pose R = (p ee 0 ) T · p ee 0 was also taken into account, since the goal was to keep the end-effector and the contact point as far away from the UAV body. Finally, the following equation is defined: to measure how far away the given configuration is (i.e., q 1 , q 2 ) from the joint limits Q 1max , Q 2max . Normalizing D, R and L enables combining the three conditions into a single manifold M = D · R · L and find the optimal configuration q * M = q * 1 q * 2 q * 3 T for the desired approach angle δ. The described method is depicted in Figure 3 for the specific case of the approach angle δ = 0 • , but can be extended to any value of the approach angle through Equation (5).
As a side note, the manipulator attachment on the top of the UAV body was chosen to be able to reach surfaces underneath the bridge. Although this shifts the center of gravity upwards, the stability of the system is not compromised since the manipulator is constructed of lightweight materials. This analysis is performed for δ = 0 • : (a) the dexterity D surface shows the measure of how far the manipulator is from the null space. Values around zero are closer to the null space; (b) the reach R surface shows how far the end-effector can move in a certain configuration. This value tends towards zero as the arm approaches a folded configuration; (c) the limit L depicts how far a certain configuration is from the physical limits of the manipulator joints; and (d) the combined manifold M of the formerly described surfaces. Higher values offer better trade-off between dexterity, reach and limit, defining the optimal manipulator configuration q * M .

Dynamics
The most complicated task of the aerial manipulator is attaching the sensor to a wall and maintaining the required force reference while the two-component adhesive hardens.
To successfully perform such a task, the coupled UAV-manipulator system dynamics have to be addressed for the precise end-effector configuration planning.
Considering the UAV dynamics only, the derivative of the generalized coordinates Here, the (ṗ B W ) T is the linear velocity of the body of the UAV in the world frame and the (ω B W ) T represents the angular velocity of the UAV in the world frame. The UAV's propulsion system consists of n p propellers rigidly attached to the body. Each propeller produces force and torque along the z B axis. The vector of the propeller rotational velocities is simply defined as Force and torque produced by each propeller are non-linear functions depending on the rotational velocity Ω UAV . Rather than using the rotational velocities as control inputs, they can be mapped to a more convenient space. Namely, the mapped control input space can be written as where K ∈ R 4×n p is the mapping matrix and u UAV = u 1 u 2 u 3 u 4 T , where u 4 represents the net thrust and u 1 , u 2 and u 3 are moments around the body frame axes.
As stated earlier, the manipulator consists of three rotational DoFs. Therefore, the joint positions of the manipulator are defined as q M = q 1 q 2 q 3 T . The rotational velocity of each joint is a time derivative of joint positionsq M = dq M /dt. The torque of each joint is considered the control input of the manipulator The resulting generalized coordinates of the aerial manipulator can be written as q = q UAV q M T ∈ R 9 , and the velocities can be obtained in the same manner aṡ q = q UAVqM T ∈ R 9 . The resulting control inputs of the system can be expressed as Finally, the full system dynamics can be written as where M(q) ∈ R 9×7 is the inertia matrix, c(q,q) ∈ R 7 is the vector of centrifugal and Coriolis forces, g(q) ∈ R 7 is the gravitational term.

Control System
The overall control of the aerial manipulator consists of several nested control loops. The complete controller overview, with motion planning and blob detection blocks, is depicted in Figure 4.

Aerial Manipulator Control
At the inner most level, the UAV is controlled through cascade attitude and rate controllers. The input to these controllers is the desired orientation and based on the state, the output is the vector of the rotors' angular velocities. The second level of control, which uses the inner attitude control loop, consists of two additional cascades, the position and the velocity control. These controllers receive a referent position and velocity feed-forward value to generate the desired vehicle orientation and thrust. The manipulator joints are controlled through standard Proportional, Integral, Derivative (PID) controllers; however, in a real-world setting, servo motors with integrated control are typically used.
As mentioned earlier, it is important to track the desired force after contact with a wall is achieved. To accomplish this, an adaptive impedance controller is employed to generate an appropriate setpoint for the position controller. This controller receives a trajectory supplied by the mission planner, which steers the aerial manipulator towards the sensor mounting target on the bridge.

Adaptive Impedance Control
The objective of the adaptive impedance controller is to ensure a stable physical interaction between the aerial manipulator and the environment [30]. As mentioned earlier, the standard UAV control scheme is based on position and attitude controllers. When interacting with the environment, the desired contact force must be considered. The position controlled system can be extended to follow the desired force by introducing an impedance filter. The design of such a filter is explained here for a single DoF.
The behavior of the system is defined by the target impedance as where m, b and k are constants, x r (t) is the referent position, provided to the impedance filter as an input, and x c (t) is the output of the impedance filter representing the position command. The filter is designed as a linear second-order system with a dynamic relationship between the position and the contact force tracking error e(t) so that it mimics a mass-spring-damper system. The contact force tracking error is defined as follows: where f r (t) is the other filter input defining the referent force, and f (t) is the measured (exerted) contact force. If the environment is modeled as a first-order elastic system (equivalent spring system) with unknown stiffness k e , the measured force can be approximated as where x(t) is the position of the manipulator and x e (t) is the position of the environment in an unexcited state. By substituting Equation (12) in Equation (11), the position of the aerial manipulator can be expressed as follows: Assuming that the commanded position value can be achieved by the aerial manipulator, i.e., x = x c , the substitution of Equation (13) in Equation (10), the system in the steady state can be described as follows: For a contact force error of zero in the steady state, the following must hold: In other words, the position setpoint has to be designed in such a way that it compensates for the displacement of the environment due to the exerted contact force. To ensure this, a value of the unknown environment stiffness k e is needed. Furthermore, k e plays a fundamental role in the stability of the impedance filter Equation (10), which ultimately affects the stability of the aerial manipulator while in contact with the environment. A stable contact between the aerial manipulator and the environment can be ensured using the Hurwitz stability criterion, by designing the system with b/m > 0 and (k + k e )/m > 0. However, since k e is unknown, an adaptation law for the position setpoint that guarantees the contact stability while compensating for this hidden, unknown parameter is proposed.
The adaptation law is derived starting from Equation (15). An adaptive parameter κ(t) is introduced so that: It can be shown using the Lyapunov stability analysis that the following adaptation dynamics equation for κ(t) will yield a stable system response: We refer the interested reader to the proof which can be found in the Appendix A.

Motion Planning
As discussed in Section 1.1, the main concept of this paper was to use a team of two UAVs, each applying one component of the adhesive. To apply the "resin" component, the UAV has to plan a collision-free trajectory and position itself in front of the target area to start spraying. This is fundamentally different from mounting a sensor coated with "hardener". In the latter case, apart from planning a collision-free trajectory, the manipulator-endowed UAV has to apply pressure for a certain amount of time for the two components to mix.
From the perspective of motion planning, the planner needs to be augmented to include a manipulator with three degrees of freedom, contact force and the weighing parameter β. To successfully maintain the pressure, the planner relies on the impedance controller described in Section 4.2. Furthermore, one of the requirements when mounting the sensor on the wall is for the sensor to be perpendicular to the wall. Therefore, it is necessary to take the underactuated nature of the multirotor UAVs into account during the motion planning. Namely, the errors in the planned end-effector configuration were mainly induced due to the roll and pitch angles while executing the planned motion. In our previous work [28], we developed a model-based motion planner for aerial manipulators that is capable of correcting the aforementioned end-effector deviations. In this paper, the idea from [28] was extended to consider the impedance control when obtaining the full state of the aerial manipulator.

Waypoint Configuration
When dealing with an aerial manipulator, exerting some contact force inevitably yields a high dimensional waypoint configuration. We define a single waypoint as a set of UAV and joint poses, together with the force reference and motion distribution factor β: where q B ∈ R 6 and q M ∈ R 3 are generalized coordinates of the UAV and the manipulator defined in Section 3.1. The force reference vector f r = f x f y f z T ∈ R 3 and weighing scalar parameter β are required by the impedance controller. Furthermore, the impedance controller assumes a step change of these values. Ideally, the change should occur at the moment of contact since no force can be exerted without contact. Therefore, these values are only changed at the final waypoint.
Apart from the desired force and the parameter β, the final waypoint must contain the UAV position and orientation, as well as the manipulator joint configuration. Specifying these values relies on the blob detection algorithm presented in Section 6. Namely, the algorithm outputs the position and orientation of the detected blob in the world frame. Following the manipulator dexterity and reach analysis described in Section 3.1, the optimal manipulator configuration q * M is obtained based on the provided plane normal. The optimal manipulator configuration is then used as the desired configuration for the final waypoint. This way, during operation, the manipulator never reaches a fully extended or contracted pose, which allows the impedance controller to command both the arm and the UAV to achieve and maintain the desired force.

Trajectory Planning
There are three phases in the trajectory planning procedure. First, an initial trajectory is planned based on the provided waypoints. Second, the initial trajectory is sent to a simulated model in order to obtain the full state of the aerial manipulator during the trajectory execution. Third, the end-effector configuration is corrected based on the full state of the vehicle, and the final trajectory is sent to the target aerial manipulator.

Initial Trajectory
To execute a smooth motion towards the desired waypoint, we use a suitable timeoptimal path planning by reachability analysis (TOPP-RA) trajectory planner [31]. The TOPP-RA algorithm searches for the time-optimal trajectory and is based on a "bang-bang" principle on the generalized torque of each DoF. The planner is capable of receiving the input waypoints of an arbitrary dimension and output a smooth trajectory. Each DoF has to be provided with dynamical constraints in terms of velocity and acceleration, which are respected during the trajectory generation process.
As mentioned, the input to the TOPP-RA trajectory is the path of a set of n ≥ 2 waypoints: Based on the dynamical constraints, the output of the TOPP-RA planner is a sampled trajectory: where t = (w) T (ẇ) T (ẅ) T T ∈ R 3×13 is a single sampled trajectory point consisting of position, velocity and acceleration; T s is the sampling time; and n t is the number of points in the sampled trajectory. Note that each trajectory point contains both roll and pitch angles. Although these angles can be planned through the TOPP-RA algorithm, they are omitted at this point because of the underactuated nature of the multirotor UAV. Nevertheless, they are used later in the paper when the model corrections are applied.
The impedance controller expects a step change in the force and weighing parameter β referent values. To satisfy this requirement, large constraints for velocity and acceleration are imposed for these DoFs. However, because other DoFs have constraints below their physical limit, the overall force and β trajectory has a slower, dynamically smooth profile. These profiles also have overshoots and undershoots which are not acceptable because they are not within the hard constraints required for β. To tackle this problem, a simple piecewise constant velocity interpolation was applied to the force and β. This way, a large velocity constraint produces a step change which is a suitable input to the impedance controller. A visual example of the difference between the TOPP-RA and piecewise constant velocity interpolation is depicted in Figure 5.

Model-Based Corrections
The initial trajectory from Equation (20) is planned without any consideration about the underactuated nature of the multirotor UAV. To obtain the unknowns, namely roll and pitch angles, the initial trajectory can be executed in a simulation environment. The chosen simulation environment is, in our case, Gazebo, because it is realistic and supports the robotics operating system (ROS), which is the backbone of our implementation. The simulated aerial manipulator is based on the mathematical model described in Section 3. The standard cascade PID controllers are employed for low-level attitude and high-level position control. The impedance controller is built on top of the position controller and provides a position reference based on the input trajectory. More details about the simulation environment are provided in Section 7.
The first step is executing the initial trajectory in the aforementioned simulation environment. While executing, the roll and pitch angles are recorded as they are needed for obtaining the full state of the UAV. Rearranging Equation (2) and plugging the unknown roll and pitch angles in the full state of the UAV, the transform of the end-effector in the manipulator base frame can be obtained: Usingthe inverse kinematics of the manipulator, joint values q M for the desired endeffector configuration are obtained. This way, the null space of the aerial manipulator is used for the end-effector correction. Note that due to the configuration of the manipulator, an exact solution of the inverse kinematics will not always exist. In such a case, an approximate closest solution is used instead.
The final trajectory is constructed by replacing the initial q M with the corrected values. This trajectory is afterwards sent to the target aerial manipulator.
The careful reader should note that the developed three DoF manipulator operates on the x and z position in the body frame, as well as the pitch angle. This allows the impedance controller to maintain the orientation perpendicular to the wall, while compensating for the UAV body motion in the x and z axes. However, the system will experience disturbances and control errors which will act on the roll and pitch angle, and the lateral movement along the body y axis. We can address these issues either with mechanical dampers or by adding additional degrees of freedom to the manipulator, which will be explored in future work.

Blob Detection
This section presents the methods we propose to detect the hardener blob position and orientation. A modular object detection framework, as shown in Figure 6, is designed to ensure a reliable blob pose detection. Since the detection is to be done on board the UAVs, RGB-D cameras are selected. Therefore, the inputs to the framework are images and organized point clouds obtained from the visual sensor. The remainder of this section introduces the individual components of the framework and adds implementation details where necessary. The sensor message synchronizer is responsible for the time-based synchronization of the given sensor message streams. In the case of blob detection, a module that synchronizes images and organized pointclouds from an RGB-D camera is derived. This is necessary since the algorithm detects the blob in both 2D image space and 3D point clouds, which are not necessarily sampled simultaneously. The underlying implementation uses ROS libraries to synchronize messages with an approximate time policy.
An object detector attempts to find a set of object poses using synchronized sensor data. The module used in this paper detects blob poses and is implemented in the following way. First, all the blob positions and radii are found in the image frame using the standard blob detection functionality found in the OpenCV libraries. Second, the depth information corresponding to the detected blobs is isolated from the organized point cloud. Finally, blob positions are calculated as centroids of the corresponding depth positions, while the orientation is obtained through the random sample consensus (RANSAC) algorithm from the Point Cloud Library (PCL).
The remaining framework components are independent from synchronizer and detector modules. The pose tracker is used to track the obtained object's poses through multiple frames based on the closest Euclidean distance criterion. This component solves the issue of multiple objects being visible, as it always outputs the pose of the currently tracked object. Moreover, it increases the robustness of the system since it remembers the object poses for a certain number of frames, which allows some leniency with the detector.
The goal of the world transformation component is to transform the tracked pose from the sensor to the world frame using the estimated odometry from an external source that any UAV should have access to. Additionally, since the blob poses are to be sent as references to the trajectory planner, it is important to correctly compute the blob orientation. Since the blob is a flat surface, there are two equally correct possible orientations that can be detected. Therefore, the blob orientation is chosen as follows: where r 1B is the heading component of the UAV rotation matrix expressed in world coordinates R B = r 1B r 2B r 3B and r 1blob is the heading component of the blob rotation matrix expressed in world coordinates R blob = r 1blob r 2blob r 3blob and R 180 = diag(−1, −1, 1). Finally, a linear Kalman filter with a constant velocity model is used to further increase the robustness of the system and provide smoother blob position estimates. The constant velocity model for each axis is given as follows: where T s is the discretization step, x k ∈ R 2 is the state vector containing the position and velocity along the corresponding axis and w k ∈ R 2 is the process noise. The observation model along a single axis is given as follows: where z k ∈ R is the position observation along the corresponding axis and v k ∈ R is the measurement noise. If the detector is unable to provide measurements and the pose tracker removes the pose from the tracking set, the linear Kalman filter is still able to provide blob position estimates. Experimental validation of the described methods is performed in an indoor Optitrack environment with an Intel Realsense D435 RGB-D camera. To ensure ground truth is available for detection validation, reflective markers are attached to both the camera and the blob. In order to determine the transformation between the camera optical frame and the reflective markers attached to the camera, an optimization-based calibration approach is used as described in [32].
Results are shown in Figures 7 and 8. The experiments are performed with the UAV in constant motion while looking at the general direction of the painted blob. Figure 7 shows a relative difference between the ground truth UAV motion in the world frame and the UAV motion as observed from the detected blob frame. Figure 8 presents the comparison of ground truth and detected blob positions expressed in the world frame. It is important to note that camera calibration errors can manifest themselves as static offsets between the detected and ground truth blob positions in Figure 8. However, in this case, the visual detection provided a reliable blob tracking results which is a direct consequence of careful camera calibration.

Simulation
The environment used for simulating the UAV and manipulator dynamics, as well as the contact with the environment, is the widely accepted Gazebo simulator. It is realistic and highly modular, with a large community and a support for the robot operating system (ROS), which is also the primary implementation environment for impedance control, motion planning and blob detection. Through ROS, Gazebo has a large variety of developed plugins realistically simulating various sensors and actuators. All simulations were conducted with Linux Ubuntu 18.04 operating system and ROS Melodic middleware installed.
The UAV is modeled as a single rigid body with n p propellers mounted at the end of each arm. As propulsion units, these propellers generate thrust along the z axis of the UAV body. To simulate the propeller dynamics, the rotors_simulator package is used. It contains a plugin that models thrust based on the user-provided propeller parameters [33]. Furthermore, to obtain the UAV attitude and position, IMU and odometry plugins are mounted on the vehicle. The manipulator was mounted on the body of the UAV and consists of three joints connected with links. A rod type tool is mounted as the end-effector, with a force-torque sensor required by the impedance controller. Furthermore, a monocular camera with an infrared projector is also mounted for the blob detection.

End-Effector Motion Distribution Analysis
Given some end-effector configuration, the inverse kinematics is responsible for finding the UAV position and yaw angle, as well as the manipulator joint values that satisfy the desired configuration. The parameter β from Equation (3) defines a ratio of how much the manipulator joints and UAV position and orientation contribute to achieving the desired end-effector configuration, as described in Section 3.1. Recalling the values, β = 1 only moves the UAV in the direction of the desired end-effector configuration; and β = 0 uses the inverse kinematics of the manipulator to achieve the desired configuration.
To determine the influence of β on the overall system, an analysis was conducted with different β values. The desired end-effector configuration was chosen to be in contact with a plane perpendicular to the bridge wall which required the force reference along the x axis. The waypoints for the trajectory planner were kept the same across all trials, and only β was changed. The results of this analysis are depicted in Figure 9. As can be observed, all trials produced very similar results with oscillating force upon contact and eventually reaching the desired reference, providing us with no obvious conclusion regarding how to select the optimal β. However, following the dexterity analysis from Section 3.1, and only relying on the manipulator motion might drive the system close to its limits due to the UAV body movement. On the other hand, the motion of the UAV induces disturbances in the end-effector pose control. The manipulator is therefore responsible for compensating errors introduced by the motion of the UAV body. Taking all of the aforementioned into account, the value is chosen as β = 0.5 so that both the manipulator and the UAV are simultaneously used to maintain a steady contact force.

Bridge Sensor Mounting
Since the concept of this paper was to mount inspection sensors on a bridge, the simulation trials were tailored in the same direction. After spraying the first component, it is necessary to achieve and maintain a stable contact while the second adhesive component on the sensor dries. Since the manipulator is attached above the propellers, the workspace of the manipulator is limited to contact above the UAV or on the plane perpendicular to the ground.
Naturally, the first set of simulation trials were conducted by holding the desired force on a plane perpendicular to the ground. In this case, the contact force only acts along the x axis and the response is depicted in Figure 10. The time delay between the planned and executed contact is present due to the impedance filter which slows down the dynamics of the referent trajectory. After the initial contact, there are some oscillations and an overshoot which diminish over time and the desired force reference is achieved. The second set of simulation trials included an inclined contact plane. This requires the UAV approach from below the plane and achieving contact perpendicular to the plane. Since the plane is inclined for δ = 68 • , the planned force referent values have components in both the x and z axes, as shown in Figure 11. Similarly to the previous example, the force response has some oscillations around the instance of contact, but it eventually settles and reaches the desired force reference. The simulation tests for δ = 0 • and δ = 68 • were performed n = 10 times for each case, as depicted in Figure 12. The left portion of the figure is a dot product between the normal of the blob r t and the end-effector orientation vector r ee . If the value of the dot product r t · r ee = 1, the two vectors are parallel which results in a successful approach. For both angles, the dot product is very close to 1 and the orientation error is negligible. On the right, the distance between the center of the target and contact point is shown. The error distance is in both cases less than 0.1 m, which ensures the relatively high precision of sensor mounting, well within margins for the bridge inspection. The accompanying video of simulation tests can be found on our YouTube channel [34].

Conclusions
This paper presents a step towards autonomous bridge inspection by investigating the possibility of mounting various inspection sensors using an aerial manipulator. Currently, inspectors use specialized trucks with cranes and baskets in order to access the area underneath the bridge. This inevitably leads to road closure which poses an inconvenience for both inspectors and traffic. To alleviate this problem, the aforementioned aerial manipulators can be used to access difficult-to-reach areas of the bridge. As mounting sensors require forming a bond between the wall and sensor, we envision using a two-component adhesive with a short cure time. Since the aerial manipulator has to achieve and maintain contact with the sensor mount point, short cure times are desirable because of te limited flight time of these platforms. Nevertheless, current flight times of outdoor multirotors reach up to 30 min, which ensures enough time for the two adhesive components to form the bond.
Although preliminary, the results of this paper seem promising. The visual detection was extensively tested and reliably tracks the blob position. The adaptive impedance controller is capable of maintaining the required force. Even though there are some oscillations and settling times in the force response, in practical use, it does not make much difference since the curing time of the adhesive is at least several minutes. The trajectory planner was augmented to plan in the force space which allows for setting the force reference step change before the contact. The simulation results show the high repeatability of the overall system which gives us the confidence to perform experiments in a real-world environment.
Our first step in future work was to perform experiments in a controlled laboratory environment. The outdoor environment poses a different set of challenges including the lower accuracy positioning system and unpredictable disturbances, i.e., wind gusts. Since these factors will inevitably reflect on the overall end-effector accuracy, we are looking into augmenting the manipulator to be able to compensate for lateral movements, as well as roll and yaw angles. To further increase the system's accuracy, the developed visual tracker will be used to improve feedback around the tracked blob on the bridge wall in real-world experiments.

Conflicts of Interest:
The authors declare no conflict of interest.
After reordering, we obtain: where σ(t) = [p 1 e(t) + p 2ė (t)]. By choosing: where γ d is a positive constant, Lyapunov condition Equation (A7) becomes: i.e., for the adaptation law to be stable, g(t) should be bounded. Since x r ,ẋ r andẍ r are bounded, so are e,ė andë. Therefore, g(t) is also bounded, i.e., the condition in Equation (A9) is satisfied. The adaptation law is finally obtained by taking the derivative of Equation (A3), and substitutingġ(t) with Equation (A8), yields the (17). Parameters γ and γ d dictate the adaptation dynamics. Based on the measured contact force, the error adaptation law Equation (17) estimates the adaptation parameter κ (reciprocal value of the environment stiffness), which is then used in Equation (16) for calculating the referent position x r .