A Practical and Effective Layout for a Safe Human-Robot Collaborative Assembly Task

: This work describes a layout to carry out a demonstrative assembly task, during which a collaborative robot performs pick-and-place tasks to supply an operator the parts that he/she has to assemble. In this scenario, the robot and operator share the workspace and a real time collision avoidance algorithm is implemented to modify the planned trajectories of the robot avoiding any collision with the human worker. The movements of the operator are tracked by two Microsoft Kinect v2 sensors to overcome problems related with occlusions and poor perception of a single camera. The data obtained by the two Kinect sensors are combined and then given as input to the collision avoidance algorithm. The experimental results show the effectiveness of the collision avoidance algorithm and the signiﬁcant gain in terms of task times that the highest level of human-robot collaboration can bring.


Introduction
In the last years, collaborative robotics is becoming a more and more relevant topic. Historically, to ensure safety, the workers have been kept physically separated from the robot systems [1]. Nowadays, the basic idea of collaborative robotics is to ensure safe robotic systems to allow the removal of the fences that divide the working area of the robots from that of human operators, so that robots and humans can work together to accomplish a task.
The introduction of a new class of robot designed to work side-by-side with humans, named "cobots", increases the chances for a successful collaboration [2,3]. The existing cobots are mostly anthropomorphic manipulators, which are equipped with passive and active safety features. The passive features are design choices that intrinsically reduce the risk of injury in the case of undesired contact, such as lightweight materials and rounded edges. The most advanced cobots mount also a set of sensors and dedicated software packages to actively handle unexpected contacts by stopping the robot if the joint torques or the contact forces exceed the defined thresholds. However, these features, that come with the cobot out of the box, may not guarantee safe collaborative robotics. In fact, the workspace sharing can introduce new hazards and risks for the workers that must be taken into account when designing the application [4,5].
The design of the collaborative robotics systems is principally related to the task. In fact, according to the International Federation of Robotics (IFR), one may require a different level of interaction depending on the human and robot activities [6]. The most common examples of collaborative robotics provide a shared workspace where the robot and employee work sequentially. This type of application is also identified as sequential collaboration. On the other hand, the most technically challenging application requires a how collaboration can improve the employee health in terms of musculoskeletal disorders, but the case is limited to a sequential task so that the robot stops if a camera detects the human hand in the proximity of the robot tool. Another case study focuses on the introduction of an UR3 robot in a pocket assembly cell, to mitigate the physical fatigue of the worker [24]. However, the operator has the role of a supervisor and a laser scanner triggers a safety stop if the human accesses the robot workspace.
Since safety stops may affect productivity, researchers are moving towards a better integration of the robot, the vision system, and the control strategies for a higher level of collaboration. In the following, some examples of the most recent control strategies are reported that have been applied to pick-and-place, which is relevant for the purpose of this work since it is intended as a subtask of the assembly process. The authors of [25] proposed a method which is based on a depth camera and dynamic safety zones. The strategy in [25] activates stopping trajectories only if the distance between the human and robot bounding volumes exceeds the threshold defined by the standards. An improved sensor fusion algorithm based on a multiple depth camera and real-time collision avoidance by means of an optimization problem are presented in [26]. The results in [26] show that the robot slightly deviates from the nominal path if the predicted occupancy of the operator gets close to the robot planned trajectory. A more precise robot trajectory generation which can deal with the human intrusion within the workspace is shown in [27]. However, in [27] the robot can only follow waypoints across a trapezoidal path.
Other researchers focus on assembly workspace layout or task optimization. The case study of the battery cell assembly proposed in [28], which is conducted comparing a laser scanner with radio wave sensors for motion tracking, shows that the relative position of the human and robot in the working area may affect the runaway motion of the robot. Concerning task optimization, in [29] a method which allows predicting the human activity pattern is implemented for the assembly of an integrated circuit. The results in [29], which are obtained by using a single depth camera for human tracking, prove that pattern prediction leads to better cycle times in sequential collaboration.
This work distinguishes from the state of the art since it describes a practical solution to effectively deal with human-robot responsive collaboration by using multiple vision sensors and a local control strategy to ensure the safety of the human worker. None of the works previously discussed present a hardware/software setup as the one described in this paper, which has been adopted to carry out a responsive collaborative task. Furthermore, the choice of using a UR3 robot, Kinect v2 cameras, and implementing a collision avoidance based on artificial potential fields was made in order to use devices and algorithms well known and robust, giving the readers the possibility to replicate the setup and develop collaborative robotics applications. Moreover, this work focuses on assembly tasks where the operator is designated for the added value activities.
The paper is organized as follows: The description of the task and the experimental layout are presented in Section 2. Section 3 describes the implemented control strategy. The experimental tests and the discussion of the results are reported in Section 4. Finally, Section 5 includes the conclusions and future works.

