Compliant Bimanual Aerial Manipulation: Standard and Long Reach Configurations

The ability of aerial manipulation robots to reach and operate in high altitude workspaces may result of interest in a wide variety of applications and scenarios that nowadays cannot be accessed easily by human operators. Consider for example the installation of sensors in polluted areas, the insulation of leaks in pipe structures, or the corrosion repair in power lines and wind turbines. This paper describes the application of a human-like dual arm aerial manipulator for the inspection of pipe structures, typical of chemical plants, involving the installation and retrieval of sensor devices. The goal is to reduce the time, cost, and risk with respect to conventional solutions conducted by human workers. Two configurations of the aerial robot are considered and compared: the standard, in which the arms are installed at the base of the multirotor, and the long reach configuration in passive pendulum, which extends the effective workspace of the manipulator and increases safety during the operation on flight. The kinematic and dynamic models of both configurations are derived, proposing a unified notation for the equations of motion, and a force/position control scheme that relies on the servo controller and the mechanical joint compliance. The paper also describes a simulation framework used for validating the execution of the aerial manipulation task before the realization of the real experiments, which contributes to reducing the probability of failure. The potential application of the standard and long reach configurations is evaluated in two sensor installation tasks carried out in an indoor testbed.


A. AERIAL MANIPULATION
The aerial manipulation is a research field that proposes the integration of robotic arms in Vertical Take-Off and Landing (VTOL) Unmanned Aerial Vehicles (UAV) like multirotors [1]- [4] and helicopters [5] [6], whose interest is motivated by the necessity to conduct certain operations in high altitude or difficult access workspaces, reducing the time, cost and risk involved in conventional solutions requiring the deployment of vehicles, cranes and other infrastructures. The application of this technology may result especially useful in industrial facilities like chemical plants or refineries, where contactbased inspection operations are conducted periodically over extensive pipe structures [7]. Other potential applications are the inspection of power lines [8], the cleaning of the blades of wind turbines [9], replacing light bulbs on large buildings [10], or the realization of tasks with tools [11].
The development of an aerial manipulation robot is still a technological challenge since it involves the integration of control, perception, planning and manipulation capabilities in an aerial platform with limited payload and reduced space. In particular, the design and development of new prototypes of lightweight manipulators has become a research topic of interest in last years [12]- [16], since it is not possible to find nowadays commercial solutions which are suitable for their integration in aerial platforms. As result, there is a significant number of morphologies and kinematic configurations of aerial robots, including manipulators with a single degree of freedom (DOF) [17] [18], robotic arms with several joints [2] [3] [12] [13], dual arm systems [15] [16] [19] [20], long reach aerial manipulators [21] [22], parallel manipulators [23] [24], or even the multirotor body may become the manipulator itself [25]. Some works propose the integration of grippers [26] or tools for conducting particular tasks like tree pruning [27], tree cavity inspection [24], or object grasping [10] [11].
Unlike a fixed-base manipulator, the integration of a low weight robotic arm in an aerial platform presents two main drawbacks. On the one hand, the performance of the arm in terms of workspace, reach and dexterity will be reduced due to the payload and the motion constraints associated to the landing gear and the propellers [15]. Since the aerial robot is intended to operate in contact with the environment, the risk of collision increases as the distance between the end effector or the multirotor frame and the blades is lower. On the other hand, the reaction wrenches induced over the aerial platform due to the motion of the arm and the contact forces exerted on flight [28][29] [30] will reduce the positioning accuracy or even affect the stability of the aerial platform, complicating the realization of grasping or grabbing operations. These two problems have motivated the development of compliant [16] [26] manipulators and the introduction of the long reach (also known as passive pendulum) configuration [21] [22]. Fig. 1 depicts the two morphologies of aerial manipulation robots considered in this work: the standard configuration, in which the arms are attached at the base of the multirotor, and the long reach configuration, which improves safety increasing the separation distance with the environmental obstacles.

B. COMPLIANCE IN AERIAL MANIPULATION
The compliance in robotics can be defined as the ability of accommodation to external forces acting over a manipulator [31]. This concept is closely related with safety, especially in the cooperation with humans, since it is expected that the robot is capable to react in a safe way in case of unexpected impacts or collisions with obstacles in the environment [26] [32], reducing the potential injuries and damages. Depending on the implementation, it is possible to define two levels of compliance: mechanical [16] [17] and at control level [18]. In the first case, the manipulator integrates some elastic or flexible element in the joints [16] or links [21] that absorbs the excess of energy generated by an impact, transforming the kinetic energy due to the motion of the manipulator into elastic potential energy stored in the joints or links. On the other hand, most industrial manipulators (KUKA, ABB) use accurate force/torque sensors and high performance motors which allow the emulation of desired second order dynamics, characterized by a "virtual" inertia, stiffness and damping, as response to the external forces measured by the sensors.
In our previous work, we developed several prototypes of compliant robotic arms designed for aerial manipulation [15] [16] [26], since the strong limitations in the payload imposed by the aerial platform require the design of new mechanisms which are very low weight. The benefits of the mechanical joint compliance were firstly evidenced in [32], proposing the passive-active compliance method to improve the response of the manipulator to impacts. The 3-DOF compliant joint arm developed in [26] introduces the spring-lever transmission mechanism with joint deflection measurement, demonstrating the possibility to estimate and control the torques and forces from this angle. In [16], we presented the anthropomorphic, compliant and lightweight dual arm system employed in this work, detailing the mechanical design focused on the servo protection. Two force control schemes were proposed: at joint level based on joint deflection measurement, and in Cartesian space [33] [34], using a camera head for this purpose. Ref. [34] also introduced the concept of physical-virtual impedance control as a generalization of the variable stiffness actuators [35] [36], avoiding the necessity of a second actuator and thus reducing the weight. The long reach aerial manipulators [21] [22] were developed motivated by the convenience to improve safety by increasing the distance between the aerial platform and the environmental obstacles.

