{'fraction_non_alphanumeric': 0.031129977764301597, 'fraction_numerical': 0.009096422073984234, 'mean_word_length': 4.639006041262966, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Behavioral control of unmanned aerial vehicle manipulator systems

In this paper a behavioral control framework is developed to control an unmanned aerial vehicle-manipulator (UAVM) system, composed by a multirotor aerial vehicle equipped with a robotic arm. The goal is to ensure vehicle-arm coordination and manage complex multi-task missions, where different behaviors must be encompassed in a clear and meaningful way. In detail, a control scheme, based on the null space-based behavioral paradigm, is proposed to handle the coordination between the arm and vehicle motion. To this aim, a set of basic functionalities (elementary behaviors) are designed and combined in a given priority order, in order to attain more complex tasks (compound behaviors). A supervisor is in charge of switching between the compound behaviors according to the mission needs and the sensory feedback. The method is validated on a real testbed, consisting of a multirotor aircraft with an attached 6 Degree of Freedoms manipulator, developed within the EU-funded project ARCAS (Aerial Robotics Cooperative Assembly System). At the the best of authors’ knowledge, this is the first time that an UAVM system is experimentally tested in the execution of complex multi-task missions. The results show that, by properly designing a set of compound behaviors and a supervisor, vehicle-arm coordination in complex missions can be effectively managed.


Introduction
Research interest in aerial robotic systems has grown dramatically in recent years hand in hand with the number of applications involving unmanned aerial vehicles (UAVs), such as surveillance and remote monitoring (Doitsidis et al. 2012), cooperative transportation (Maza et al. 2010), rescue missions (Maza and Ollero 2011) and monitoring of hostile environments (Merino et al. 2012).
A novel application field for UAVs is aerial manipulation. Therefore, several mechanical structures have been considered: in Pounds et al. (2011) a highly compliant gripper, composed by four fingers, is proposed, while several light-weight low-complexity grippers are tested in Mellinger et al. (2011). Very recently, in order to extend manipulation capabilities, unmanned aerial vehicle-manipulator (UAVM) systems have been introduced, namely research platforms combining a multi-DOFs manipulator with a vertical take off and landing UAV. The presence of the manipulator often leads to a kinematically redundant system able to be adapted and reconfigured according to task requirements; however, the manipulator's motion generates reaction forces on the UAV that can have destabilizing effects . The interaction between the arm and the vehicle have been tackled in Huber et al. (2013) and Kondak et al. (2014), where the dynamic coupling of an helicopter with a 7-DOFs robotic manipulator is analyzed, while in Antonelli and Cataldi (2014) an adaptive scheme aimed at compensating the manipulator's mass and the interaction caused by its movements is proposed. In Fumagalli et al. (2014), authors present the design, modeling and control of an aerial manipulator consisting of a quadrotor helicopter endowed with a robotic manipulator based on a 3-DOFs delta structure and a 3-DOFs end-effector based on a Cardan gimbal. In Kim et al. (2013) the dynamic equation of a quadrotor equipped with a 2-DOFs manipulator is derived, and used in an adaptive controller, whose effectiveness is experimentally validated. In Orsag et al. (2013a) a Lyapunov-based model reference adaptive control is proposed, while in Orsag et al. (2013b) the control of a light-weight prototype 3-arm manipulator, each with 2 DOFs is considered. In Lippiello and Ruggiero (2012a) the dynamic model of the whole UAVM system is devised and a Cartesian impedance control is developed, in such a way to face the contact forces and external disturbances. Through a hierarchical control architecture, the motion control of the end-effector of an UAVM has been tackled in Arleo et al. (2013), that has been extended in Caccavale et al. (2014) via an adaptive term for compensating the model uncertainties. In Lippiello and Ruggiero (2012b), the intrinsic redundancy given by the robotic arm mounted on the UAV is exploited by resorting to a prioritized task-sequencing algorithm.
To achieve complex tasks, an accurate coordination of the vehicle and arm motion must be achieved. Moreover, the UAVM system usually needs to perform several motion tasks simultaneously. To this aim, a behaviorbased approach (Arkin 1998) can be appealing, since it allows to navigate autonomously in complex and unknown environments by using sensors to obtain information of the environment without the need of an accurate off-line planning. To exploit the redundancy of the robotic systems, the null space based behavioral (NSB) approach (Antonelli et al. 2008), based on the inverse kinematics technique, has been widely applied for grounded mobile robots (Antonelli et al. 2010), and recently extended for aerial manipulation systems in Baizid et al. (2014), Antonelli et al. (2014a, b). More in detail, in Baizid et al. (2014) two NSB approaches for obstacle avoidance of multi-UAVMs systems involved in transportation tasks are proposed. In Antonelli et al. (2014a, b), a Control software Architecture for cooperative multi-UAVM (CAVIS) is developed.
The use of multi-priority control, both at kinematic or dynamic level, is not new. A good state of the art may be found, e.g., in Chiaverini et al. (2008). By limiting our attention to floating-base manipulation, it is worth mentioning the underwater case study, where recently some experimental results have been obtained in a grasping operation (Simetti et al. 2013) with a system characterized by 13 degrees of freedom taking into account several prioritized tasks run by means of proper activating functions. In a sense, the humanoid case is also a floating-base manipulation task with a limited mobility of the torso when the robot is not walking. Within this framework, multipriority control has been addressed, among the others, by Escande et al. (2014) within a nonlinear programming theory and Ott et al. (2015) by resorting to model-based operational space techniques. It is worth noticing that both Escande et al. (2014) and Simetti et al. (2013) also address the important aspect of inequality constraints, i.e., control variables that need to be kept in a range of values instead of an exact one.
This work is part of the EU-funded ARCAS (Aerial Robotics Cooperative Assembly System) project (ARCAS 2011), aimed at developing one of the first cooperative free-flying robot systems for assembly and structure construction. A first important step toward this goal is to ensure proper vehiclemanipulator coordination when the system is involved in complex missions. A major contribution of this paper is to tackle the vehicle-manipulator coordination problem for an underactuated quadrotor helicopter equipped with a manipulator via a behavioral control framework. Although the behavioral control approach has been already applied to other floating (or mobile) base robotic systems, aerial manipulators are novel robotic platforms, still not well investigated, which involve very different challenging issues with respect to other robotic systems, such as, e.g., underactuation. Moreover, the proposed control approach is experimentally validated on a prototype platform. At the authors' best knowledge, this is the first time in which the use of aerial manipulators for the execution of non-trivial missions is demonstrated in practice. The control algorithm includes two layers. In the upper level a kinematic inversion algorithm is aimed at computing the reference values for the actuated motion variables of the UAVM system (i.e., the position and yaw angle for the vehicle and the joint positions for the manipulator). At this layer, in order to achieve multiple goals, the redundancy of the UAVM system is exploited by resorting to the taskpriority Null Space Behavioral approach. To the purpose, a set of complex tasks, called compound behaviors, are determined a priori by the user, on the basis of the mission needs. Each compound behavior is composed by a set of elementary behaviors, arranged in a given priority order. Then, during the mission, a Supervisor is in charge of selecting the appropriate compound behavior to be activated, according to sensory feedback on the UAVM and environment state. The second layer is a motion controller aimed at tracking the reference output of the upper layer. For validation purposes, a prototype, developed within the ARCAS project, available at the CATEC (Centro Avanzado de Tecnologias Aeroespaciales) research center in Seville, has been used. It is composed of an eight rotor aircraft in coaxial configuration equipped with a 6-DOFs manipulator.
A preliminary version of this paper has been presented in Baizid et al. (2015). Here, we include further details regarding the motion controller and an accurate description of the supervisor, not addressed in Baizid et al. (2015). In detail, the finite state supervisors for the two case studies are introduced and consistency and completeness analyses are performed. Preliminary experiments regarding the extension of the proposed scheme to multi-UAVMs systems are reported in Muscio et al. (2016).
The paper is organized as follows; in Sect. 2 there is an overview on kinematic modeling of the UAVM system; in Sect. 3 the proposed behavioral control approach is detailed, including the description of elementary and compound behaviors and the supervisor; in Sect. 4 the motion controller acting on the ARCAS prototype is presented; in Sect. 5 the experimental setup is described and the experimental results are reported and discussed; finally in Sect. 6 some conclusions are given underlying the open issues for future work.

Kinematic model of UAVM
Consider a system composed by a quadrotor vehicle equipped with a n M -DOFs robotic arm; let F V be the coordinate frame attached to the center of mass of the vehicle's body and F E be the coordinate frame attached to the manipulator's endeffector (Fig. 1). The position and orientation of F V with respect to a common inertial reference frame, are given the T is the triple of ZY X yaw-pitch-roll angles. The position ( p E ) and the orientation (R E ) of the frame F E with respect to the inertial frame can be written as: where p V E,V and R V E denote, respectively, the relative position and orientation of F E with respect to F V , expressed in where S(·) is the (3 × 3) skew-symmetric matrix operator performing the cross product (Siciliano et al. 2009) and Let q be the (n M × 1) vector of manipulator joint positions, p V E,V (q) and R V E (q) represent the direct kinematics equations of the manipulator with respect to frame F V . Thus, the (6× 1) end-effector's generalized velocity relative to can be expressed in terms of the joint velocitiesq via the manipulator Jacobian, Based on (2) and (3), the generalized end-effector velocity, v E = ṗ E T ω E T T , can be written as where while I 3 and O 3 represent the (3×3) identity and null matrices, respectively. By expressing the attitude of the vehicle and the endeffector in terms of yaw-pitch-roll angles, φ V and φ E , the differential kinematics (4) can be rearranged in terms of the operational-space vectors, where the relationship between the generalized velocities and the operational-space vectors,

have been exploited and
while T (φ * ) is the transformation matrix between the angular velocity ω * and the time derivative of the Euler anglesφ * , namely ω * = T (φ * )φ * (Siciliano et al. 2009). Equation (5) can be expressed in compact form aṡ where and ζ is the vector of the motion variables given by In case of a quadrotor-arm system, the vehicle is an underactuated system, since only 4 independent control inputs are available against the 6 degrees of freedom. Usually, for the quadrotor helicopters, the position, p V , and the yaw angle, ψ V , are the controlled variables, while pitch, θ V , and roll, ϕ V , angles are used as intermediate control inputs for position control (Kendoul et al. 2008). Therefore, it is worth defining the controlled, ζ c , and uncontrolled, ζ u , motion variables as Thus, the differential kinematics (6) can be rearranged aṡ where J c and J u are the controlled and uncontrolled Jacobian matrices, obtained from J by selecting the columns referred to the controlled and uncontrolled variables, respectively.

Behavioral control for vehicle manipulator system
The proposed control scheme is a two-layer kinematic behavioral control (Fig. 2) aimed at coordinating the motion of the vehicle and the manipulator. The upper layer is in charge of computing the reference trajectories for the manipulator joints as well as for the controlled variables of the vehicle (i.e., position and yaw angle). At this layer, since the vehicle manipulator system is kinematically redundant, the redundancy can be exploited to fulfill multiple tasks by adopting a task-priority algorithm, based on the NSB control approach (Antonelli et al. , 2010. The second layer is a motion controller (detailed in Sect. 4) that is aimed at ensuring the tracking of the reference values computed by the upper layer. The first layer can be seen as a three-level scheme (Fig. 3), including: -Elementary behaviors, which are the atomic task functions to be controlled at the kinematic level; -Compound behaviors, which are combinations of elementary behaviors, arranged in a priority order; -Supervisor, which is in charge of switching between the defined compound behaviors on the basis of the UAVM and the environment state.

Elementary behaviors
An elementary task, or elementary behavior, of the system is encoded by a task variable σ ∈ R m , which is function of the system's configuration, ζ , i.e., The configuration-dependent task Jacobian matrix J σ ∈ R m×(6+n M ) is defined via the differential relationship where J σ,c and J σ,u are the task Jacobians referred to the controlled and uncontrolled motion variables, respectively. The kinematic control problem for the UAVM system can be formulated as to find reference values for the controlled variables, ζ c,r , to be fed to a motion controller in order to ensure that the task variable reaches its desired value, σ d . The velocity reference,ζ c,r , can be computed via a closed-loop algorithm (Siciliano et al. 2009) aṡ where Because of the pseudoinverse, inverse solution (12) generates the instantaneous minimum norm joint velocities (Siciliano 1990). Since many motion controllers require the position references for the controlled variables, (12) can be integrated in such a way to obtain ζ c,r . The adoption of a closed-loop inversion, thanks to the presence of the feedback term, allows to avoid drift phenomena of the solution, which can arise due to the numerical integration.
In the following, a set of possible elementary behaviors is provided with a brief description of the corresponding task functions. It is worth noticing that the following elementary behaviors are those used for the experiments (see Sect. 5) and additional behaviors can be designed according to the planned mission. A more complete list of elementary behaviors can be found in Antonelli et al. (2014a).

End-effector configuration (EEC)
This elementary behavior is aimed at controlling the endeffector position and orientation simultaneously. This can be achieved by defining the task function The corresponding task Jacobian is the matrix J defined in (7) (namely J EEC = J ∈ R 6×6+n M ).

Vehicle position (VP)
This elementary behavior allows to control the vehicle motion along a planned trajectory. It is described by the task function σ V P = p V ∈ R 3 and by the corresponding Jacobian J V P = I 3 O 3×3+n M ∈ R 3×6+n M , where the notation O α×β represents the (α × β) null matrix.

Vehicle obstacle avoidance (VOA)
If an obstacle is present along the planned trajectory of the vehicle, it should be able to fly around it without collision. Let p obs ∈ R 3 denote the obstacle position, the task function is defined as with the corresponding Jacobian The desired value for σ V O A is the square of a suitable defined safety distance. Clearly, if the obstacle is far from the planned trajectory, this task has a negative effect, since it attracts the vehicle to the sphere at a given distance from the obstacle. Thus, activation of the behavior must be properly handled.

End-effector obstacle avoidance (EEOA)
Such elementary behavior is analogous to the VOA, but it takes into account the case in which the obstacle is present along the planned trajectory of the end-effector. The task function is defined as with the corresponding Jacobian As in the VOA behavior, the desired value for σ EEOA is the square of a suitable defined safety distance.

Robot nominal configuration (RNC)
Often, a given dexterity of the manipulator can be achieved by controlling its position in the joint space. Therefore, it is required to move to an assigned position m joints (with m ≤ n M ) of the arm. This behavior can be described by the task function where is a (m × n M ) selection matrix that selects m elements from a vector. The task Jacobian is

Mechanical joint limits (MJL)
The manipulator exhibits mechanical limits for the joint mobility, namely each joint is allowed to move in a range. This task avoids the violation of such limits. The system is considered safe if q i ∈ [q i , q i ] (∀i = 1, 2, . . . , n M ), where q i and q i are suitably chosen values (software limits) far enough from the lower and upper mechanical limit of the ith joint, respectively. Different task functions have been proposed in literature, in this paper the following choice has been considered (Mansard and Chaumette 2009) It is worth noticing that such a task function is zero when all the joints are in their acceptable interval, while grows up when joints are out of the acceptable interval and move towards their mechanical limits. A careful choice of the limits q i and q i is needed since if they are too close to the mechanical limits the task function might be insufficient since, due to the dynamics of the system, joints cannot stop immediately.
In the experiments the software limits have been set heuristically, a more accurate choice would require to consider the joint velocity and acceleration as well as limits on joint velocity and acceleration (Guarino Lo Bianco and Zanasi 2003).

Redundancy resolution via NSB-based approach
The UAVM system is characterized by 4+n M DOFs, namely 4 DOFs for the quadrotor vehicle (position and yaw angle) and n M DOFs for the arm. Thus, if 4 + n M is larger than the number of DOFs required by the main task function, the system is kinematically redundant and the redundant DOFs can be exploited to fulfill multiple behaviors via a task-priority algorithm based on the NSB control (Antonelli et al. , 2010. The overall reference velocity for the controlled variables can be obtained by merging the velocity due to each elementary behavior (computed via 12), in such a way that the lower-priority behavior contributions are projected onto the null space of the higher-priority ones. In this way, the velocity components that conflict with the higher priority behaviors are removed, and, thus, the secondary behaviors can be achieved only if they are compatible with those at higher priority. The compatibility issues of elementary behaviors can be analysed on the basis of the concepts of task Jacobian orthogonality and independence (Antonelli 2009).
By assigning n b behaviors with a given priority, the overall system velocity is given by the following recursive scheme: where the subscript k = 1, . . . , n b represents the behavior priority, N 1,k is a projector onto the null space of the augmented Jacobian J 1,k , given by In order to meet the requirements of complex mission scenarios, elementary behaviors can be combined into complex tasks, named compound behaviors. A compound behavior is a hierarchical combination of a set of elementary behaviors arranged in a given priority order. Such compound behaviors, and thus the elementary behaviors' priority, are determined a priori by the user, on the basis of the mission's need and of practical considerations (e.g., safety behaviors, as obstacles avoidance, have often higher priority).

Supervisor
The adoption of the NSB paradigm implies that real-time switching between compound behaviors must be ensured by a supervisor, explicitly designed for a given mission. The supervisor (implemented, e.g., via a Finite State Automata) is in charge of dynamically selecting the compound behavior to be activated, according to the state of the robot and of the external environment. For example, a compound behavior including the obstacle avoidance must be activated when the distance between the obstacle and the vehicle is below a certain safety value. Many approaches might be pursued for the supervisor design; in this paper an Automata has been considered (Alur and Yannakakis 2001). The adoption of a Finite State Automata implies that only a limited number of compound behaviors, mutually exclusive, can be assigned to the system. Moreover, to build the Automata, the finite set of all allowed compound behaviors (set of states of the Automata), as well as the set of causes forcing the UAVM to change its state (namely, the switching rules between the different behaviors), must be defined. The supervisor and the corresponding Automata, must be designed on the basis of the mission to be accomplished and strictly depend on the implemented compound behaviors. Examples of supervisors are described in detail in Sect. 5 and their main properties, such as completeness and consistency, are analysed (Ouimet and Lundqvist 2007).

Motion control
The behavioral control provides reference values for the vehicle position, for the vehicle yaw angle and for the manipulator joints (the controlled variables ζ c ). Therefore, it is necessary to develop a motion controller in charge of tracking such reference trajectories. It is worth noticing that the behavioral control is, in principle, compatible with any motion controller, since it only provides motion references. In this section, the controller implemented on the adopted UAVM system, developed within the ARCAS project and available at the CATEC, is presented.
A special control architecture has been developed to effectively control an aerial platform equipped with a 6-DOFs arm that weights significantly, compared to the total system's mass (see Sect. 5.1 for details). The ARCAS control layer architecture is composed by 4 main modules (Fig. 4): one is specifically designed for the robotic arm, while the others are standard modules for control of multirotor vehicles, that have been heavily modified to adapt them to the ARCAS system. It can be viewed as a multilayer control system: the basic layer is a classic PID controller, then the second layer is a mechanism aimed at moving a counterweight on a linear slider to compensate the arm movements; finally, in order to overcome mechanical limits of the previous mechanism, the residual static momentum due to the effect of the manipulator's gravity on the multirotor is compensated (Ruggiero et al. 2015).
The Estimator and Data Processing Module is in charge of estimating and processing the state of the complete system (position, attitude, angular velocity, servos data, sensors and safety operator radio references). The Position Controller Module takes care of the platform stabilization; its output is the reference for the attitude controller. The controller needs the state of the platform, the position reference given by the higher level controller and a compensation value coming from the attitude controller. The compensation signal [(a Fig. 4 Block scheme of the motion controller (3×1) acceleration vector] is added to the output of the PIDs. This signal is generated in the attitude controller and it helps to stabilize the platform, rejecting the perturbations coming from the arm movement. The Robotic Arm Controller module is the one in charge of the final checks of the references given to the arm, its deployment, retraction and parsing the reference values to servo control signals. In addition, there is an emergency state in which the arm is retracted at a very high velocity. Finally, the Attitude Controller module runs the lowest level controller of the platform and it is the most complex one. It receives references from the position controller and stabilizes the platform, sending a control signals to the 8 motors. The problem of controlling the attitude of a multirotor with an equipped moving arm is addressed next by employing a two layer control system.

Attitude controller
The first layer of the attitude control system is a mechanical compensation. The base of the manipulator is an auxiliary component fixed to the landing gear that supports the arm and also hosts the Center of Gravity (CoG) Displacement Compensation System (DCS). The DCS consists of a counterweight that is moved on a linear slider during the manipulator operation to keep the CoG of the whole system (UAV + manipulator + load + counterweight) as close as possible to the multirotor geometric center. The center is coincident with the CoG of the whole system when the robotic arm is retracted in its compact configuration. The components used as counterweight are all the batteries carried on-board. These batteries are heavy enough to compensate the manipulator CoG displacements with short movements.
The instantaneous CoG position of each link i, referred to the robotic arm fixed axis system F 0 = {O 0 , x 0 , y 0 , z 0 }, is given by (i = 1, . . . , 6) where T i 0 ∈ R 4×4 is the homogeneous transformation matrix of link i obtained from the Denavit-Hartenberg (D-H) parameters table and updated by the servos feedback. Notice that i = 7 corresponds to the payload grasped by the robotic arm.
The robotic arm CoG position vector referred to the multirotor frame F V is given by where m i is the mass of the ith link, m A = 7 i=1 m i is the total mass of the arm, T V 0 ∈ R 4×4 is the homogeneous transformation matrix from arm to vehicle frame and the (3× 4) matrix E 3 selects the first three components of a vector. It is supposed that the CoG of the platform is coincident with its geometric center, thus the position reference for the battery is computed via where 0 3 is the (3 × 1) null vector, p V B is the actual CoG position of the battery with respect to the vehicle frame and m B is the battery mass. The position reference given to the servo is the projection of p V * B above the battery axis. As the battery movement is linear, it can only achieve part of the gravity compensation (see Fig. 5).
This system is really effective for slow motions of the robotic arm as it maintains the CoG of the full system very close to the geometric center. However, it has 2 limitations: the first one is the mechanical limits of the DCS that restrict the movement; the second one is that the mechanical compensation is often not fast enough to avoid dynamic unbalance, because of the servo limitations and software saturations. For that reason, a software compensation modifying the commanded propellers velocities, i.e., the velocities of the brushless motors aimed at rotating the propellers, is needed as they have a much quicker response. Namely, an additive term is added to the input in order to perform static momentum equilibrium around the geometric center of the platform by compensating the effect of the manipulator's gravity on the multirotor (Fig. 6).
By assuming that the aerial platform is in hovering (or near hovering) conditions, any static torque around the yaw axis can be neglected; thus, the additive term, τ xy , can be written as where E 2 ∈ R 3×3 selects the first two components and puts the third to zero. The last part of the controller architecture consists in a roll-pitch-yaw controller, an angular rates controller and a torques/forces saturation. The SC module computes the torques using (20) and they are injected directly after the angular rates controller which outputs are forces and torques. As shown in Ruggiero et al. (2015), the use of compensation (20) together with the DCS has been proven to improve the controller performance.

Experiments
The proposed behavioral control has been applied to the indoor platform of the ARCAS project (ARCAS 2011), whose goal is the development of a cooperative free-flying robot system for assembly and structure construction. In the following, two experimental case studies, involving a certain number of different compound behaviors, are reported. In detail, in the first case study, the vehicle obstacle avoidance is considered, i.e., the vehicle modifies its trajectory in order to avoid an unexpected obstacle not taken into account during the planning, while the arm keeps a given configuration; in the second one the vehicle avoids the obstacle while the manipulator end-effector tracks the planned trajectory thanks to a suitable reconfiguration of the arm. It is worth noticing that, during the experiments the take-off, the landing and the arm extension phases are managed manually for safety reasons; therefore, they are not taken into account in the supervisor design.

The ARCAS indoor platform
The ARCAS indoor platform is an eight rotor aircraft in coaxial configuration with a tip-to-tip wingspan of 105, 33 cm propellers, height of 50 cm and mass of 8.2 kg, including the Lithium Polymer batteries and the robotic arm (see Fig. 1). The ARCAS 6-DOF manipulator (Cano et al. 2013) consists of three components (see Fig. 7): a fixed base, a multi-joint arm and an end effector. The multi-joint arm is an articulated component that contains all the manipulator's DOFs. It Fig. 7 Manipulator components (base, arm, and end-effector) mounted on multirotor landing gear includes a first section with two motorized joints, followed by an elongated structure, and a second section composed by a chain of four motors driving the remaining joints. The fixed base of the manipulator has a mass of about 0.65 Kg, the moving parts of the manipulator have a total mass of about 0.767 Kg, while the vehicle frame with propellers, motors, onboard pc and sensors have a total mass of about 5 Kg. The moving mass of the batteries tray plus the batteries themselves is about 1.723 Kg. The current version of the arm is based on low-cost off-the-shelf motors; the inputs for the servos are the desired position of the joints, while the native local motion control loops are used. Future versions of the arm will be based on more costly and better performing actuators.
From the software architecture point of view, the ARCAS indoor platform counts two processing units: an autopilot and on-board computer. Both units are integrated into a common framework that has the following levels ( Fig. 8): -Control level: this level includes the integration of the control algorithms for the aerial platform and the robotic arm. Also, the standard estimation algorithms for the aerial robotic platform navigation are implemented at this level. The level uses a model-based development framework based on Matlab/ Simulink and implemented over the autopilot, using the real-time operating system QNX. -Functional level: this level includes the integration of the perception and cooperation algorithms that will run onboard of the aerial robot. A Linux processing unit with ROS (Quigley et al. 2009) is used as the framework for the integration of the different functionalities. -Multi-vehicle level: this level includes the integration of the software modules that require the information from multiple vehicles. The standard DDS middleware is used to interconnect the different software modules that will be integrated at this level.
With regards to the control level, the autopilot in use allows full control of all the hardware and software in order to inte-  grate the robotic arm and the control algorithms developed in this paper. To test the control algorithms, the ARCAS project is using a Model-Based Design (MBD) methodology (Santamaria et al. 2012), based on Simulink © , relying on code generation tools. This methodology allows not only to easily integrate the code generated from Simulink into the target autopilot, but also, to access to all the internal variables and change parameters while the platform is flying. Also, the same software (Simulink) can be used in the design and simulation phase, as well as in software-in-the-loop testing and in real flying experiments.
For costly computing code, such as image processing or coordinated control, the system is equipped with an i7 Asctec Mastermind on board that runs ROS. This unit implements what it has been called the functional level (Fig. 9). This functional level has a well-defined API with the control level, formed by two software modules: the UAV Abstraction layer and the Robotic Arm specific layer. These two layers allowed to develop a simulation system based on Gazebo simulator with exactly the same interfaces what the aerial robot actually has. Finally, the experiments have been performed in the CATEC indoor testbed (Fig. 10) that has a useful volume, i.e., the area in which the UAVM is allowed to move, of 15×15× 5 m, where this entire software infrastructure is deployed. The Vicon system (http://www.vicon.com) is used as the positioning system, which is extensively used for indoor environments. Vicon runs at 100Hz and it only provides the position of the multirotor, while the attitude is obtained with an estimator using the IMU and magnetometer data.

First case study
In this experiment, the arm and the vehicle are controlled separately. At the beginning, the vehicle takes off and, then, extends the arm: these tasks are manually managed for safety reason, thus they are not taken into account in the following description. The goal is to set the arm joints to a suitable configuration and move the vehicle according to a planned trajectory. In normal operating conditions, the compound behavior composed by the tasks VP and RNC is assigned to the system. The matrix in σ RNC (see 13) has been set as = I 6 , namely all the joints are controlled. The reference velocities for the controlled variables,ζ c,r , are computed according tȯ where p V,d (q d ) is the desired vehicle (joint) position, K VP and K RNC are positive definite matrix gains, whose values are reported in Table 1, and the null-space projection matrix has been dropped since the two tasks are fully independent (Antonelli 2009). An obstacle, not taken into account during the path planning phase, intercepts the motion of the vehicle and the supervisor has to manage the switching from the compound behavior VP + RNC to a new compound behavior (VOA+VP +RNC), as shown in Fig. 11a. The switching is commanded when the distance between the obstacle and the vehicle is below a safety value d s (that has been set to 1 m), while, once the vehicle has overcome the obstacle, the supervisor switches back to VP + RNC and the vehicle moves back to the planned trajectory. For the new compound behavior the reference velocities are computed as where k VOA is a scalar gain and N( J VOA ) is a projector onto the null space of the Jacobian J VOA .
Remark 1 In the previous paragraph and in the following, the notation B 1 + B 2 + · · · + B l represents a compound behavior including the elementary behaviors B 1 , B 2 , . . . , B l , in which B 1 has the highest priority and B l the lowest priority.
In the presence of fully independent behaviors, such as, e.g., VP and RNC, the order does not represent the behavior priority since both the behaviors can be fulfilled with the available degrees of freedom without any priority order. Figure 11b shows the Finite State Automata and the switching rules that model the supervisor. In this case the supervisor includes only two states representing the above mentioned compound behaviors. It is worth verifying that the supervisor is consistent (namely only a single transition rule can be enabled at each time instant) and complete (namely it operates correctly for all possible input/state sequences). With regards to the consistency, at each time instant it is required that only one state can be active, and it is trivially verified since the two rules are mutually exclusive. Also the completeness can be easily verified since in the considered scenario the only admissible situations are: -no obstacles are in the safety area (namely in a sphere of radius d s ): the system keeps the state VP + RNC; -an obstacle is in the safety area (namely p V − p obs < d s ), the UAVM is in the state VP + RNC and the vehicle trajectory moves towards the obstacle (namelẏ p T V ( p obs − p V ) ≥ 0): the supervisor switches to VOA + VP + RNC; -the obstacle is in the safety area and the UAVM is in the state VOA + VP + RNC; -the obstacle is on the border of the safety area (namely p V − p obs ≥ d s ), the UAVM is in the state VOA + VP + RNC, and the vehicle trajectory moves away from the obstacle (namelyṗ T V ( p obs − p V ) < 0): the system switches to VP + RNC. Figures 12, 13 and 14 show the experimental results, obtained by setting the gain matrices as in Table 1. In Fig. 12 the 3-D trajectory of the vehicle with the presence of the obstacle is reported, while Fig. 13 shows the vehicle position error and the comparison between the reference vehicle trajectory, computed by the inverse kinematics, and the actual one. It is worth noticing that the position error presents its maximum (about 6 cm) when the vehicle modifies its trajectory in order to avoid the obstacle. Finally, Fig. 14 shows the distance between the vehicle center of mass and the obstacle in the presence of the obstacle avoidance behavior (green line). The red line represents the distance from the obstacle which would have been obtained if the vehicle had tracked the reference trajectory generated by the kinematic inversion (21), in the absence of the VOA elementary behavior. For safety reasons, such data have been obtained via numerical simulation. It can be noticed that, when the compound behavior VOA + VP + RNC is active, the distance is always close to the safety value, while the reference trajectory, in the absence of behavior VOA, is very close to the obstacle.

Second case study
In the second case study, the main objective is to track a given trajectory for the end-effector of the UAVM in terms of position and orientation, and, at same time, avoid collisions with an obstacle, not considered during the off-line planning, that is present along the vehicle path but not along the end-effector path. Thus, in order to avoid the obstacle and, at same time, track the end-effector trajectory, the arm must reconfigure Fig. 15 Some snapshots of the second case study with zooms on the arm configuration itself during the vehicle obstacle avoidance phase (Fig. 15).
To this aim, the elementary behaviors EEC, VOA, VP, RNC and MJL, already defined in Sect. 3.1, are activated during the experiment and combined into the compound behaviors shown in Fig. 16a. At the beginning, after the take off and the arm extension (manually managed), the UAVM reconfigures the arm from the initial configuration in Fig. 15a to the configuration in Fig. 15b, while keeping the vehicle position constant. Namely, the initial compound behavior includes the tasks VP and RNC. The matrix in σ RNC has been set as  (21). Once the arm reached its final configuration, q f in , with a certain accuracy, , the supervisor switches to a new compound behavior that is in charge of tracking the end-effector desired trajectory. Such compound behavior is composed by the elementary behaviors EEC and MJL. Namely, the main task is the tracking of the end-effector position and orientation, while the secondary task is aimed at avoiding the joint limits violation during the motion. As concerns the MJL behaviors, the limits q and q has been respectively set 5 deg less the upper mechanical limit and 5 deg over the lower mechanical limit. The reference velocity for the controlled variables iṡ where K EEC and k MJL are positive definite matrix and scalar gain, respectively, x E,d is the desired end-effector pose, and the desired value for the task function σ MJL has been set to  Table 1. During this phase, the motion of the vehicle interferes with an obstacle, while the planned trajectory of the endeffector is safe. When the distance between the vehicle and the obstacle is below a safety value, d s (set to 1.4 m), the compound behavior EEC + VOA + MJL is activated. Namely the vehicle modifies its trajectory in order to avoid the obstacle, while the end-effector keeps on the planned trajectory. The joint limit task, at lowest priority, is included to avoid dangerous situation during the arm reconfiguration. The reference velocity of this compound behavior iṡ where J aug = J T c J T VOA T is the augmented Jacobian. Figure 15 shows some snapshots of the experiments. In detail, Fig. 15a shows the initial configuration of the arm and the vehicle, in Fig. 15b the configuration that the arm reached at the end of the first phase is reported, Fig. 15c shows the vehicle at the beginning of the obstacle avoidance and, finally, in Fig. 15d the final configuration, after overcoming the obstacle, is reported. It can be noticed that the arm configurations in Figs. 15b and 15c are very similar, while in Fig. 15d the arm has strongly modified its configuration in order to compensate the motion of the vehicle. Figure 16a shows the sequence of compound behaviors activated during the whole mission, while Fig. 16b reports the Finite State Automata and the switching rules that model the supervisor. Based on the above described desired behavior of the UAVM (i.e., the mission), the set of compound behaviors to be implemented on board are VP+RNC, EEC+MJL and EEC+VOA+MJL. Even if not activated during the mission, two another compound behaviors must be defined for safety reason in case an obstacle is present in the safety area of the sole end-effector or of both the vehicle and the end-effector and the UAVM is moving toward the obstacle. In these cases, the obstacle avoidance must have higher priority than the end effector trajectory, since it is not possible to keep the desired trajectory of the end-effector without collisions with the obstacle; thus the compound behaviors EEOA + EEC + MJL and VOA + EEC + MJL must be implemented.
The supervisor can be arranged in a two-level hierarchical way (Alur and Yannakakis 2001). At the top layer there are two scenarios: the first one corresponding to the situations in which no obstacles are in the safety area of the vehicle base, while in the second scenario an obstacle is close to the vehicle. At the lowest level there are the states corresponding to the compound behaviors. Let us verify that the supervisor is consistent and complete. With regards to the consistency, at each time instant it is required that only one scenario can be active, then for each scenario only one state can be active.

Consistency of the scenario layer
The transition between the first and second scenario is commanded when the vehicle base and/or the end-effector are in the neighborhood of an obstacle and the vehicle trajectory moves towards the obstacle. It can be summarized by the following rule: The transition rule for switching between the second and the first scenario is the following namely, the obstacle is on the border of the safety area and the vehicle trajectory moves away from the obstacle. Since the two conditions are mutually exclusive it is trivially proven that only one scenario can be active at each time instant.

Consistency of the state layer
In the first scenario, two different states are present; the supervisor switches between the initial state (VP+RNC) and the state EEC+MJL when the desired final vehicle position and joint positions are reached with a certain accuracy, i.e., where q and V denote, respectively, the desired accuracy for the arm joint position and for the vehicle position. Once the state EEC+MJL is activated, it remains active until the vehicle is commanded to land. The landing phase is managed manually and thus is not considered in the supervisor. The experiment is designed in such a way that the system will never try to return to its initial state, hence initial state conflicts will never arise.
In the second scenario, three states are present and the following transition rules are defined Again the three rules are mutually exclusive, thus only one state can be active at each time instant.
Regarding the completeness, the admissible situations are -the vehicle and/or the arm are not in the desired configuration for starting the end-effector trajectory: the system keeps the initial state VP + RNC; -the vehicle and the arm reach the desired configuration with the desired accuracy: the system switches to the state EEC + MJL; -no obstacles are in the safety area (namely in a sphere of radius d s ) both for the vehicle and the end-effector: the system keeps the state EEC + MJL; -an obstacle is present in the safety area of the vehicle but not in the safety area of the end-effector and the vehicle is moving toward the obstacle: the supervisor switches to EEC + VOA + MJL; -an obstacle is in the safety area both of the vehicle and the end-effector, and the vehicle is moving toward the obstacle: the supervisor switches to the state VOA + EEC + MJL; -an obstacle is present in the safety area of the sole endeffector and the UAVM is moving toward the obstacle: the supervisor switches to the state EEOA + EEC + MJL; -the obstacle is on the border of the safety area and the vehicle trajectory moves away from the obstacle: the obstacle avoidance is deactivated and the system switches to EEC + MJL.
Since any sequence of the previous situations is admissible, the completeness of the automata is proven. In Fig. 17 the joint positions during the whole experiment are reported. It can be noticed that the joints 2, 3 and 5, modify their positions when the RNC task is active, while, during the second phase, all the joints keep a configuration almost constant. Thus, most of the motion is performed by the vehicle. Finally, during the obstacle avoidance, all the joints modify their positions in order to reconfigure the arm. Moreover, it can be noticed that a maximum error of about 4 deg is obtained during the motion. Figure 18 shows the end-effector position and orientation errors. It can be noticed that the maximum error occurs during the obstacle avoidance, when the vehicle modifies its trajectory and the arm tries to compensate this motion. Figure 19 shows the distance between the vehicle center of mass and  the obstacle (green line): despite the VOA behavior has not the highest priority, such distance is always close to the safety value. The red line in Fig. 19 represents the distance from the obstacle which would have been obtained in the presence of the compound behavior EEC + MJL, i.e., in the absence of the VOA elementary behavior. Such data have been obtained, for safety reasons, via numerical simulation. Finally, Fig. 20, shows the paths of the vehicle and the end-effector; it can be noticed that, despite the vehicle motion in the neighborhood of the obstacle, the end-effector tracks the desired linear path. Some videos of the experiments are available at http:// www2.unibas.it/automatica/multimedia.html

Discussion and future work
In this paper the NSB framework has been adopted to control a multirotor aerial vehicle equipped with a robotic arm, in order to ensure the vehicle-arm coordination and manage complex multi-task missions, where different behaviors must be encompassed in a clear and meaningful way. The method has been validated in a real testbed. The results show that, by properly designing a set of compound behaviors and a supervisor, vehicle-arm coordination in complex missions can be effectively managed. At the the best of authors' knowledge, this is the first time that an UAVM system is experimentally tested in the execution of complex multi-task missions. The overall performance of the system are satisfactory and present an end-effector tracking error of few centimeters, coherent with the available sensing and actuating technology. Such performance is strongly dependent upon the underlying motion control layer; in the current setup, in fact, the manipulator's joint servos are based on off-the-shelf components, characterized by a good performance/cost ratio, but also by a few limitations in terms of accuracy and bandwidth. Future versions of the experimental setup, based on more costly and accurate components, will allow to achieve more accurate tracking. The present research is part of a wider project whose final goal is the demonstration of a cooperative multi-UAVM system, aimed at executing complex coordinated tasks, such as, e.g., cooperative transportation of a payload and coordinated assembly operations. Thus, the research presented in this paper can be viewed as a necessary step towards the design and the deployment of multi-UAVM systems. To this purpose, a twin UAVM is under development, while cooperative coordinated control approaches for multi-UAVM systems are being designed.