Design of Collaborative Layout and Application
The case study is an assembly cell which receives three parts to be assembled as input and produces an assembly made of the same parts. The parts consist of cubes of different sizes, while the assembly is obtained by sticking the cubes together, as shown in Figure 1. The entire task can be divided in two main operations: Collecting the components to be assembled and assembling them. Concerning the first operation, the components are supposed to be stored so that a robot can easily pick them up. The second operation is supposed to be too complex or too variable for a full automation solution, so that the human presence is required. For this reason, the operator should be able to take the parts to be assembled from a certain area which must be a portion of the robot workspace, since the robot has the role to provide the parts to the operator. With this aim, the workspace of the robot is divided in two zones, as shown in Figure 2. The parts are stored in the "pick zone", where no human presence is expected. In the "collaborative zone", where the human and robot can potentially come to contact as their workspaces intersect, the operator takes the components to be assembled. assembled from a certain area which must be a portion of the robot workspace, since the robot has the role to provide the parts to the operator. With this aim, the workspace of the robot is divided in two zones, as shown in Figure 2. The parts are stored in the "pick zone", where no human presence is expected. In the "collaborative zone", where the human and robot can potentially come to contact as their workspaces intersect, the operator takes the components to be assembled.  The human worker and robot perform seven operations in parallel to carry out the assembly task, as reported in Figure 3. The task, which is also identified as a cycle, starts when the operator takes the cube positioned in station A. As the human hand enters in the collaborative zone, the robot task begins by replacing the cube in A with a new one from station a. In parallel, the operator puts the glue on the first cube, takes the second cube by station B, and prepares both cubes to be glued. The next step for the robot is taking a cube from station B and placing it in station B, to replace the one taken by the operator. Meanwhile, the human picks up the last cube in station C and assembles the tower of cubes. Finally, the robot replaces the cube in station C and returns in the home position, while the worker checks the edges of the assembly to remove the exceeding glue before delivering. Concerning the human task, the phases in which he takes the components happen in the collaborative zone, while the other phases are carried out on the assembly table, outside of the robot workspace. On the other hand, the "pick" stages of the robot task identify the robot motion in the pick zone, i.e., outside the collaborative zone, while the "place" stages identify the robot motion within the collaborative zone. The execution of these operations involves a responsive collaboration. In fact, as the human and robot carry  assembled from a certain area which must be a portion of the robot workspace, since the robot has the role to provide the parts to the operator. With this aim, the workspace of the robot is divided in two zones, as shown in Figure 2. The parts are stored in the "pick zone", where no human presence is expected. In the "collaborative zone", where the human and robot can potentially come to contact as their workspaces intersect, the operator takes the components to be assembled.  The human worker and robot perform seven operations in parallel to carry out the assembly task, as reported in Figure 3. The task, which is also identified as a cycle, starts when the operator takes the cube positioned in station A. As the human hand enters in the collaborative zone, the robot task begins by replacing the cube in A with a new one from station a. In parallel, the operator puts the glue on the first cube, takes the second cube by station B, and prepares both cubes to be glued. The next step for the robot is taking a cube from station B and placing it in station B, to replace the one taken by the operator. Meanwhile, the human picks up the last cube in station C and assembles the tower of cubes. Finally, the robot replaces the cube in station C and returns in the home position, while the worker checks the edges of the assembly to remove the exceeding glue before delivering. Concerning the human task, the phases in which he takes the components happen in the collaborative zone, while the other phases are carried out on the assembly table, outside of the robot workspace. On the other hand, the "pick" stages of the robot task identify the robot motion in the pick zone, i.e., outside the collaborative zone, while the "place" stages identify the robot motion within the collaborative zone. The execution of these operations involves a responsive collaboration. In fact, as the human and robot carry The human worker and robot perform seven operations in parallel to carry out the assembly task, as reported in Figure 3. The task, which is also identified as a cycle, starts when the operator takes the cube positioned in station A. As the human hand enters in the collaborative zone, the robot task begins by replacing the cube in A with a new one from station a. In parallel, the operator puts the glue on the first cube, takes the second cube by station B, and prepares both cubes to be glued. The next step for the robot is taking a cube from station B and placing it in station B, to replace the one taken by the operator. Meanwhile, the human picks up the last cube in station C and assembles the tower of cubes. Finally, the robot replaces the cube in station C and returns in the home position, while the worker checks the edges of the assembly to remove the exceeding glue before delivering. Concerning the human task, the phases in which he takes the components happen in the collaborative zone, while the other phases are carried out on the assembly table, outside of the robot workspace. On the other hand, the "pick" stages of the robot task identify the robot motion in the pick zone, i.e., outside the collaborative zone, while the "place" stages identify the robot motion within the collaborative zone. The execution of these operations involves a responsive collaboration. In fact, as the human and robot carry out the subtasks in parallel, the operator can access the collaborative zone at any time, even if the robot is placing a component. out the subtasks in parallel, the operator can access the collaborative zone at any time, even if the robot is placing a component. The laboratory setup of the collaborative assembly cell is visible in Figure 4. Three PCs, two Microsoft Kinect v2, a router, and a collaborative robot UR3 from Universal Robots equipped with a Robotiq gripper 2F-85 are used. The three PCs are connected via Ethernet network and communicate using the TCP/IP protocol. The implemented algorithms are written in MATLAB environment. The two Kinect sensors are displaced at 1.5 m from the human, so that their field of view covers the entire workbench from different angles. Each Kinect can feedback depth data up to 30 Hz [30]. Two PCs are connected to the Microsoft Kinect v2 cameras, to obtain the data acquired by each sensor. The third PC is connected to the controller of the UR3 robot. Further information related to the control strategy will be given in the next section.