C. POSITIONING AND CONTROL
The application of aerial manipulation robots for inspection operations in outdoor environments requires the use of high accuracy positioning systems so the manipulator can conduct its tasks without undesired oscillations. Taking into account that the reach of the anthropomorphic dual arm used in this paper is 50 cm, the accuracy in the position control of the multirotor should be below 5 -10 cm. Real-Time Kinematics (RTK) sensors may provide positioning accuracies in this range, although the lack of GPS visibility or the interferences due to obstacles limit their application in factories with big metallic surfaces. Some works propose the use of vision [37], visual-inertial [38] and laser [39] sensors for the navigation of quadrotor vehicles outdoors. Tilted-rotor hexarotors [41] [42] are especially suitable for accurate position and force control during the realization of tasks involving physical interactions on flight [17] [18][30] [34], or for compensating deviations due to wind perturbations [28][29] [40].

D. APPLICATIONS AND DESIGN CONSIDERATIONS
The potential applications of the aerial manipulation robots are determined by the level of dexterity of the manipulator integrated in the aerial platform. In this sense, the anthropomorphic dual arm employed in this work aims to replicate the human arm in terms of size and kinematics motivated by the interest in reproducing the human skills in the realization of a wide variety of operations in high altitude and difficult access workspaces. Besides its application in the installation and retrieval of sensor devices in pipe structures, which is the scope of this paper, the inspection and maintenance of power lines is another illustrative example. This technology may result especially useful for reducing the time and cost devoted by the companies in the realization of this kind of tasks, avoiding also the risk for the human workers. The vast extension of power lines and the huge number of devices that require periodic maintenance, as depicted in Fig. 2, justify the design and development of aerial manipulators capable of conducting operations like the one shown in Fig. 3.
The long reach configuration not only increases safety in the interaction with the environment, but also allows the close collaboration with human workers (aerial co-working) in tasks like fast tool delivery [52], as Fig. 4 represents. This avoids unnecessary displacements of the operators once they are deployed in the power line in case they need other tools.
Roughly speaking, in the design of an aerial manipulation robot, it is possible to distinguish three categories attending to the size and payload capacity of the aerial platform: low (up to 1 kg), medium (1 -5 kg), and high (>5 kg) payload. As reference, these correspond to a DJI F550 hexarotor, a DJI Matrice 600, or the unmanned helicopter employed in [5], respectively. In general, it is convenient that the aerial platform is as small as possible to facilitate its deployment and for safety reasons. However, in practice, the size and weight of the whole aerial manipulator are determined by the weight of the objects to be manipulated, or by the magnitude of the forces to be exerted. For example, the dual arm shown in Fig. 3, with a total weight around 3 kg, provides 0.7 kg of payload per arm, sufficient for manipulating the helical flight diverters or the markers depicted in Fig. 2, as well as hand tools like screwdrivers or pliers. However, tasks like drilling, brushing or cleaning usually involve exerting relatively high forces (in the range of 10 to 50 N), requiring specific tools or devices and manipulators with higher torque capacity.
The study presented in this paper is intended to facilitate the choice of the most appropriate configuration for the aerial manipulation robot according to the particular environment or task of the user, evaluating and comparing the benefits and drawbacks of the standard and long reach configurations.

E. CONTRIBUTION OF THIS WORK
The main contribution of this paper is the application of a compliant joint, dual arm aerial manipulation robot in two pipe inspection tasks that involve the grasping and installation of sensor devices or inspection tools. The execution of these two operations is illustrated in Fig. 5. The paper describes the technological solution developed for this purpose, unifying the models and control schemes used in our previous work [22] [34], considering two possible configurations: the standard one in which the robotic arms are attached at the base of the aerial platform, and the long reach configuration with passive joint at the base [22]. This work is an evolution of our previous research, since our aim now is to demonstrate the feasibility and benefits of the aerial manipulation technology in certain inspection and maintenance operations requiring physical interaction with the environment, evaluating this in a scenario with pipe structures, typical of chemical plants. The paper details the hardware and software integration of the multirotor with the compliant dual arm manipulator [16], introducing as novelty a ROS-gazebo simulation framework used to validate the execution of the task to prevent mission failures. The UAV Abstraction Layer (UAL) described in [44] is extended here to interface the dual arm system along with the autopilot and the PX4 firmware [43]. The experiments, conducted in an indoor testbed, are intended to evaluate the performance of the aerial manipulator in two tasks. In the first one, a grasping method is implemented (standard configuration) to retrieve an inspection tool autonomously, whereas the installation task is conducted by a human operator using a 6-DOF joystick and an on-board first person view (FPV) camera. In the second one, the long reach aerial manipulator is used to place a sensor device below the pipe, what cannot be done with the standard configuration.
The rest of the paper is organized as follows. Section II and III describe the aerial manipulation robot and the hardwaresoftware architecture, respectively. The operation protocol as well as some safety recommendations are also provided here. Section IV covers the kinematics and dynamics of the aerial robot in both the standard and long reach configurations, and Section V describes the control methods. Section VI presents the experimental results, whereas Section VII summarizes the conclusions of this work.

A. AERIAL PLATFORM
The UAV employed in this work is a hexarotor manufactured by Drone Tools, whose main specifications are indicated in TABLE 1, showing in Fig. 6 a picture of the platform with the onboard components. These are the PixHawk 2.1 autopilot, the Intel NUC computer board, an Ubiquiti Rocket M5 5.8 GHz wireless link, the Futaba R6303SB FASST receiver, and three LiPo batteries: one 4S 3800 mAh battery that feeds the onboard computer and the Ubiquiti, and two 6S 7000 mAh batteries required by the hexarotor platform.
The Pixhawk autopilot is used along with the PX4 flight stack (version 1.8.2) since both are open hardware-software initiatives with extensive support from the community. The PX4 firmware implements four nested Proportional-Integral-Derivative controllers: angular rate, orientation, position, and velocity. The first two control loops use the onboard Inertial Measurement Unit (IMU) to obtain orientation and angular rates. Most of the IMU drivers provide the measurements at 1 kHz, publishing the estimation of the filter at 250 Hz. The pose of the UAV obtained from the Vicon system is used to update the local position estimation of the PX4 estimator, relative to the take-off position. Optionally, this information can be fused into the vehicle attitude estimation. The messages from Vicon to PX4 should be streamed at a rate between 30Hz and 50 Hz so the PX4 estimator can integrate this information properly.

