2.2. Master-Slave Planning Based on B-RRT* for Dual Redundant Manipulators
For dual redundant manipulators, B-RRT* establishes a tree
T1 at the initial node
qinit and another tree
T2 at the goal node
qgoal, respectively. The root node of the tree
T1 is
qinit and the root node of the tree
T2 is
qgoal. Then, two trees are extended successively until they are connected to each other, as shown in Algorithm 1.
Algorithm 1. Bidirectional RRT* |
Input: the initial node qinit and the goal node qgoal |
Output: the desired path σ |
1. T1.init(qinit); T2.init(qgoal); |
2. For i = 1 To N |
3. (T1, flag1, qe1, qe2) ← Extend(T1, T2); |
4. If flag1 = true |
5. Break; |
6. End If |
7. (T2, flag2, qe1, qe2) ← Extend(T2, T1); |
8. If flag2 = true |
9. Break; |
10. End If |
11. End For |
12. If flag1 = true or flag2 = true |
13. σ ← ExtractPath (T1, T2, qinit, qgoal, qe1, qe2); |
14. Else |
15. σ ← Ø; |
16. End If |
17. Return σ; |
Assuming that both the left manipulator and the right manipulator have
n degrees of freedom, the dual redundant manipulator can be regarded as a whole, which is equivalent to a single manipulator with 2
n degrees of freedom. In this case, the nodes of two trees can be expressed as below:
where
,
,
is the node of one tree of the dual redundant manipulator,
is the set of
n joint angles of the left manipulator,
is the set of
n joint angles of the right manipulator,
is the
ith joint angle of the left manipulator and
is the
ith joint angle of the right manipulator.
The extension processes of two trees are identical. Hence, the extension process of the tree
T1 is taken as an example to elaborate the details, as shown in Algorithm 2.
Algorithm 2 (T1, flag, qe1, qe2) ← Extend(T1, T2) |
flag ← false; qrand ← Sample(qlimit); qnear1 ← Near(qrand, T1); qnew1 ← Steer(qrand, qnear1); feasibility ← DetectCollision(qnew1); If feasibility = true T1 ← Insert(qnew1, qnear1); T1 ← ReselectParentNode(qnew1, qnear1, T1); T1 ← Rewire(qnew1, T1); (flag, qe1, qe2) ← JudgeConnectivity(qnew1, T2); While feasibility = true And flag = false qnear2 ← Near(qnew1, T2); qnew2 ← Steer(qnew1, qnear2); feasibility ← DetectCollision(qnew2); If feasibility = true T2 ← Insert(qnew2, qnear2); T2 ← ReselectParentNode(qnew2, qnear2, T2); T2 ← Rewire(qnew2, T2); (flag, qe1, qe2) ← JudgeConnectivity(qnew2, T1); End If End While End If
|
Firstly, a sampling point
qrand can be obtained by random sampling within the motion range of the dual redundant manipulator. Secondly, the node
qnear1 that is nearest to the sampling point
qrand is searched in the tree
T1. Thirdly, a new node
qnew1, whose parent node is
qnear1, can be obtained by expanding, as shown in Algorithm 3. Fourthly, the collision between the dual redundant manipulator and obstacles at the new node
qnew1 is detected. If a collision occurs, the new node
qnew1 will be abandoned and then the tree
T2 is switched to extend. Conversely, if no collision occurs, the new node
qnew1 will be added to the tree
T1. Fifthly, the parent node of the new node
qnew1 is reselected in its neighborhood. Its new parent node is the node with the lowest path cost. The path cost of a node is the sum of the path length from the root node
qinit to this node and the path length from this node to the new node
qnew1. Sixthly, all nodes in the neighborhood of the new node
qnew1 are rewired. The new node
qnew1 is taken as the parent node of these nodes and then their new path costs are calculated. If the new path costs are less than the old path costs, the parent nodes of these nodes are changed to the new node
qnew1. On the contrary, the parent nodes of these nodes remain unchanged. Seventhly, the connectivity of the two trees is checked, as shown in Algorithm 4. If the distance between the new node
qnew1 and some node of the tree
T2 is less than the connection threshold, the two trees have been connected to each other and then the extensions of two trees are stopped. If the distance between the new node
qnew1 and any node of the tree
T2 is greater than the connection threshold, the tree
T2 is extended towards the new node
qnew1 until there is a collision or the two trees are connected to each other. In the case that there is a collision, the tree
T2 is switched to perform the above steps. Finally, in the case that the extensions of two trees are completed, if the two trees are connected to each other, the desired path can be extracted from the two trees and it will be the output of the algorithm. Otherwise, the empty set is directly returned as the output of the algorithm.
Algorithm 3 qnew ← Steer(qtarget, qnear) |
(, ) ← Decompose(qtarget); (, ) ← Decompose(qnear); ← Expand(, ); l ← ( − )/t; r ← Constraint(l, , ); ← + t∙r; qnew ← Merge(, );
|
Algorithm 4 (flag, qe1, qe2) ← JudgeConnectivity(qnew, T) |
|
In the expansion phase, for single redundant manipulators, a new node qnew can be obtained directly by extending a step distance δ forward in the direction from the node qnear to the sampling point qrand. However, for dual redundant manipulators, considering the closed-chain constraints (1)–(5) between the left manipulator and the right manipulator in tight coordination, a new node qnew cannot be obtained by the expansion mode of single redundant manipulators. Therefore, the master-slave planning method is adopted to extend the trees of dual redundant manipulators. It is assumed that the left manipulator is the master manipulator and the right manipulator is the slave manipulator. A new set of joint angles of the left manipulator is generated by the expansion mode of single redundant manipulators. Then, the corresponding set of joint angles of the right manipulator can be calculated according to the closed-chain constraints. Lastly, a new node qnew of the dual redundant manipulator can be obtained by merging the two sets of joint angles and .
The closed-chain constraints (1)–(5) of the dual redundant manipulator are the constraints between the terminal states of the left manipulator and the right manipulator. Therefore, the general execution process of the master-slave planning method is described as follows. After obtaining the set of joint angles of the left manipulator, the terminal position and posture of the left manipulator are calculated through forward kinematics. Then, the terminal position and posture of the right manipulator can be calculated through the closed-chain constraints (1) and (2). Finally, the set of joint angles of the right manipulator is solved by inverse kinematics [
28,
29]. The numbers of degrees of freedom of the left manipulator and the right manipulator are both greater than 6. It results in the calculation of the analytic solution of inverse kinematics being very tedious. Hence, the inverse kinematics is usually solved by numerical algorithms. Numerical algorithms are generally based on the relationship (7) between the terminal generalized velocity of the redundant manipulator and its joint angular velocity. The joint angular velocity of the redundant manipulator is calculated by the numerical algorithm, and then its corresponding set of joint angles can be calculated accordingly [
30,
31].
where
is the terminal generalized velocity vector of the redundant manipulator,
is the pseudo inverse of the Jacobian matrix and
is a vector in the null space.
The closed-chain constraints (3)–(5) of the dual redundant manipulator are essentially the constraints between the terminal generalized velocities of the left manipulator and the right manipulator, but they have been transformed into the constraints between the joint angular velocities of the left manipulator and the right manipulator through the Jacobian matrix. To simplify the calculation of the set of joint angles of the right manipulator, the joint angular velocity of the left manipulator is calculated after obtaining the set of joint angles of the left manipulator. Then, the joint angular velocity of the right manipulator can be calculated through the closed-chain constraints (3)–(5), and the set of joint angles of the right manipulator can be calculated accordingly, as shown in Algorithm 3. This method can avoid the calculation of the inverse kinematics solution and can effectively improve the planning efficiency and shorten the planning time. The specific steps are described as follows:
- (I)
In the direction from the node
of the left manipulator to its temporary target point
, the new node
can be obtained by extending a step distance
δ forward, as described below:
where
is the new node of the left manipulator and
is the node closest to the temporary target point
of the left manipulator.
- (II)
The motion time
t between two adjacent nodes of the dual redundant manipulator is given. Assuming that the left manipulator moves at a uniform speed between the two adjacent nodes in the joint space, the joint angular velocity
l of the left manipulator can be calculated by Equation (9).
where
is the joint angular velocity of the left manipulator and
is the motion time between two adjacent nodes of the dual redundant manipulator.
- (III)
According to the closed-chain constraint (5), the joint angular velocity r of the right manipulator is calculated.
- (IV)
Similarly, assuming that the right manipulator moves at a uniform speed between the two adjacent nodes in the joint space, the new node
of the right manipulator can be calculated by Equation (10).
where
is the new node of the right manipulator,
is the node closest to the temporary target point
of the right manipulator and
is the joint angular velocity of the right manipulator.
- (V)
The new node of the left manipulator and the new node of the right manipulator are merged to obtain the new node qnew = [ ] of the dual redundant manipulator.
To ensure that the new node qnew can satisfy the closed-chain constraints (1) and (2), the step distance δ and the motion time t should not be too large. That is, the motion between the two adjacent nodes should be a differential motion.
2.3. Local Path Replanning
The connection condition of two trees is that the distance between some node q1i of the tree T1 and some node q2j of the tree T2 is less than the given threshold, as shown in Algorithm 4. In the case that B-RRT* is applied to dual redundant manipulators, its node q contains both the set of joint angles ql of the left manipulator and the set of joint angles qr of the right manipulator. In the actual planning, when the distance between two sets of joint angles of the left manipulator (or the right manipulator) in different trees is less than the given threshold, the distance between two sets of joint angles of the right manipulator (or the left manipulator) in different trees may be not less than the given threshold in a high probability. That is, it is difficult to meet the connection condition of two trees. Therefore, it is necessary to modify the connection condition of two trees for solving the above problem.
Since it is difficult for the left manipulator and the right manipulator to meet the connection condition at the same time, it can first ensure that the parts corresponding to the left manipulator in two nodes of different trees are connected with each other, as shown in Algorithm 5. Then, the local path between the parts corresponding to the right manipulator in two nodes of different trees is replanned. That is, while keeping the left manipulator stationary, the right manipulator moves from the set of joint angles corresponding to the connection node of the tree
T1 (or
T2) to the set of joint angles corresponding to the connection node of the tree
T2 (or
T1). Moreover, to satisfy the closed-chain constraints (1) and (2), the terminal position and posture of the right manipulator must always remain unchanged during the movement.
Algorithm 5 (flag, qe1, qe2) ← NewJudgeConnectivity(qnew, T) |
qe1 ← qnew; (, ) ← Decompose(qnew); Fori = 1 To k qi ← ExtractNode(T, i); (, ) ← Decompose(qi); If Distance(, ) < threshold flag ← true; qe2 ← qi; Break; Else flag ← false; End For End For
|
To ensure that the terminal position and posture of the right manipulator remains unchanged during the local path replanning, it can be realized through the joint self-motion in the null space [
34,
35] on the basis of the characteristics of redundant manipulators. That is, the joint angular velocity of the right manipulator is calculated by setting the terminal generalized velocity
V in Equation (7) to zero, as described below:
where
is a vector in the null space of the right manipulator.
To ensure that the right manipulator can start from the starting point
of the local path and move towards the end point
of the local path, the value of vector
εr can be calculated by Equation (12).
where
,
,
is the starting point of the local path of the right manipulator,
is the end point of the local path of the right manipulator,
is the upper limit of the number of discrete points in the local path of the right manipulator and
is the serial number of the current discrete point in the local path of the right manipulator.
The process of local path replanning is shown in Algorithm 6. In addition, the extension process of bidirectional RRT* with local path replanning (B-RRT*-LPR) is shown in Algorithm 7.
Algorithm 6 (T, success, qe1) ← Localpath(qe1, qe2, T) |
success ← false; (, ) ← Decompose(qe1); (, ) ← Decompose(qe2); q1 ← qe1; ← ; Fork = 1 To m − 1 ← Jacobian(); ← NullSpaceVector(, , k); ← Velocity(, ); ← + t ← Merge(, r k; feasibility ← DetectCollision(qk+1); If feasibility = true T ← Insert(qk+1, qk); qk ← qk+1; If Distance(, ) < threshold qe1 ← qk+1; success ← true; Break; End If End If End For
|
The specific steps of local path replanning are described as follows:
- (a)
The parts corresponding to the right manipulator in the connection node of the tree T1 (or T2) are selected as the starting point of the local path. The parts corresponding to the right manipulator in the connection node of the tree T2 (or T1) are selected as the end point of the local path. The first discrete point of the local path is .
- (b)
The Jacobian matrix and the vector of the current discrete point are calculated. Then, the joint angular velocity of the right manipulator is calculated according to Equation (11).
- (c)
The next discrete point
is calculated by Equation (13).
where
is the next discrete point of the local path of the right manipulator,
is the current discrete point of the local path of the right manipulator and
is the joint angular velocity of the right manipulator at the current discrete point of the local path.
Algorithm 7 (T1, flag, qe1, qe2) ← NewExtend(T1, T2) |
flag ← false; qrand ← Sample(qlimit); qnear1 ← Near(qrand, T1); qnew1 ← Steer(qrand, qnear1); feasibility ← DetectCollision(qnew1); Iffeasibility = true T1 ← Insert(qnew1, qnear1); T1 ← ReselectParentNode(qnew1, qnear1, T1); T1 ← Rewire(qnew1, T1); (flag, qe1, qe2) ← NewJudgeConnectivity(qnew1, T2); If flag = true (T1, flag, qe1) ← Localpath(qe1, qe2, T1); End If While feasibility = true And flag = false qnear2 ← Near(qnew1, T2); qnew2 ← Steer(qnew1, qnear2); feasibility ← DetectCollision(qnew2); If feasibility = true T2 ← Insert(qnew2, qnear2); T2 ← ReselectParentNode(qnew2, qnear2, T2); T2 ← Rewire(qnew2, T2); (flag, qe2, qe1) ← NewJudgeConnectivity(qnew2, T1); If flag = true (T2, flag, qe2) ← Localpath(qe2, qe1, T2); End If End If End While End If
|
- (d)
The set of joint angles of the left manipulator corresponding to the starting point of the local path of the right manipulator is merged with the next discrete point of the local path of the right manipulator to obtain the next discrete point qk+1 = [ ] of the local path of the dual redundant manipulator.
- (e)
The collision detection of the next discrete point qk+1 of the local path of the dual redundant manipulator is carried out. If the dual redundant manipulator does not collide, step (f) is performed. If the dual redundant manipulator collides, the local path replanning is stopped and the result that the node qlocalstart = [q ] and the node qlocalgoal = [ ] cannot be connected with each other is returned.
- (f)
The next discrete point qk+1 of the local path of the dual redundant manipulator is added to the tree T1 (or T2).
- (g)
The distance between the next discrete point of the local path of the right manipulator and the end point of the local path of the right manipulator is judged to determine whether it is less than the given threshold. Alternatively, the serial number k of the current discrete point is judged to determine whether it is greater than the upper limit m of the number of discrete points. If the distance is less than the given threshold or the serial number k is greater than the upper limit m, the local path replanning is stopped and the result that the node qlocalstart and the node qlocalgoal can be connected with each other is returned. If the distance is not less than the given threshold value and the serial number k is not greater than the upper limit m, the current discrete point of the local path of the right manipulator is replaced by +1, and then step (b) is performed again.