Robot Control Strategy
The robot tool center point (TCP) motion is planned by combining planar trajectories that trigger and terminate at strategical nodes. When the robot moves above the stations of the components from the pick zone to the collaborative zone, the TCP planned trajectory is planar at z = 0.3 m, where z is measured from the robot mounting table. To grasp or release the cubes, the robot follows a vertical path. The strategical nodes are defined as the intersection points between the plane z = 0.3 m and the vertical paths. For example, in The laboratory setup of the collaborative assembly cell is visible in Figure 4. Three PCs, two Microsoft Kinect v2, a router, and a collaborative robot UR3 from Universal Robots equipped with a Robotiq gripper 2F-85 are used. The three PCs are connected via Ethernet network and communicate using the TCP/IP protocol. The implemented algorithms are written in MATLAB environment. The two Kinect sensors are displaced at 1.5 m from the human, so that their field of view covers the entire workbench from different angles. Each Kinect can feedback depth data up to 30 Hz [30]. Two PCs are connected to the Microsoft Kinect v2 cameras, to obtain the data acquired by each sensor. The third PC is connected to the controller of the UR3 robot. Further information related to the control strategy will be given in the next section.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 5 of 14 out the subtasks in parallel, the operator can access the collaborative zone at any time, even if the robot is placing a component. The laboratory setup of the collaborative assembly cell is visible in Figure 4. Three PCs, two Microsoft Kinect v2, a router, and a collaborative robot UR3 from Universal Robots equipped with a Robotiq gripper 2F-85 are used. The three PCs are connected via Ethernet network and communicate using the TCP/IP protocol. The implemented algorithms are written in MATLAB environment. The two Kinect sensors are displaced at 1.5 m from the human, so that their field of view covers the entire workbench from different angles. Each Kinect can feedback depth data up to 30 Hz [30]. Two PCs are connected to the Microsoft Kinect v2 cameras, to obtain the data acquired by each sensor. The third PC is connected to the controller of the UR3 robot. Further information related to the control strategy will be given in the next section.

Robot Control Strategy
The robot tool center point (TCP) motion is planned by combining planar trajectories that trigger and terminate at strategical nodes. When the robot moves above the stations of the components from the pick zone to the collaborative zone, the TCP planned trajectory is planar at z = 0.3 m, where z is measured from the robot mounting table. To grasp or release the cubes, the robot follows a vertical path. The strategical nodes are defined as the intersection points between the plane z = 0.3 m and the vertical paths. For example, in