B. COMPLIANT DUAL ARM MANIPULATOR
The manipulator integrated in the aerial platform is the humanlike dual arm system with compliant joints described in [16].
Each arm provides four degrees of freedom (DOF's) for end effector positioning: three at the shoulder (pitch, roll, and yaw) and one at the elbow (pitch). Fig. 7 shows the arms adopting different poses, indicating their main features in TABLE 2. The dual arm system is built from a customized aluminum frame structure manufactured by laser cut that supports the servo actuators (Herkulex DRS-0201/0101) and the polymer flange bearings (igus® EFOM-08). A compact spring-lever transmission mechanism introduced between the servo shaft and the output link shaft transmits the motion in such a way that, measuring the deflection angle due to the compression of the springs, it is possible to estimate and control the torques and forces [16] [34]. The experimental results evidence that the mechanical compliance provided by the springs improves the safety and robustness of the aerial robot in those situations involving physical contact with the environment, for example during the grasping and installation of the inspection devices (see Section VI). The natural damping of the springs and their ability to absorb and store the energy of impacts at higher rates than the servos contributes significantly to protect the gearbox of these devices, reducing therefore the probability of damage. The end effector of the arms is a simple hook used to grasp or retrieve inspection devices by the handles (Fig. 19), without the need of additional servos for closing the gripper, thus reducing significantly the weight and inertia of the arms.  [16], where the joint deflection was measured with the Murata SV01A potentiometers, in this work, we employed magnetic encoders AMS 5047 from Austria Micro Systems in the shoulder pitch and elbow pitch joints of the left arm to estimate and control the joint deflection with higher accuracy [22]. Fig. 8 illustrates the integration of the sensor with the magnets (8 mm Ø, 6 mm length) in the elbow joint. As it can be seen, the printed circuit board with the sensor is attached to the output frame and the magnet is glued to the servo shaft. The magnetic encoder presents three main benefits w.r.t. the potentiometers: 1) it is a contactless sensor, so it is not affected by misalignment errors between the servo shaft and the output link shaft, 2) higher accuracy (0.2°) at rates above 1 kHz, and 3) less affected by signal noise. These devices are connected to a STM32Nucleo L0 microcontroller board through a SPI interface, sending the data packet to the Intel NUC computer board through a USART interface at 200 Hz rate.

C. INTEGRATION IN AERIAL PLATFORM
As shown in [15], the effective workspace of the manipulator is typically reduced due to the motion constraints associated to the landing gear and the propellers when the manipulator is attached at the base of the multirotor, what is denoted here as standard configuration. The proximity between the propellers and the obstacles in the environment also increases the risk of crashes during the realization of grasping or installation tasks on flight. Additionally, the airflow generated by the propellers induces a certain deflection in the compliant joints of the arms, reducing the positioning accuracy of the end effector. In order to avoid these problems, we introduced the concept of long reach aerial manipulators [21] and the passive pendulum (or swing) configurations [22], where the manipulator is attached at the tip of a long reach aluminum link supported by a pair of flange bearings at the base of the multirotor, allowing the free rotation of this long reach link with respect to the base. There are two main reasons to consider a passive joint in this sense. On the one hand, because, given the mass and the length of the long reach link, it would be necessary a very high torque servo to control the angular position, which would increase the total weight. On the other hand, because a passive joint contributes to increasing safety during the physical interactions between the manipulator and the environment, preventing that torques in the pitch angle are exerted over the multirotor base, what could destabilize the aerial platform. TABLE 3 compares some of the benefits and drawbacks of both configurations, whereas Fig. 9 shows the mechanical integration. In order to reduce the lateral deflection of the long reach link [21] [22], the pendulum is built with two parallel aluminum links. The integration of the arms in the standard configuration is described in more detail in [15] and [16]. In this case, the arms are directly attached to the feet of the landing gear through a pair of square aluminum profiles (6 × 6 × 500 mm size), using the shoulder roll joints to lift the arms above the floor.

1) DESCRIPTION
The software architecture used for the control of the aerial platform in both the standard and the long reach configurations is based in a framework called UAL (UAV Abstraction Layer) developed in our previous work [44]. This library allows the development of customized control software independently from the particular hardware implementation (autopilot and multirotor platform) by defining a minimal but complete set of functionalities:  Take-off to a desired height  Go to a desired position and orientation (yaw)  Velocity and yaw rate control  Land on current position.  Set home in current position  Get control from manual flight operation At the same time, this layer provides a continuous stream of data relative to the UAV, such as pose, velocity, transform estimations, control mode, references, or battery level. The UAL software is designed so it can be interfaced in two ways: 1) by its class interface, coded in C++, the UAL itself is a class that defines a method for every functionality and data stream, or 2) by a ROS interface, integrated into the Robot Operating System (ROS) framework, so any UAL object optionally exposes its interface by means of ROS services and topics. Both mechanisms may coexist (and by default they coexist) in a certain implementation, allowing the user programmer to get the best of each of the approaches: fast communication with class interface, and network-wide reachability with the ROS interface. These two interfaces are illustrated in Fig. 10.  Once the interface is defined, the communications with the autopilot and the specific configurations are handled by the specific backend software. The aerial manipulator described in this paper employs the Pixhawk autopilot and the PX4 flight stack, so the required backend is the MavrosBackend, which is one of the most tested both in simulation and in real flights.

2) SIMULATION ENVIRONMENT
Before the execution of an aerial manipulation mission like the sensor installation task described in Section VI it is convenient to validate its execution previously in simulation in order to avoid crashes or collisions with the environmental obstacles (see the pipe structures in Fig. 5). In this sense, the UAL framework facilitates the realization of simulations tests in such a way that these are indistinguishable from the real tests in terms of software execution. The user only needs to indicate in the launch file the execution mode: simulation or real. Since all the functionalities are accessed through the UAL interface, the execution of the user's program will be identical in both modes. In the case of the aerial platforms described in this paper, the simulation is even more realistic since it makes use of the PX4 software in the loop (SITL) simulation capabilities. This means that the control software that will run into the Pixhawk autopilot in real experiments is the same that runs in the simulation computer, emulating the sensors and motors. Fig. 11 depicts the ROS-Gazebo simulation environment with the dual arm aerial manipulator in pendulum configuration.

3) ARMS CONTROL INTERFACE
The simulation environment described before incorporates the Arms Control Interface (ACI), a software module that is used to simulate the kinematics, dynamics and control of the dual arm integrated into the multirotor, also defining the methods to control and get feedback from the arms:  Set the joint references (external control mode)  Set the Cartesian references of the end effectors  Get the current joint position estimation  Get the current left and right end effector position As it will be explained in the next subsection, these methods are interfaced through a ROS-UDP bridge node used as back-end with the dual arm control program. For the simulation, two backends were developed: one based on ros_control packages used to simulate the physics and joint position-torque control of the arms along with the multirotor dynamics, and a second one that implements only the kinematics for animating the 3D model of the aerial robot.

