1. Introduction
With the advent of the time of high intelligence, the application of robots in industrial production has become more and more extensive [
1]. Using robots to achieve assembly automation can improve production efficiency, reduce production costs, and ensure product quality [
2,
3]. However, a single-arm industrial robot is difficult to complete complex assembly tasks, so additional equipment is usually required to assist the robot [
4]. Compared with single-robot assembling system, dual-robot cooperation can complete complex assembly tasks more efficiently. Dual or more industrial robot cooperation is the main development trend in the future [
5,
6,
7,
8].
At present, there are some dual-robot system products, such as PR2 [
9] and YuMi [
10], which are the important equipment used for research and experiments. The trajectory planning and optimization are difficult in the process of dual-robot cooperative assembly. Due to the multi degrees of freedom of dual-robot and the coupling relationship between time and space in the movement of different arms, trajectory planning method of dual-robot is very different from that of a single arm robot [
11]. How to plan a collision-free trajectory in a dynamic environment, and ensure that the trajectory is accurate, efficient, and smooth, have become the key research content in the dual-robot cooperative assembly.
Some scholars have extended the research on multi-robot motion planning by using vision method [
12], grid method [
13], artificial potential field method [
14,
15] and other methods. Chuang et al. [
16] proposed a dual-robot alternate priority planning algorithm based on artificial potential field, which uses the iterative method to continuously plan local paths until each arm reaches the target. Sunil et al. [
17] studied the trajectory planning of free-floating dual-arm manipulator by using the algorithm based on position kinematics equation and iterative search. Sezgin et al. [
18,
19] introduced control configuration points (CCPs) to take advantage of redundancy when using multi-plane robots. For obstacle avoidance, Liu et al. [
20] used CCPs to develop a method for planning the trajectory of multiple robot fingers when folding cartons.
However, in the high-dimensional space and complex working environment, the traditional path planning algorithm has the problems of large calculation amount and complex model construction. Instead, motion planning method based on random sampling shows unique advantages in solving the problem, such as Probabilistic Roadmaps (PRM) [
21], Rapidly-exploring Random Trees (RRT) [
22], and their variants [
23,
24,
25,
26]. Among them, the reduced query time and memory requirements make RRT become the current main algorithm for dual-robot cooperative motion planning. However, the path generated by the basic RRT is poor quality and lack of repeatability due to randomness. The fast convergence and asymptotic optimization are important exploration fields for RRT. For example, Informed RRT* [
27] can reduce the computational burden by defining the sampling domain as a prolate hyper-ellipsoid. Batch Informed Trees (BIT*) [
28] which is based on a unified graph and sampling-based planning technology can also reduce path costs. Nevertheless, it remains a challenge to strike a balance between path quality and planning efficiency in high-dimensional space. Indeed, in practical real-time applications, obtaining a high-quality solution quickly is of more interest than achieving an optimal solution. Part of the focus of this paper will be on this issue.
In fact, RRT-Connect [
29] has a high success rate in solving dual robots in complex environments. By properly post-processing the sampling path, we can quickly obtain a high-quality path which optimizes the problem that RRT-Connect does not converge to the target. Without loss of generality, and in order to increase operating space and load capability, this paper builds a dual-robot platform based on two independent industrial robots ABB IRB120, and discusses the trajectory planning of dual-robot cooperation for disassembling the wire from terminal. The main research contents and results are summarized as follows:
- (1)
An overall scheme of the dual-robot cooperative assembly system is designed. For the trajectory planning problem, a trajectory planning hierarchy based on ROS (Robot Operating System) is proposed.
- (2)
The RRT-Connect algorithm is uesd for the motion planning of the dual-robot, and the original collision-free path is generated.
- (3)
The planned path is further simplified and smoothed. In addition, then time parameter is matched to the path points. Finally, the optimized joint angle data of the dual-robot with time parameter is obtained.
- (4)
Through experiments, this paper verified the feasibility of the trajectory planning method in complex environments. The proposed algorithms are used for actual dual-robot to disassemble the wire from terminal.
2. Trajectory planning Frame
2.1. Dual-Robot Cooperative Assembly System
The structure diagram of the dual-robot cooperative assembly system designed in this paper is shown in
Figure 1. As the controllers of usual industrial robots are mostly not an open-source system, it is unsuitable to develop the trajectory planning algorithm directly on the robot controllers. Therefore, a main computer is needed, and a system with two sub-controllers of dual-robot is formed.
In the main computer, there are many software development platforms for robot systems, such as MATLAB, RobotStudio (only for ABB robot), Player/stage, ROS, etc. Among them, ROS is widely used worldwide because of its openness and rich functions. In addition, the offline programming interface, scene visualization interface and motion planning module are realized based on ROS. Specifically, the user inputs the task into the offline programming interface through specific instructions, which is implemented through Qt Creator. The scene visualization interface implemented by the visualization tool RViz is used to display the robot and its working environment to the user. The motion planning module which based on the forward and inverse solutions of robot kinematics can calculate the relationship between Cartesian space and joint space.
Finally, the generated joint trajectory can be displayed on the visual interface RViz to simulate the task execution process of the dual-robot. On the other hand, it can be sent to the sub-controllers. In addition, every robot controller will convert the trajectory into actual control instructions so that it can drive the robot arm and end effector to perform specific movements.
2.2. Trajectory Planning Hierarchy
In order to solve the problem of trajectory planning in the process of dual-robot cooperative assembly, a theoretical hierarchical framework for dual-robot cooperative trajectory planning is designed. As shown in
Figure 2, it is divided into 5 layers, from top to bottom including user layer, planning layer, transmission layer, communication layer, and execution layer.
The user layer includes the human-computer interface and virtual motion scene. The human-computer interface provides the user with a task input window. Users should first input the robot model, and then set the position of objects and obstacles according to the actual scene. These models can be displayed in virtual motion scene by using RViz.
This paper also designed several action instructions for users to input. Each action contains the respective action instructions of the two robots. The action instructions are shown in
Table 1. Here,
p represents the pose of the target point,
t represents the pause time,
and
, respectively, represent the approach vector and exit retreat when picking or placing the object.
In order to better understand, as shown in
Figure 3, the disassembling wire from terminal is taken as an example. In each of actions, the two robots start to move at the same time. An example of the dual-robot action instructions is shown in
Table 2.
In the first set of actions, the left and right robots, respectively, pick the wire and terminal. is the direction vector which means 10mm translation along the axis. The left robot adjusts its posture to be the same as , and then extends along to point . After clamping the wire, the left robot remains motionless, so the retreat vector is set to . The right robot picks up the terminal with the same action.
In the second set of actions, the left robot moves along a straight trajectory to pull out the wire and move the wire from to . At the same time, the right robot remains stationary.
In the third set of actions, the left robot places the wire from to . There is no need to place the object in a specified direction, so the approach vector is set to . In addition, then the left robot moves along the vector after placing the object. The action of the right robot is the same, and the whole process of disassembling terminal with wire is finally finished.
After the user inputs tasks, the planning layer will perform motion planning according to these actions. RRT-Connect algorithm is used to get the original path. Then the path need to be simplified and smoothed. At last, the time parameter is sequenced for all the path points to obtain the effective trajectory.
The transmission layer will transmit trajectory data to the communication layer. In addition, it can save the trajectory data as a text file for next use.
The communication layer uses Socket to realize the information interaction between the main computer and the sub-controllers. The main computer acts as the Socket client, and the sub-controllers of dual-robot act as servers.
The execution layer is responsible for receiving and processing information from the main computer. It can also feed back the processing results to communication layer.
3. Motion Planning Algorithm for Dual-Robot
The motion planning of the dual-robot is carried out in high-dimensional space, and the two arms are dynamic obstacles to each other. Therefore, this paper adopts the random sampling motion planning method and develops the motion planning analysis based on the RRT algorithm [
22].
In this paper, RRT-Connect algorithm [
29] is selected for initial path planning of dual-robot. RRT-Connect algorithm can improve the node expansion mode of RRT algorithm. The schematic diagram of node expansion is shown in
Figure 4 and the pseudo code of RRT-Connect is shown in Algorithm 1. It establishes two random search trees based on the starting point
and the target point
. In each round of expansion, one tree for sampling expansion and the other tree for directional expansion are specified.
Algorithm 1: RRT-Connect |
- Input:
, - Output:
- 1:
while
do - 2:
, , - 3:
if is in then - 4:
, , - 5:
if is in then - 6:
- 7:
if then - 8:
return - 9:
end if - 10:
else - 11:
- 12:
end if - 13:
else - 14:
- 15:
end if - 16:
end while
|
Within the rated planning time T, firstly, the random tree for sampling expansion samples a point in the free space . Secondly, we need to find the node nearest to in random tree and denoted as . Thirdly, a new point needs to be generated by the following principles. If the distance between and is greater than the maximum step , is used as the step to interpolate point in the direction from to . On the contrary, if the distance between and is less than , is directly set as the point . After that, if is located in the obstacle space , the expansion of the current round will be ended. Otherwise, another random tree will be expanded in a directional way. The process of directional expansion is as follows. Firstly, the node in the tree which is nearest to needs to be found, and a new node with a certain search step in the direction of node is generated. If is in free space , directional expansion towards should be proceeded. Finally, the two random trees are tried to be connected together. If can reach to , the two random trees are connected successfully and records the connection points between two trees. In order to make the two random trees have equal opportunities to explore in the state space, the expansion modes of the two random trees are exchanged after each round of expansion.
After planning the path of the robot, the trajectory points on the path need to be sampled and recorded. In this paper, sampling in joint space is selected to record the joint angular displacement of the robot. In this way, we can use forward kinematics to determine the unique attitude point, which can ensure a high success rate of planning. The joint space of the dual-robot system composed of two six degree of freedom robots is a 12-dimensional linear space. The calculation of sampling points in space is as follows:
where
represents the angular displacement of joint
of the left robot, and
represents the angular displacement of joint
of the right robot.
The RRT-Connection algorithm needs a distance function to solve the distance between two state points. For multi-joint space
, the path cost during the movement between two state points can be expressed by Manhattan distance. Manhattan distance only needs addition and subtraction, so the cost of computing in the computer is low, and this advantage is more obvious in multi-dimensional space. The specific formula is in Equation (
2):
where
and
represent any two points in the joint space.
The RRT-Connect algorithm also needs a collision detection mechanism to determine whether the leaf node and geometric models are in the collision space [
30]. This paper adopts the Bounding Volume Hierarchy (BVH) algorithm [
31], which is a tree data structure. It does not need to traverse all bounding box pairs, but recursively detect the bounding boxes of each layer. When several pairs of bounding boxes that may collide are detected, BVH algorithm will further detect the subsets of these bounding boxes. In this way, the obvious disjoint parts in the space can be quickly excluded, so the number of bounding box pairs for intersection test are reduced as much as possible, and it improves the detection efficiency.
The process of collision detection for each point is as follows. First, the points are transformed into Cartesian space by forward kinematics. Then we use the BVH algorithm to perform collision detection in pairs for each manipulator of the dual-robot itself. If the two manipulators do not collide themselves, then perform the collision detection between the dual-robot and obstacles in the environment.
In the actual trajectory planning process, in order to avoid collision when the robot moves between path points, collision detection should be applied to every movement between path points. In other words, for a continuous path connected by two state points, it is necessary to discretize the path so as to interpolate enough intermediate points to represent the state of each movement time. The interpolation function is defined as Equation (
3):
where
and
, respectively, represent the start point and end point of the path,
is the
interpolation point in the path, and
s is the interpolation step length.
In the system, the Flexible Collision Library (FCL) [
32] is used to realize the collision detection of each point. The flow of collision detection is shown in
Figure 5.
4. Path Post-Processing
Using the path planning algorithm of RRT-Connect, we obtain an effective original path in the joint space. However, this path is a polyline segment generated by random sampling, which has disadvantages such as large turning angle, spiral path and lack of time parameters. Therefore, it is necessary to optimize the original path and solve these problems.
4.1. Path Simplification
In order to simplify the original path, we need to connect two original path points that are not adjacent to each other. There is usually more than one simplified path between original path points, this paper uses Floyd algorithm to simplify the original path.
Floyd algorithm is a shortest path algorithm [
33], which is easy to implement and suitable for finding the shortest path between any two points. As shown in the Algorithm 2, we should first input
n original path points.
and
, respectively, represent the distance matrix and the path matrix after
r traversals, which are both
r-order matrices. The element
of matrix
stores the shortest path length between the path points
and
after the
r traversals. The initial value
is the linear distance from
to
. If the connection between
and
is in the collision space
, set
. The element
of matrix
stores the vertex number of the shortest path from
to
. The initial value
.
The specific calculation method for each traversal is as follows. It is supposed the point passes through the intermediate point to , the shortest distance to point is . In addition, the shortest distance passes point is . Then compute the path length of point to which passes through the intermediate point .
In the
r traversals of Algorithm 2, if the element
obtained by the
traversal is greater than the element
obtained last time, the value will not change. Otherwise,
will update and the element
will record the serial number
r of the interpolation point.
Algorithm 2: Floyd |
- Input:
- Output:
- 1:
Initialize - 2:
for to n do - 3:
for to n do - 4:
for to j do - 5:
if then - 6:
, - 7:
else - 8:
, - 9:
end if - 10:
end for - 11:
end for - 12:
end for
|
4.2. Path Smoothing
The simplified path may still have problems such as large turning angle, which can be improved by smoothing the path. In this paper, path smoothing is based on Bezier curve, which is one of the most commonly used curve approximation methods in engineering. However, the higher-order Bezier curve will bring about computational difficulties, this paper uses a multi-segment quadratic Bezier curve to approximate the simplified path. The quadratic Bezier curve requires three control points. Through calculation, we get its parameter in Equation (
4):
where
is the control point,
is the proportional coefficient.
Equation (
4) can be further deduced in Equation (
5):
where
,
, respectively, represent the point on line segment
and
.
Equation (
5) shows that the point
of quadratic Bezier curve is a point on line segment
, and satisfies the following proportional relationship [
34]:
In addition, when two quadratic Bezier curves
and
with their control point sequences
and
are given, we need to splice these two curves. Firstly, the two curves need to meet the zero-order parameter continuity. Therefore, the end point of the first curve should coincide with the start point of the second curve
. Secondly, in order to make the splice smooth, the two curves must meet at least the first-order parameter continuity, so the splice point should be located at the midpoint of line segment
[
35]. Finally, the collision detection is carried out again. If the movement of these curve points is feasible, the path smoothing can be realized by splicing multiple quadratic Bezier curves. Otherwise, the original part of the path is retained.
Taking
Figure 6 as an example: The midpoints
,
,
, and
of the original line segment are used as the splicing points of each Bezier curve. Take
on each segment of the curve to interpolate points
,
, and
. Therefore, the smoothed path is
.
4.3. Path Time Parameterization
It is necessary to specify the motion time parameters of each path on the basis of meeting the speed and acceleration limits of each joint. Because the path planned by sampling is complex and changeable, it is difficult to obtain the analytical formula of the path, so this paper uses the iterative method to calculate the motion time. We use Equation (
3) to interpolate the smoothed points of each segment, and these subdivided path points will be used as joint position parameters for controlling the motion of the robot.
Assume that the planned path
P has
n path points, which are recorded as
. Each path point
contains the position information of 12 joints, and the position of each joint is recorded as
. Accordingly, the instantaneous velocity and acceleration of this position are recorded as
and
. It assumed that each joint moves from
to
at the maximum joint speed
, the motion time
shall meet the constraints of each joint and it can be calculated in Equation (
7):
The motion time also need to meet the constraint of the acceleration of the joint. It can be seen from Equation (
3) that when the interpolation length
s is very small, the change of the joint angle will also be small. From Equation (
7),
will also a small value. Therefore, We can regard the speed from
to
as a uniform speed change, and according to the definition of acceleration, we get Equation (
8):
where
,
represents the average velocity of joint
j from
to
.
According to Equation (
8), the shorter the time interval
, the greater the acceleration. To limit the acceleration in a certain range, it is necessary to increase
or
. At the same time, the acceleration
of each joint can be recursive,
i can be recursive from 1 to
n to obtain the acceleration in the path, and can also be recursive from
n to 1 to obtain the deceleration in the path.
In the process of forward recursion, the new motion time
between each path point is calculated in Equation (
9):
where
is the motion time to be adjusted to meet the joint speed limit, and
is the increment of time. In this paper,
. By using the increased new motion time
, the corresponding speed and acceleration can be calculated in Equations (
10) and (
11):
The process of backward recursion is similar to that of forward recursion, which will not be repeated here. In the process of iteration, the processes of forward recursion and reverse recursion will be repeatedly adjusted until of each joint is less than . Finally, we can calculate the time of each trajectory point.
6. Conclusions
This paper is motivated to provide a solution to the trajectory planning for dual-robot cooperative assembly. Due to the high-dimensional space of dual-robot and the complex environment of dynamic changes, the method of random sampling based motion planning is adopted. The random path is generated in the working space based on RRT-Connect algorithm. The original path planning of dual-robot is carried out combined with BVH algorithm. In order to solve problems of existing many broken lines and circling paths of the original path, the obtained path is simplified by Floyd algorithm. Aiming at the problem of large turning angles of path, the path is smoothed by Bezier curve. In order to obtain the trajectory point information with time parameters, the time information corresponding to each joint angle is derived by iterative method. Finally, the effective joint trajectory of the dual-robot is obtained.
Experiments show that the proposed path planning method can effectively plan a simple, smooth and fast path for dual-robot to complete the assembly task. It provides a whole method for trajectory planning of dual-robot cooperative assembly.