Robot Control Strategy
The robot tool center point (TCP) motion is planned by combining planar trajectories that trigger and terminate at strategical nodes. When the robot moves above the stations of the components from the pick zone to the collaborative zone, the TCP planned trajectory is planar at z = 0.3 m, where z is measured from the robot mounting table. To grasp or release the cubes, the robot follows a vertical path. The strategical nodes are defined as the intersection points between the plane z = 0.3 m and the vertical paths. For example, in Figure 5 the main directions of the robot planned trajectory in the collaborative zone are shown, together with the x and y axis of the robot base. Regardless of the cube to be placed, the robot approaches the collaborative zone always from point p C , then it navigates towards the station to be refilled. Once the component has been replaced, the robot drives backwards through the same path, returns in p c , and leaves the collaborative zone. However, due to the human presence, the planned trajectory may deviate from the rectilinear paths. In fact, if the operator takes a component and gets close to the robot, which is going to replace another one, the risk of a collision occurs. Then, the robot planned trajectory is modified through the collision avoidance algorithm, which is discussed below.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 6 of Figure 5 the main directions of the robot planned trajectory in the collaborative zone ar shown, together with the x and y axis of the robot base. Regardless of the cube to be placed the robot approaches the collaborative zone always from point , then it navigates to wards the station to be refilled. Once the component has been replaced, the robot drive backwards through the same path, returns in , and leaves the collaborative zone. How ever, due to the human presence, the planned trajectory may deviate from the rectilinea paths. In fact, if the operator takes a component and gets close to the robot, which is goin to replace another one, the risk of a collision occurs. Then, the robot planned trajectory modified through the collision avoidance algorithm, which is discussed below. Each Kinect gives as output the position of 25 points on the human body. Thes points will be indicated hereafter as skeleton [30,31]. The multiple sensors layout allow overcoming the problems related to occlusions of a single camera [10]. However, the us of multiple sensors shifts the attention into the data fusion problem. One of the commo techniques developed to merge the raw data obtained from the sensors consists of usin a predefined skeleton fitted model [32], while other techniques synthetize the skeleton generated by a couple of Kinects to better estimate the human joints position [33]. In th system proposed here, an optimization problem is solved to properly combine the tw skeletons. Further information related to the skeletons merging process and to the spati matching are reported in [19,33].
The two PCs connected to the Kinect sensors work in a master-slave architecture. Th PC-Master is responsible for the data acquisition synchronization of the sensors, sendin a trigger signal to the PC-Slave. The skeleton obtained by the PC-Slave is then sent to th PC-Master, that manages the combination of the skeletons acquired by the two Kinect The optimized skeleton is calculated with a frequency of 30 Hz. The optimized skeleton one of the inputs of the collision avoidance algorithm. The control algorithm runs in th third PC, hereafter called PC-UR. This PC receives the skeleton from the PC-Master an feedback data of the robot from the controller of the UR3. The feedback data related to th robot are described in [34].
The collision avoidance algorithm is based on the artificial potential fields approac [12,[35][36][37] and permits avoiding collisions between the upper part of the human body an all the moving links of the robot. Repulsive velocities are associated to the operator an Each Kinect gives as output the position of 25 points on the human body. These points will be indicated hereafter as skeleton [30,31]. The multiple sensors layout allows overcoming the problems related to occlusions of a single camera [10]. However, the use of multiple sensors shifts the attention into the data fusion problem. One of the common techniques developed to merge the raw data obtained from the sensors consists of using a predefined skeleton fitted model [32], while other techniques synthetize the skeletons generated by a couple of Kinects to better estimate the human joints position [33]. In the system proposed here, an optimization problem is solved to properly combine the two skeletons. Further information related to the skeletons merging process and to the spatial matching are reported in [19,33].
The two PCs connected to the Kinect sensors work in a master-slave architecture. The PC-Master is responsible for the data acquisition synchronization of the sensors, sending a trigger signal to the PC-Slave. The skeleton obtained by the PC-Slave is then sent to the PC-Master, that manages the combination of the skeletons acquired by the two Kinects. The optimized skeleton is calculated with a frequency of 30 Hz. The optimized skeleton is one of the inputs of the collision avoidance algorithm. The control algorithm runs in the third PC, hereafter called PC-UR. This PC receives the skeleton from the PC-Master and feedback data of the robot from the controller of the UR3. The feedback data related to the robot are described in [34].
The collision avoidance algorithm is based on the artificial potential fields approach [12,[35][36][37] and permits avoiding collisions between the upper part of the human body and all the moving links of the robot. Repulsive velocities are associated to the operator and attractive velocities to the desired task. The repulsive and attractive velocities are then added up to obtain a resultant velocity, which is the output of the collision avoidance algorithm. In this way, the implemented control algorithm can modify the planned trajectory to move the robot away from the human operator, but the task is preserved and accomplished when human-robot collisions are no longer possible. Both the repulsive velocities and the attractive ones are calculated in the operative space. To avoid undesired contacts between the worker and the moving links of the manipulator, nine points, divided in five clusters, have been assumed within the robot, as seen in Figure 6.
Appl. Sci. 2021, 11, x FOR PEER REVIEW attractive velocities to the desired task. The repulsive and attractive velocities added up to obtain a resultant velocity, which is the output of the collision av algorithm. In this way, the implemented control algorithm can modify the planne tory to move the robot away from the human operator, but the task is preserved complished when human-robot collisions are no longer possible. Both the repu locities and the attractive ones are calculated in the operative space. To avoid un contacts between the worker and the moving links of the manipulator, nine po vided in five clusters, have been assumed within the robot, as seen in Figure 6. The positions of these reference points are calculated by direct kinematics, ex the feedback joint degrees of freedom provided by the UR controller. The dista tween the human joints and the points on the UR3 robot are then evaluated u knnsearch algorithm [38]. This algorithm, given as inputs of two sets of points X a this case the points are respectively the position vectors of the joints of the optimiz eton and of the points of the clusters) finds the nearest neighbor in X for each que in Y and gives as outputs the distances. Given the human-robot distances , the r velocities , are calculated for each i cluster using the following equations: where is the maximum value of the magnitude of the repulsive velocity, reference distance, and is a shape factor. In this work, the magnitude has be elled as in Figure 7. This curve is obtained with = 0.3 m/s, = 0.4 m, an which have been used during the experimental phase. Concerning the value of determines the distance between the control points on the robot and the skeleton gers the repulsive effect), even if it may seem quite conservative, takes into acc real dimensions of the human body and robot. In fact, are point-to-point dista the human body and robot dimensions have been included in the reference dis Moreover, also considers the position uncertainties of the operator and robot r from measurement tolerances of the sensing devices according to what is require standards. Concerning and , their values were chosen considering the TC ity during the pick-and-place phases, to obtain evasive movements of the robot The positions of these reference points are calculated by direct kinematics, exploiting the feedback joint degrees of freedom provided by the UR controller. The distances between the human joints and the points on the UR3 robot are then evaluated using the knnsearch algorithm [38]. This algorithm, given as inputs of two sets of points X and Y (in this case the points are respectively the position vectors of the joints of the optimized skeleton and of the points of the clusters) finds the nearest neighbor in X for each query point in Y and gives as outputs the distances. Given the human-robot distances d i , the repulsive velocities v rep,i are calculated for each i cluster using the following equations: where V MAX is the maximum value of the magnitude of the repulsive velocity, ρ is the reference distance, and α is a shape factor. In this work, the magnitude V i has been modelled as in Figure 7. This curve is obtained with V MAX = 0.3 m/s, ρ = 0.4 m, and α = 5, which have been used during the experimental phase. Concerning the value of ρ (that determines the distance between the control points on the robot and the skeleton that triggers the repulsive effect), even if it may seem quite conservative, takes into account the real dimensions of the human body and robot. In fact, d i are point-to-point distances, so the human body and robot dimensions have been included in the reference distance ρ. Moreover, ρ also considers the position uncertainties of the operator and robot resulting from measurement tolerances of the sensing devices according to what is required by the standards. Concerning V MAX and α, their values were chosen considering the TCP velocity during the pick-and-place phases, to obtain evasive movements of the robot from the operator which were smooth and seamless.
does not fully respect the equations related to the SSM presented in [8]. In the technical specification, the value of the minimum human-robot distance is not constant and depends on several terms. The velocity of the human operator is one of the terms that modify the value of the minimum distance. In this work, a constant reference distance was adopted and the influence of the human velocity was taken into account choosing sufficiently precautionary values of the three parameters involved in the calculation of the repulsive velocities. Concerning the repulsive velocities associated to the points of Clusters 1 and 2, the distances are the minimum human-robot distances of each cluster. Instead, concerning the TCP of the robot, which is Cluster 5 in Figure 6, the repulsive velocity , is added to the attractive velocities associated to the task to obtain the resultant velocity where is the velocity vector associated to the planned task, is a diagonal matrix, and is the error vector, which is the difference between the desired pose of the TCP and the actual one. The orientation error is calculated considering the axis-angle convention [39]. If the minimum human-robot distance is lower than a given threshold even in presence of the repulsive velocities, the robot is stopped and it will move again when the minimum distance is greater than . The information useful to properly control the UR3 robot is the joint velocities vector . Therefore, the velocities from the operative space have to be mapped to the joint space. The joint velocities vector is calculated as follows: where is the geometric Jacobian matrix associated to the TCP and , is the partial Jacobian of each i cluster. The joint velocities vector is calculated with a frequency of 62.5 Hz and then sent to the controller of the UR3 to properly move the robot, in order to accomplish the task avoiding collisions with the human worker. Custom functions developed by the authors permit the communication between the PC-UR and controller of the robot, as reported in [17]. A schematic representation of the control strategy is shown in Figure 8. The scheme is divided in two parts: In the upper part, the data flow related to the acquisition of the movements of the human operator is reported, while the calculation process of the vector is shown in the lower part of the scheme. Concerning the movements acquisition, the PC-Master and the PC-Slave firstly obtain the data related to the It is important to highlight that the values of the three parameters V MAX , ρ, and α used in the experimental phase result in a safe collision avoidance in the sense that they can prevent the collision with the operator, even if the algorithm described in this section does not fully respect the equations related to the SSM presented in [8]. In the technical specification, the value of the minimum human-robot distance is not constant and depends on several terms. The velocity of the human operator is one of the terms that modify the value of the minimum distance. In this work, a constant reference distance ρ was adopted and the influence of the human velocity was taken into account choosing sufficiently precautionary values of the three parameters involved in the calculation of the repulsive velocities.
Concerning the repulsive velocities associated to the points of Clusters 1 and 2, the distances d i are the minimum human-robot distances of each cluster. Instead, concerning the TCP of the robot, which is Cluster 5 in Figure 6, the repulsive velocity v rep,TCP is added to the attractive velocities associated to the task to obtain the resultant velocity v res,TCP : v res,TCP = v rep,TCP + v task + K × e where v task is the velocity vector associated to the planned task, K is a diagonal matrix, and e is the error vector, which is the difference between the desired pose of the TCP and the actual one. The orientation error is calculated considering the axis-angle convention [39]. If the minimum human-robot distance is lower than a given threshold ρ min even in presence of the repulsive velocities, the robot is stopped and it will move again when the minimum distance is greater than ρ min . The information useful to properly control the UR3 robot is the joint velocities vector . q. Therefore, the velocities from the operative space have to be mapped to the joint space. The joint velocities vector . q is calculated as follows: .
where J is the geometric Jacobian matrix associated to the TCP and J part,i is the partial Jacobian of each i cluster. The joint velocities vector . q is calculated with a frequency of 62.5 Hz and then sent to the controller of the UR3 to properly move the robot, in order to accomplish the task avoiding collisions with the human worker. Custom functions developed by the authors permit the communication between the PC-UR and controller of the robot, as reported in [17]. A schematic representation of the control strategy is shown in Figure 8. The scheme is divided in two parts: In the upper part, the data flow related to the acquisition of the movements of the human operator is reported, while the calculation process of the vector . q is shown in the lower part of the scheme. Concerning the movements acquisition, the PC-Master and the PC-Slave firstly obtain the data related to the skeletons acquired by the two Kinect sensors. Then, the PC-Slave sends the skeleton to the PC-Master, which generates the optimized skeleton. The position vectors of the joints of the optimized skeleton are finally sent to the third PC. Meantime, the PC-UR has calculated the position of the points of the five clusters by direct kinematics, given the feedback data from the controller of the robot. The position vectors of the clusters' points and of the skeleton joints are the inputs of the collision avoidance algorithm, that gives as output the joint velocities vector . q. The joint velocities vector is sent to the UR-Controller every 0.016 ms.
R PEER REVIEW 9 of 14 skeletons acquired by the two Kinect sensors. Then, the PC-Slave sends the skeleton to the PC-Master, which generates the optimized skeleton. The position vectors of the joints of the optimized skeleton are finally sent to the third PC. Meantime, the PC-UR has calculated the position of the points of the five clusters by direct kinematics, given the feedback data from the controller of the robot. The position vectors of the clusters' points and of the skeleton joints are the inputs of the collision avoidance algorithm, that gives as output the joint velocities vector . The joint velocities vector is sent to the UR-Controller every 0.016 ms.