B. DUAL ARM CONTROL PROGRAM
The control program of the arms has been developed in C/C++ to facilitate the portability of the source code through different computer boards (Intel NUC, Raspberry Pi, Odroid, …), using the standard POSIX library with the g++ compiler and the cmake tool. The program implements several functionalities or tasks involved in the realization of the experiments detailed in Section VI. Some of these are: 1) go to rest position, 2) go to operation position, 3) visual servoing, 4) teleoperation with joystick, 5) grasping, 6) force control, 7) enable-disable torque control, or 8) external joint/position control mode. The project is developed around the TaskManager class, supported by the ArmsController and the ServoState classes that take care of the communication with the Harkulex servos, and the Kinematics class that implements the forward and inverse kinematics [16]. This software architecture is depicted in Fig. 12. The different data flows involved in the execution of the program are handled by the corresponding threads. These are:  Left/Right Arm Data Thread: the data provided by the Herkulex servos is accessed through USART interface, sending a request packet to a particular servo identified by its ID, indicating the initial address of the register map and the number of bytes to read. The thread waits until the response packet is received from the servo, updating the state variables within the ServoState instance. The update rate is set to 50 Hz to prevent transmission errors, taking into account that each USART interface supports the communication with four servos at 115200 bits/s.  STM32 Board Data Thread: the joint deflection signal measured by the magnetic encoders is sent through SPI (Serial Peripheral Interface) to the STM32L0 Nucleo board that generates a data packet sent through another USART to the Intel NUC computer board at 200 Hz.  GCS Thread: during the realization of the experiments, the operator of the manipulator indicates the desired task by means of the operation code sent from the Ground Control Station (GCS) through a UDP socket over the wireless link. This code determines the particular method of the TaskManager instance to be executed.  Teleoperation Thread: the teleoperation task allows the control of the end effector position of both arms using a 6-DOF Space Navigator mouse connected to the GCS laptop, so the human operator can control both arms with a single device. The velocity references generated by this device are also sent through a UDP socket and received in this thread.  Arms State Publisher Thread: the arms control program uses UDP sockets to report the state of the arms (joint or end effector position, velocity, references, torque/force, current task under execution) to other processes that may need this information, including ROS nodes, MATLAB-Simulink blocks, or other programs. The data packet is simply defined as a data structure in C language.  External Reference Thread: as mentioned before, one of the task implemented by the TaskManager is the external joint control mode in which the arms follow a reference sent through a UDP socket by another program or ROS node. This mode was used in [47] for the execution of a pre-planned trajectory with obstacle avoidance.

C. SAFETY CONSIDERATIONS AND PROTOCOL
Although it is desirable that the aerial manipulation tasks are conducted almost autonomously, a backup pilot in charge of the aerial platform must supervise the operation and take the control from the autonomous mode to cope with any irregular behaviour. Due to the limited space of Vicon testbed (15 × 15 × 5 [m], see Section VI), the pilot will stay behind a Plexiglas wall to protect himself while the aerial platform is flying. Due to the number of components involved in the execution of the flight tests, it is necessary to follow a strict protocol to minimize the probability of failure, avoiding thus the potential crashes and damages. No battery must be connected during the transportation and deployment of the aerial robot. Once this is placed on the take-off point, the onboard computer, the auto-pilot and the dual arm system are connected to their respective batteries to launch the software and make the initial tests. If the software check is correct, the safety pilot connects the multirotor battery and moves behind the protection glass. Finally, it is convenient to check that the propellers work fine applying manually a small thrust during a few seconds before the take-off operation.
During the realization of the aerial manipulation task, the aerial robot will be commanded and monitored from the GCS through a wireless link, identifying three data flows: 1) control commands for activating the different phases of the operation, 2) real-time feedback with the state of the robot, and 3) visual feedback for teleoperation. In case the available bandwidth is limited by the environment or the application, it is convenient to implement methods for ensuring a reliable service [50] [51].

IV. KINEMATIC AND DYNAMIC MODELS
This section describes the kinematic and dynamic models of the dual arm aerial manipulator in the standard configuration with the arms attached at the base of the multirotor, and in the long reach configuration, both of them evaluated separately in Sections VI-A and B. The main difference between the models is the introduction of the passive joint at the base of the LRM. The models and control schemes described here are based on our previous work [15][16] [34], although in this section we try to unify the notation and models of both configurations [22], remarking the differences w.r.t. previous implementations.

A. KINEMATIC MODEL
In the application of an aerial manipulation robot, it is usually defined three coordinate systems: the Earth fixed frame {} (inertial), the UAV base frame {} located at the IMU, and the manipulator frame {}, with ݅ = {1, 2} for the left and right arms, respectively. For convenience in the resolution of the forward and inverse kinematics, each arm defines a reference frame whose origin is located at the intersection point of the three shoulder joints, with the and axes pointing in the forward and upward directions, respectively. These definitions are illustrated in Fig. 13 and Fig. 14 for the standard and the long reach configurations. Note that the transformation matrix from {} to {} in the second case depends on the rotation angle of the swing (pendulum), being constant in the first case. This swing angle can be measured with a magnetic encoder [22]. It is easy to derive from these figures the corresponding homogenous transformation matrices: Here ‫ܦ‬ is the separation distance between the left and right arms, ‫ܦ‬ ௫ and ‫ܦ‬ ௭ are offset distances with respect to {}, and ‫ܮ‬ is the length of the pendulum link. The rotation angle of the passive joint is denoted by ‫ݍ‬ , whereas c(‫ݍ‬ ) = cos ‫ݍ(‬ ) and s(‫ݍ‬ ) = sin ‫ݍ(‬ ).
The transformation matrix of the aerial platform w.r.t. the Earth fixed frame is defined as follows: where ߶, ߠ, and ߰ are the roll, pitch, and yaw angles of the multirotor, respectively, and ா = ‫,ݔ[‬ ‫,ݕ‬ ‫]ݖ‬ ் is the position vector in the inertial frame. Since the points of interest in the aerial manipulation task (tool-bench, inspection points) are usually defined in the Earth fixed frame, it is necessary to compute their position relative to the arms frame, The forward-inverse kinematics of the anthropomorphic and compliant dual arm manipulator are detailed in [16], so the analytical expressions are omitted here. The position and force control methods described in Sections V-C and D are based on the inverse kinematics, not in the Jacobian, since the Herkulex servo actuators employed in the arms do not allow velocity or torque control, only position control with adjustable playtime (required time to reach the reference). However, smooth operation is still possible if the references are sent at the mid-point of the trapezoidal velocity profile [15]. In the following, and ∈ ℜ ସ will represent the vector of servo shaft and output link angular positions of the ݅ -th manipulator. The forward and inverse kinematic models, represented by : ℜ ସ → ℜ ଷ , and : ℜ ଷ → ℜ ସ , relate the joint variables with the tool center point (TCP) of each arm in the following way: Since each arm provides four degrees of freedom for end effector positioning, one of the joints (the shoulder roll in this case) is considered as redundant, imposing for simplicity that ‫ݍ‬ ଶ = ߮ . The force control scheme described in Section V-D relies in the concept of equivalent stiff-joint manipulator. If ( ) represents the real position of the end effector in the compliant joint arm, ( ) will represent the position of the same point in an equivalent stiff joint arm.