Results and Discussion
The effectiveness of the proposed collaborative layout is evaluated in terms of safety and productivity. Concerning the safety, the experimental tests prove that the collision avoidance algorithm can quickly drive the robot through alternative trajectories in order to avoid the human. Figure 9 shows an example of collision avoidance that happens when the robot is placing a↦A and the operator is taking B (for a more detailed overview of the entire assembly cycle the reader is referred to the video in "Supplementary Materials"). For each frame, the MATLAB calculation environment is reported in the robot base reference frame. In the latter, the robot links are represented as blue lines, together with the nine control points. The optimized skeleton of the human upper body is colored in red and made of 15 significant joints. The robot planned trajectory is also shown as the rectilinear dashed path connecting to , while the solid line is the trace of the actual collision avoidance trajectory. The robot approaches the collaborative zone from point and starts following the rectilinear planned path towards , while the human is still applying the glue on the first cube (Frame 1). Then, the operator finishes preparing A (Frame 2) and takes B, while the robot is crossing the relative station, so that the robot reacts backwards to avoid the human hand (Frame 3). As the hand retracts, the robot returns on the planned path (Frames 4 and 5) and reaches , while the human is preparing A+B (Frame 6).
The collision avoidance trajectory is analyzed in Figure 10. The robot planned trajectory is also shown with the dashed line, together with the strategical points. To give an idea of the repulsive effect, the repulsive velocity vectors acting on the TCP are reported on the actual path at significant samples. The repulsive effect increases nearby , which is the point above station B where the human takes the cube. Here, the actual path bends backwards due to the presence of the human hand. The operator takes the cube within a