B. DYNAMIC MODEL
As in previous work [16] [22], the equations of motion of the aerial manipulator are derived applying the Euler-Lagrange formulation. Since this paper considers both the standard and the long reach configurations, it results convenient to provide a unified notation, taking into account that the only difference between them in terms of kinematics is the passive joint of the swing, ‫ݍ‬ . Therefore, the idea is to develop the dynamic model of the compliant joint dual arm aerial manipulator in swing configuration (as this is the most general case), remarking that the dynamic model of the standard configuration is obtained simply removing the terms associated to the passive joint. The vector of generalized coordinates is firstly defined as follows: in the swing configuration, ‫ݍ‬ .The corresponding vector of generalized forces is defined as: Here and are the forces and torques acting over the aerial platform, ଵ and ଶ are vectors of joint torques in the servo shaft (motor torque), whereas ଵ and ଶ are torques of the output links. The term ߬ is the torque at the pendulum joint in the long reach configuration. Since this joint is passive, it is assumed that ߬ = 0. Note that in this case, the aerial robot can be assimilated to a multirotor carrying a suspended load [48] [49], although constraining the rotation in one axis.
The kinetic energy of the aerial robot, ‫,ܭ‬ is the sum of four terms corresponding to the aerial platform, the pendulum, the output links, and the servo shafts, although the contribution of this term is almost negligible compared to the others: Here 〈݉ , 〉, 〈݉ , 〉, and 〈݉ , 〉 are the mass and inertia matrices of the aerial platform, the swing, and the ݆-th link of the ݅ -th arm, respectively, and the terms 〈̇ , ࣓ 〉, 〈̇, ࣓ 〉, and 〈̇ , ࣓ 〉 are the associated Cartesian and angular velocities. The potential energy of the system, ܸ, is the sum of the gravity terms and the elastic potential due to the deflection of the compliant joints: where ݃ is the gravity constant, ‫ݖ‬ = · [0, 0, 1] ் , and ݉ and ݇ are the mass and stiffness of ݆-th joint of the ݅ -th arm. Note that ߠ − ‫ݍ‬ is the deflection of the corresponding joint. The dynamic model is then obtained from the Lagrangian, defined as the difference between the kinetic and the potential energy, and the generalized equation of the forces: where ‫ܮ‬ = ‫ܭ‬ − ܸ is the Lagrangian, and the generalized coordinates and forces are given by Equation (8) and (9). The model can be expressed as usual in a compact matrix form: where , , and are the inertial, centrifugal and Coriolis, and the gravity terms, whereas and represent the elastic and damping terms of the joints.
As stated before, and according to Equations (8)- (11), the dynamic model of the compliant dual arm aerial manipulator in standard configuration can be obtained simply removing the terms associated to the passive joint of the pendulum ‫ݍ(‬ , ߬ , and the related terms in the kinetic and potential energies).

V. CONTROL
This section describes the general control framework of the aerial manipulator and the two control modes implemented in the dual arm system: position/trajectory for grasping, and contact force control for physical interaction. The compliant control is firstly analyzed at joint level, proposing later two additional tasks that involve the collaboration of both arms.

A. GENERAL CONTROL FRAMEWORK
The dual arm aerial manipulator implements a control scheme similar to the one depicted in Fig. 15. At higher level, the Task Manager takes care of generating the appropriate references for the aerial platform (position / velocity / heading) and the arms (position / force) according to the task to execute. The multirotor controller implemented in the Pixhawk autopilot consists of four nested PID controllers (angular rate, attitude, position, and velocity) accessed from the UAL, as indicated in Section III-A. The position and orientation of the multirotor are obtained from the Vicon positioning system available in the CATEC indoor testbed. The compliant dual arm provides two control modes, described in next subsections. The position controller is used in the grasping and installation experiment with the standard configuration (Section VI-A), whereas the force controller is applied in the sensor installation task using the left arm in the long reach configuration (Section VI-B). As described in [15], the wrench estimator introduces a correction term ( ௫௧ ) in the signal given by the attitude controller ( ) so the multirotor can compensate the reaction wrenches due to the motion and the physical interactions of the manipulator.

B. COMPLIANT JOINT CONTROL
The mechanical compliance provided by the manipulator and implemented by the spring-lever transmission mechanism (see Fig. 8) contributes to improve safety in the physical interaction with the environment and extends the capabilities of the servo actuators used for building this kind of robotic arms, whose performance is usually reduced to position control. Measuring the deflection angle of the joint, it is possible to estimate and control the torque through the position of the servo shaft, as well as to control the output link position, as Fig. 16 illustrates. This scheme is a particular implementation of the series elastic actuators described in [45] [46] in which the force control problem is formulated as a position control scheme.
The deflection angle ∆ߠ is defined in the first place as the difference between the servo shaft and the output link angular positions, ߠ and ‫,ݍ‬ respectively: This angle and its derivative are measured with the magnetic encoder shown in Fig. 8. For small deflection angles (∆ߠ < 10°) the spring-lever transmission behaves as a torsion spring of stiffness ݇ and damping ݀, so the torque transmitted by the servo to the output link can be estimated as follows: The equivalent torsional stiffness ݇ can be obtained from the spring stiffness ‫ܭ‬ ௦ and the lever length ‫ܮ‬ ௩ considering that the pushing force ‫ܨ‬ ௦ exerted by the spring is almost orthogonal to the lever frame: (16) Note that the term ‫ܮ‬ ௩ ∆ߠ represents the compression of the springs, assuming that sin(∆ߠ) ≈ ∆ߠ for small deflections. The damping coefficient ݀ can be obtained from the impulsive response of the compliant joint, as this behaves as a typical mass-spring-damper system. This parameter determines the rate at which the spring is able to absorb the energy of impacts in a passive way. Two control tasks are defined for the compliant joint, as shown in Fig. 16: torque control, and output link position control. On the one hand, let us consider that the output link is in contact with the environment, exerting a certain force in quasi-static conditions in such a way that ‫ݍ‬ is almost constant. In that case, the torque is proportional to the deflection angle (Equation (15)), and this can be controlled through the servo position (Equation (14)). The servo actuators used in this work are commanded sending a data packet with the reference position ߠ at 50 Hz (according to the user manual, the internal tick of the Herkulex servos is 11.2 ms, considered here as update period). The PID position controller with trapezoidal velocity profile embedded in the servos is assimilated to a first order system whose input is the servo position reference ߠ : where ܶ ௦ is the equivalent time constant of the servo, identified experimentally (ܶ ௦~5 0 ݉ ‫.)ݏ‬ The torque controller takes as input the torque error: giving as output the torque correction angle ∆ : where and are the proportional and integral gains of the torque controller. On the other hand, the position control task is intended to compensate the deflection of the joint due to the gravity effect, improving in this way the positioning accuracy. The output link position error is defined as: The controller gives as output the position correction ∆ : where and are the proportional and integral gains of the position controller. VOLUME XX, 2019 9 The servo position reference is the sum of the current servo position, , and the correction angles, ∆ and ∆ : introducing the variable = {, } to switch between both control modes.

C. DUAL ARM POSITION-TRAJECTORY CONTROL
The position-trajectory controller of the arms is based on the inverse kinematics [16] and on the embedded servo position controller. Each servo receives a data packet indicating the goal position and play time, that is, the desired time to reach the joint reference, generating internally a trapezoidal velocity profile that satisfies these two constraints [15]. In order to achieve smooth trajectory tracking in bimanual manipulation tasks like object grasping, the servo references are sent at the midpoint of the velocity profile, exploiting the Velocity-Over-Ride (VOR) mode of the servos to avoid sudden variations of the angular velocity. Two trajectory control modes can be identified depending on the provided reference: position or velocity. These were applied in the grasping and installation operation described in Section VI-A. In the grasping maneuver, the TCP of the two arms is guided following a linear trajectory from their current position to the goal position given by the markers placed on the object to grasp. For each iteration of the control loop, the reference position is updated in the following way: where ் and are the current and goal positions of the end effector, respectively, ‫ݒ‬ and ܶ are the desired speed and the control period (20 ms), ் is the error between the reference position and the current TCP position, whereas ∆ ீ is a term that compensates the deflection due to gravity. These vectors are illustrated in Fig. 13. The joint variables are then obtained applying the inverse kinematic model given by Eq. (7). The second term in the right side of Equation (23) is the position step applied in the direction of the normalized error vector, whose amplitude can be tuned with ‫.ݒ‬ This method is evaluated in Section VI-A-3.
On the other hand, the installation of the inspection device (Section VI-A-4) is conducted manually using a 3DConnexion Space Navigator joystick to command the Cartesian velocity of the end effector of both arms in the following way: Here ‫,ݔ∆‬ ‫,ݕ∆‬ and ‫ݖ∆‬ ∈ [−1, 1] are the non-dimensional normalized velocity references in the XYZ axes given by the operator of the arms through the joystick, multiplied by the maximum speed constant ‫ݒ‬ ௫ .

D. COMPLIANT FORCE CONTROL BASED ON CARTESIAN DEFLECTION
As described in Section II-B, the left arm integrates magnetic encoders in the shoulder pitch and in the elbow pitch joints to estimate and control the contact forces in the XZ axes, which will be used in the sensor installation task presented in Section VI-B. The method considered here is based on the concept of Cartesian deflection employed in [34], adapted to replace the vision-based measurement by the encoders of the servos and the deflection sensors. Unlike the analog potentiometers used in [16] [26], the magnetic encoders reduce the signal noise and increase the accuracy (14-bit resolution), which contributes to improves the performance of the controller.
The Cartesian deflection is defined as the deviation in the position of a representative point (the tool center point) due to the deflection of the joints, compared w.r.t. the position of the same point in an equivalent stiff-joint manipulator. It can be obtained easily applying the forward kinematic model over the servo position and the output link position vectors, that is: where ∆is the Cartesian deflection, and ௦௧ and are the TCP position in the equivalent stiff joint arm and in the compliant joint arm. As described in [34] and [22], the contact force exerted at the TCP can be estimated from the Cartesian deflection considering the virtual Cartesian stiffness matrix obtained from the physical joint stiffness matrix and the Jacobian of the manipulator : As it will be shown in the experimental results presented in Section VI-B, and according to Equation (27), the Cartesian stiffness matrix depends on the inverse of the Jacobian, so the stiffness will tend to increase rapidly as the manipulator tends to reach the kinematic singularities, where the determinant of the Jacobian is close to zero. This is undesirable as the servo actuators may not be able to deliver the required torque to reach the force reference. For that reason, it is convenient that the arm adopts the L-shaped pose (90 degrees rotation in the elbow joint) as nominal operation position to exert forces in the forward (X-axis) or vertical (Z-axis) directions.
The implemented contact force control scheme is depicted in Fig. 17. The idea is to control the force indirectly in terms of deflection through the position control of the servo shaft, as in the Series Elastic Actuators [45] [46]. The integration of a spring-lever transmission mechanism with deflection encoder in the shoulder and elbow pitch joints of the left arm allows the estimation and control of the contact forces in the ଵ and ଵ axes, which is enough for the sensor installation task shown in Section VI-B. Note that this scheme is similar to the joint torque controller represented in Fig. 16.
 Bimanual grasping with contact force control: in some cases, the object to be grasped may lack handles or appropriate grasping points, so the arms should be able to exert a lateral force to keep the contact by friction. The contact force controller represented in Fig. 17 can be extended to incorporate a position correction term, similarly to the torque/position controller depicted in Fig. 16, in such a way that the position reference taken as input by the inverse kinematic block is: where ∆ ி and ∆ are the force-position correction terms, and ߛ ∈ [0, 1] is a factor that balances the weight of the force-position controllers over the TCP position, allowing the simultaneous realization of both control tasks. The force reference provided to each of the arms is given by: That is, the arms exert a pushing force of magnitude ‫ܨ‬ and opposite sign in the direction of the common line defined by the left-right TCP's. Note that humans tend to generate this kind of forces using the shoulder roll and elbow pitch joints, rotating the shoulder yaw joint~90 deg, so the force is applied in the Y-axis.  Un-plug operations: this task is similar to the previous one, although in this case each of the arms generates an opposite pulling force until the device is disconnected. This can be detected monitoring the force/displacement of the arms, as done in [34]. If ௦ and ் are the initial grasping point and the current TCP position, respectively, and assuming that there is no slip of the grippers while the arms exert the pulling force, then the disconnection event can be detected simply defining a threshold ∆ ௧ that represents the displacement of the TCP's w.r.t. the grasping point:  Using one arm as position sensor: since the arms are intended to work in contact with the environment, it is possible to estimate the position of the aerial platform relative to a grabbing point from the forward kinematic model (Section IV-A) and the information provided by the joint servos.