Results and Discussion
The effectiveness of the proposed collaborative layout is evaluated in terms of safety and productivity. Concerning the safety, the experimental tests prove that the collision avoidance algorithm can quickly drive the robot through alternative trajectories in order to avoid the human. Figure 9 shows an example of collision avoidance that happens when the robot is placing a →A and the operator is taking B (for a more detailed overview of the entire assembly cycle the reader is referred to the video in "Supplementary Materials"). For each frame, the MATLAB calculation environment is reported in the robot base reference frame. In the latter, the robot links are represented as blue lines, together with the nine control points. The optimized skeleton of the human upper body is colored in red and made of 15 significant joints. The robot planned trajectory is also shown as the rectilinear dashed path connecting p C to p A , while the solid line is the trace of the actual collision avoidance trajectory. The robot approaches the collaborative zone from point p C and starts following the rectilinear planned path towards p A , while the human is still applying the glue on the first cube (Frame 1). Then, the operator finishes preparing A (Frame 2) and takes B, while the robot is crossing the relative station, so that the robot reacts backwards to avoid the human hand (Frame 3). As the hand retracts, the robot returns on the planned path (Frames 4 and 5) and reaches p A , while the human is preparing A+B (Frame 6).
The collision avoidance trajectory is analyzed in Figure 10. The robot planned trajectory is also shown with the dashed line, together with the strategical points. To give an idea of the repulsive effect, the repulsive velocity vectors acting on the TCP are reported on the actual path at significant samples. The repulsive effect increases nearby p B , which is the point above station B where the human takes the cube. Here, the actual path bends backwards due to the presence of the human hand. The operator takes the cube within a time interval of 1 s, so the repulsive effect is localized only on a limited portion of the collision avoidance path. l. Sci. 2021, 11, x FOR PEER REVIEW 10 o Figure 9. Frames of the collision avoidance during the "Place a↦A" stage. The possibility to carry out the task with the highest level of collaboration brings significant advantages in terms of task times. At the top of Figure 11, the workflow diagram of the proposed assembly cell is shown. In this case, which represents a responsive collaboration, the human and the robot complete their task in the same time interval, resulting in a mean cycle time of 112 s. The human and robot tasks run in parallel and the robot collaborates while the human executes value added operations, i.e., actions that carry on the assembly process.   The possibility to carry out the task with the highest level of collaboration brings significant advantages in terms of task times. At the top of Figure 11, the workflow diagram of the proposed assembly cell is shown. In this case, which represents a responsive collaboration, the human and the robot complete their task in the same time interval, resulting in a mean cycle time of 112 s. The human and robot tasks run in parallel and the robot collaborates while the human executes value added operations, i.e., actions that carry on the assembly process.
To stress the importance of this result, it is assumed that the same assembly cycle is carried out by considering the lowest level of collaboration. The latter identifies a sequential collaboration, where the human and robot workspaces intersect, but without the possibility for the human to access the collaborative zone if it is already occupied by the robot, and vice-versa. With this more restrictive safety constraint, the workflow diagram would be the one in the middle of Figure 11. In fact, when the operator finishes preparing A, he cannot enter in the collaborative zone until the robot accomplishes the "Place a↦A" phase. After that, the robot leaves the collaborative zone and the operator can take B. This generates a first delay of approximately 23 s on the human's task. A second delay of approximately 3 s would be at the end of the "Prepare A+B" phase, since the robot has not finished yet the "Place a↦A" stage and is still in the collaborative zone, therefore, the human must wait before he takes C. The mean cycle time, in this case, is 138 s. Comparing the latter result with the previous case, the major result is that the highest level of collaboration optimizes productivity by saving up to the 18% of the cycle time. Figure 11. Workflow diagram of the assembly cycle for responsive and sequential collaborations. Figure 11. Workflow diagram of the assembly cycle for responsive and sequential collaborations.
To stress the importance of this result, it is assumed that the same assembly cycle is carried out by considering the lowest level of collaboration. The latter identifies a sequential collaboration, where the human and robot workspaces intersect, but without the possibility for the human to access the collaborative zone if it is already occupied by the robot, and vice-versa. With this more restrictive safety constraint, the workflow diagram would be the one in the middle of Figure 11. In fact, when the operator finishes preparing A, he cannot enter in the collaborative zone until the robot accomplishes the "Place a →A" phase. After that, the robot leaves the collaborative zone and the operator can take B. This generates a first delay of approximately 23 s on the human's task. A second delay of approximately 3 s would be at the end of the "Prepare A+B" phase, since the robot has not finished yet the "Place a →A" stage and is still in the collaborative zone, therefore, the human must wait before he takes C. The mean cycle time, in this case, is 138 s. Comparing the latter result with the previous case, the major result is that the highest level of collaboration optimizes productivity by saving up to the 18% of the cycle time.