VI. EXPERIMENTAL RESULTS
The goal of this section is to validate the application of the compliant dual arm aerial manipulator in standard and long reach configurations in two pipe inspection tasks involving the grasping and installation of sensors or devices, using the dual arm described in [16]. The two experiments described below were conducted in the CATEC indoor testbed (15 × 15 × 5 m size) equipped with a Vicon positioning system.

1) OVERVIEW
In the inspection of large pipe structures in chemical plants, the human operators are frequently deployed in difficult access workspaces to measure the thickness of the pipes or to detect the corrosion or leaks with specific inspection tools. The operation is usually reduced to place the device in the point of interest, read the measurement, and retrieve the sensor. Since most of the time and cost is devoted to reaching the high altitude workspaces, we propose the use of a dual arm aerial manipulation system like the one described in this paper to conduct the grasping and installation of inspection devices in pipe structures. Fig. 19 illustrates this application, corresponding to the experiment detailed in next subsections. The inspection tool is a plastic box containing the sensor, two C-shaped aluminum frames attached to the base, which are adapted to the contour of the pipe, and a 45 cm length bar used as handle. Both the aerial platform and the tool are endowed with small infrared reflective balls use by Vicon to measure their position and orientation.

2) PHASES OF THE EXPERIMENT
The execution of the experiment can be followed in the video attached to the paper. It can be divided into twelve phases: 1. Take-off with the arms lifted above the floor 2. Approach to the tool bench where the tool is stored 3. Grasp the tool with the arms 4. Move to the workspace (pipe structure) 5. Approach slowly to the inspection point 6. Install the inspection tool over the pipe 7. Wait until the inspection operation is complete 8. Retrieve the inspection tool 9. Go back to the tool bench 10. Release the tool in the tool bench 11. Go back to the landing point 12. Lift the arms above the landing gear and land A sequence of images taken from the on-board camera are depicted in Fig. 20. In the experiment, the multirotor is used as mobile platform for the manipulator, hovering in a fixed position so that the arms can operate in the workspace within their reach. The way-points associated with the phases listed before are determined previously. The trajectory followed by the multirotor platform is mainly contained in the YZ plane of the reference frames associated to the testbed, maintaining almost constant the position in the X axis. The evolution of the multirotor position is represented in Fig. 21, indicating the different phases of the experiment.

3) BIMANUAL GRASPING IN HOVERING CONDITIONS
The grasping method (Section V-B) consisted of guiding the end effector of the arms, whose position is obtained from the forward kinematic model, to the desired grasping points over the inspection tool, whose position is given by Vicon. On each iteration of the control loop (50 Hz rate), the position error vector is computed and normalized, so in the next step, the arms will move in this direction with a displacement determined by the desired motion speed. Fig. 22 shows the convergence of the end effector of both arms to the grasping point during phase 3, considering the local frame associated to each arm, located at the intersection of the shoulder joints. In order to reduce the weight and inertia of the arms, no servo was used for the gripper. The end effector was a simple hook built with a single aluminum profile (see Fig. 7). Any object with handles, like the inspection tool shown on the right side of Fig. 19, can be easily retrieved using this mechanism. To release the grasped object, the forearm links should point downwards so the object is detached from the hook-gripper.
The positioning accuracy of the platform and the arms during the grasping operation has been evaluated in a 50 seconds interval in which the platform hovers in a fixed position while the end effector of the arms is tracking the grasping points. Fig. 23 and Fig. 24 represent the evolution of the grasping points and the end effector position, as well as the tracking error and the deviation of the multirotor position, caused by aerodynamic effects raised in the indoor testbed and due to the motion of the arms.

4) TOOL INSTALLATION WITH TELEOPERATION
The tool installation and retrieval operations were carried out by a human operator using a 3DConnexion Space Navigator mouse for controlling the velocity of the end effector of both arms (see Equation (15)), and the visual feedback provided by an on-board camera. A sequence of images corresponding to the installation phase can be seen in Fig. 25. The human operator is introduced in the loop since the manipulation task requires a certain level of dexterity and situational awareness that cannot be automatized easily.

1) OVERVIEW
This section demonstrates the application of the contact force control scheme based on Cartesian deflection described in Section V-C in a sensor installation task carried out by the left arm of the aerial manipulator in pendulum configuration. A sequence of pictures from the experiment are depicted in Fig. 26. The goal is to attach the plastic case of the sensor at the base of a PVC pipe using a piece of double-side adhesive tape. For this purpose, the left arm will exert a 2 N pushing force during 5 seconds to ensure that the case is attached to the pipe. As described in Section II-B, the left arm integrates magnetic encoders to measure the joint deflection and thus the torque and force exerted by the arm. The end effector consists of an aluminum support frame that holds the sensor and facilitates the installation operation. Note that the application of a pushing force in the forward direction will cause a recoil motion in the passive joint [22], reaching the equilibrium of forces when the force generated by the arm compensates the torque due to the gravity in the passive joint. Therefore, if the aerial platform remains in the same position, the arm should be stretched to maintain the pushing force, which will affect the Cartesian stiffness, as stated in Equation (18). In any case, the experimental results evidence that the performance of the manipulation operation is not significantly affected by the passive joint since the recoil angle is relatively small and it can be compensated with the position control of the multirotor. The flight tests also reveal that the oscillations in the pendulum, generated during the take-off or caused by translational accelerations, is attenuated rapidly (in less than 2 sec) as the mechanical energy of the pendulum is transformed into kinetic energy in the aerial platform, whose mass is much higher. The airflow generated by the propellers also contributes to increasing the damping of the system, attenuating the oscillation.  The take-off and landing maneuvers were conducted by a human pilot in attitude control mode. The landing of the multirotor requires a certain coordination with the pendulum joint once the manipulator contacts the floor, since the long reach link constraints its trajectory to an arc. The pilot moves backwards the multirotor while reduces the height in such a way that the arms finally lay over their back. As done in [22], two C-shaped aluminum frames attached to the back of the shoulder structure avoid that the arms are damaged during the take-off and landing operations (see Fig. 26 -down). The multirotor is controlled in position using the Vicon system in the other phases. The manipulator is commanded by a human operator using the visual feedback provided by an onboard camera and the 3DConnexion Space Navigator mouse used to generate the position and force references for the arms.

3) EXPERIMENT EXECUTION -FIRST TEST
The execution of the experiment can be followed in Fig. 27,  Fig. 28, and Fig. 29, which represent the multirotor position, the force and joint variables, and a sequence of images from the on-board camera. The shaded area in Fig. 27 corresponds to the interval of application of the contact force, showing on the right side the displacement of the multirotor with respect to its position at t = 110 s, when the contact force control task starts.   It is interesting to compare the pose of the left arm during the application of the contact force in Fig. 29 w.r.t. Fig. 26, corresponding to the second test described below. It will be seen that, since the arm is closer to the kinematic singularity, the arm will not be able to follow the force reference.

4) EXPERIMENT EXECUTION -SECOND TEST
The sensor installation task was repeated to validate the force control method described in Section V-D. However, this time the displacement of hexarotor platform with respect to the contact point forced the left arm to adopt a pose closer to the kinematic singularity, almost completely stretched. This can be appreciated clearly in Fig. 26 and Fig. 30. According to Equation (18), the Cartesian stiffness matrix depends on the inverse of the Jacobian of the manipulator, in such a way that the apparent stiffness of the compliant arm tends to infinity when the arm tends to reach the kinematic singularity, that is, when the determinant of the Jacobian tends to zero. Thus, it is not possible to reach the desired force reference, since the servos are not capable to deliver enough torque, as Fig. 31-A and Fig. 32-B evidence.

C. COMPARISON BETWEEN STANDARD AND LONG REACH CONFIGURATIONS
As stated in Section II-C, one of the main benefits of the long reach configuration is that it improves safety during the flight operation since it increases the separation distance between the aerial platform and the obstacles, and thus, the reaction time to prevent a collision. This results of especial interest in outdoor scenarios where unexpected and undesired events like wind gusts or GPS signal loss may require the immediate intervention of the safety pilot. Fig. 32 shows the separation distance between the pipe and the propeller / landing gear in both configurations during the sensor installation operations. Note that in the long reach case, the sensor is installed at the bottom of the pipe, what cannot be accessed if the arms are installed at the base of the multirotor. The performance of the contact force controllers in both configurations can be analyzed comparing the results shown in [26] and [34] with respect to [22]. Fig. 33 represents the reaction wrenches induced over the aerial platform when an external force is applied at the end effector of the arm. In case the manipulator is rigidly attached to the multirotor base, a force in the forward direction will cause a torque in the pitch angle that the autopilot will compensate regulating the thrust of the corresponding propellers. Note that the position of the aerial platform has to be under control so the manipulator can maintain the contact during the physical interaction on flight. The magnitude of the torque exerted in the pitch angle can be estimated from the measurement of the deflection in the shoulder joint (see the Wrench Estimator block in Fig. 15). When the passive joint is introduced between the multirotor base and the manipulator, no torque is exerted in the pitch angle, but the multirotor is affected by the force propagated in the direction of the long reach link, as Fig. 33 represents. The amplitude of the recoil rotation in this joint is determined by the equilibrium of the forces acting over the manipulator: the external force exerted at the end effector, and the gravity applied over the center of mass of the pendulum [22]. Note that even in the absence of external forces, the variation of the center of mass due to the motion of the arms will induce a recoil rotation in the passive joint, so the position of the end effector relative to the multirotor frame will also change. The magnitude of the force in the forward direction (X-axis) can be estimated measuring the rotation angle of the passive joint and knowing the mass distribution of the pendulum [22].

VII. CONCLUSION
This paper proposed the application of a compliant bimanual aerial manipulator in two pipe inspection tasks involving the grasping and installation of inspection tools or sensor devices, considering two configurations for the manipulator: standard (arms attached at the multirotor base) and long reach in passive pendulum. The paper analyzed and compared the benefits and drawbacks of both configurations, proposed a unified model and control framework, and detailed the software architecture of the arms and the aerial platform. The experiments, carried out in an indoor testbed, demonstrated the performance of the developed prototype in an illustrative scenario. In particular, it was interesting to observe the degradation of the contact force controller as the arm approaches to the kinematic singularity, and the feasibility to conduct some tasks like the installation of the inspection tool in a teleoperated way using the visual feedback provided by an on-board camera.
As stated in the introduction, the positioning accuracy of the aerial platform is probably the most critical requirement for the successful application of an aerial manipulation robot in outdoors, considering the effective reach of the manipulator and the presence of wind disturbances. In terms of safety, the long reach configuration results especially convenient since it reduces significantly the risk of impact of the propellers with close obstacles during the manipulation operation and because the passive joint and the flexibility of the links contribute to protect the aerial platform against impacts and collisions.
As future work, it is expected that this kind of aerial robots will be capable to operate in complex industrial environments, performing inspection and maintenance tasks with a higher level of autonomy, reducing the human intervention and, with it, the associated time and cost. This requires the integration of the system in the surrounding infrastructure, which involves the regulation and management of resources as the flight space of the communication networks.

ACKNOWLEDGMENT
The experiments described in the paper have been conducted in the CATEC indoor testbed.