Conclusions
This work investigates the feasibility and the potential benefits of a collaborative assembly cell characterized by the highest level of collaboration. A practical and effective collaborative layout based on multiple Kinect cameras has been presented. Then, a representative assembly task which can take advantage from collaborative robotics has been chosen. The robot and operator carry out their task in parallel, with the possibility to operate at the same time in the shared workspace. An UR3 collaborative robot has been used for the experimental test. The robot control strategy has been discussed to describe a collision avoidance algorithm based on repulsive velocities. The algorithm has a low computational cost and can drive the robotic arm away from the human body represented as a skeleton. The result section has shown the capabilities of the proposed algorithm by analyzing the robot alternative trajectory. The robot is able to avoid the human and return on the planned path to carry on the task. Moreover, the cycle time has been compared for the cases of responsive and sequential collaboration. The highest level of collaboration, which has been tested in this work, promises significant improvement in terms of task time, even if the actual possible benefit should be carefully evaluated for each specific application.
Software and hardware improvements of the experimental setup will be involved in future works. The control algorithms will be written in a low-level programming language to package the code for real-time application in the industrial field. The Microsoft Kinect v2 sensors will be substituted by Azure Kinect DK [40], which is the new RGBD camera by Microsoft, and the number of the PCs will be optimized. These software and hardware improvements will lead to a more efficient and cheaper experimental setup.
The authors are currently working on algorithms useful to predict the movements of the operator and evaluate his/her velocity using either vision sensors or wearable devices [20,21,41]. These algorithms will permit strictly implementing the equations written in [8] without considering that the velocity of the human operator is constant and equal to 1.6 m/s. Furthermore, the application of the proposed layout in a real industrial scenario will be studied in the future.