# Hierarchical Task Planning for Multiarm Robot with Multiconstraint

Authors: Yifan Wang; Hanxu Sun; Gang Chen; Qingxuan Jia; Boyang Yu
Journal: Mathematical Problems in Engineering
 (2016)

---

## Abstract

Multiarm systems become the trends of space robots, for the on-orbit servicing missions are becoming more complex and various. A hierarchical task planning method with multiconstraint for multiarm space robot is presented in this paper. The process of task planning is separated into two hierarchies: mission profile analysis and task node planning. In mission profile analysis, several kinds of primitive tasks and operators are defined. Then, a complex task can be decomposed into a sequence of primitive tasks by using hierarchical task network (HTN) with those primitive tasks and operators. In task node planning,A
⁎ algorithm is improved to adapt the continuous motion of manipulator. Then, some of the primitive tasks which cannot be executed directly because of constraints are further decomposed into several task nodes by using improved A
⁎ algorithm. Finally, manipulators execute the task by moving from one node to another with a simple path plan algorithm. The feasibility and effectiveness of the proposed task planning method are verified by simulation.


---

## Body

## 1. Introduction

With the continuous exploration of space, the on-orbit tasks like construction, maintenance, and service of spacecraft become more and more complex [1–3]. The space environment has the characteristics of high vacuum, intense radiation, and alternate change between high temperature and low temperature, so it is highly risky for the astronaut EVA (Extra-Vehicular Activity). However, in order to ensure the normal maintenance of equipment in capsule, astronaut change of on-orbit guard will also consume a lot of resources. So we can utilize space manipulator to assist or replace astronaut to execute all kinds of tasks. It can not only protect life security of astronaut, but improve the work efficiency and save operation cost.The on-orbit task has the characteristic of complex circumstance and various constraint and kinds, so it becomes development tendency that utilizes space manipulator to execute complex and precision tasks. In most cases, the space manipulator is in the circumstance which is small, complicated, and lacking in supplement, and energy supplement and maintenance cost a great deal, so it bears the constraint from itself and environment when it is running. On the other hand, because of the deficiency of onboard computer and reliability requirement of on-orbit control system, the space manipulator can carry some kind of fundamental path planning algorithm. In the face of flexible on-orbit tasks, the traditional path planning method for space manipulator cannot satisfy the complex requirement of on-orbit service task, even if the path planning method is with many optimal abilities. So it is necessary to introduce the task planning upon path planning of the manipulator, to make the manipulator get the capacity to analyze, disassemble, and plan complex tasks and the capacity of configuration and optimization of resources in task level. Task planning can make space manipulator not only deal with more complex and precision tasks, but macroscopically optimize and configure resources and can delay maturing of manipulator and maintain the reliability of space manipulator.Many researchers have studied task planning theory. Fikes and Nilsson [4] succeed in developing a robotic path planning system STRIPS based on resolution principle. This method is applied to Shakey robotic system, and it is widely adopted by researchers. Erol et al. [5–7] summarize the fundamentals and regulation of hierarchical task network (HTN) and give universal planning algorithm (UMCP).For robot task planning problems, scholars carry out the related research work. Kaelbling and Lozano-Pérez [8] give an integrated hierarchical task and movement planning strategy, and design a depth-first recursive algorithm which traverses planning tree. The algorithm realizes the complicated logic of moving objects and clearing obstacles. But this algorithm only analyzes the upper logic of tasks and does not take all kinds of constraint in implementation into account. Lozano-Pérez and Kaelbling [9] give a task and movement planning method based on symbol search. At first, the method searches the feasible sequence of upper operation and then transforms local planning into a geometrical constraint satisfaction problem. It solves the decision problems about grasping position, setting position, and moving path under geometrical constraint. But the geometric constraint solver adopted by the algorithm needs too much pretreatment time, so the planning efficiency will reduce. Barry et al. [10] transform multibehaved planning problem into multimode planning problem and solve it by hierarchical algorithm to get different grasping position of the same object. But the planning process does not take the optimization of the performance parameters of the robot into account, so it does not satisfy space application requirements. Aiming at underwater robot, Honghao et al. [11] puts forward a practical task process model based on Petri net; it can be used for task modeling and management. But this model only can be appropriate for the presupposed typical task. Robot lacks independent ability in complicated circumstance. Zong et al. [12] proposed hierarchical planning method of SimMan combination task based on key state. Hierarchical reinforcement learning is adopted to sampling in state space, and the state with the most frequency is chosen as the key state which is used to decompose the compound task. But the algorithm only gives the action sequence and does not plan the detail action reasonably. So it cannot be used in robotic control system. Singh et al. [13] design task planning algorithm for planet rover which is based on D
∗ algorithm. The algorithm is mainly used for obstacle avoidance and navigation of rover, and it introduces multimodule decision-making mechanism to decide next action of rover. But it does not take geometric constraints of robot body into account.For multiarm system, Kim et al. [14, 15] put forward that if we want to use dual-arm robot to bin something, the system must combine obstacles avoidance algorithm, precision control, and compliant control together in planning process, but the algorithm will be highly complex. Thus, they come up with assisting dual-arm robot task planning to reach its goals by demonstration of kinematics. The method has high efficiency and security, but it needs too much artificial assist, so the universality of automation is very poor. Charoenseang et al. [16] use sensors to build the virtual operation environment on the basis of providing visual feedback and force feedback to manipulator; then the task planning is executed to reach the goals. Compared to teaching method, this method makes task planning of dual-arm coordination intelligent. Kim et al. [17, 18] use rapidly expanding random tree to generate assembly path and repeating capture path. These paths compose the plan result of dual-arm robot assembly task. Analogously, Vahrenkamp et al. [19] utilize the gradient descent method to random sample in reachable workspace which is calculated in advance and then use feasible inverse arithmetic which consumes lowly to get the limited joint angle and get task path by iteration. The method does not need specific parameter configuration, so it can plan independently. Aiming at mobile dual-arm robot, Takahama et al. [20] utilize the method which adds the task points that satisfy the constraint conditions in the straight line trajectory of end to generate task trajectory. But it is lacking in the high-precision collision detection algorithm, so it is not up to the precision operation tasks.At present, the research at home and abroad related to motion planning of space manipulator mainly focuses on path planning algorithm and its optimization. Qi et al. [21] have studied obstacle avoidance path planning algorithm of space manipulator based on genetic algorithm. Chen et al. [22] put forward obstacle avoidance path planning algorithm of space manipulator based on C space. Yoo et al. [23] utilize laser and sonar sensor to finish obstacle avoidance task by adding specific points. The method does not use the information of joint angle, so the singular points are excluded, and it reduces the complexity of algorithm. The above-mentioned algorithms are all aimed at joint space planning; they cannot be used when there are strict requirements for the posture of end.Based on the characteristic of on-orbit operation of space multimanipulator system, this paper studied the task planning method in complex circumstance with multiconstraint. First, the paper comes up with a double-layer task planning framework, and it separates the planning into complex task decomposition and action detail planning. Second, three necessary elements of HTN—primitive work, plan domain, and plan algorithm—are specially designed for space manipulator; then complex task can be decomposed into primitive tasks sequence based on HTN. In order to ensure the feasibility of the primitive task, the paper proposes a highly efficient precision collision detection algorithm based on point cloud model. Third, taking various constraints and optimization into consideration,A
∗ algorithm is improved to plan task nodes for primitive task. In order to ensure the feasibility of the task, collision avoidance is given special attention. A highly efficient precision collision detection algorithm based on point cloud model is proposed, for its modeling approach is very simple and easy for spaceborne computer to use. Finally, the task planning method is verified by simulation.


## 2. General Idea

Manipulator control system is divided into three levels: task planning, path planning, and motion control. Task planning, as the top level of manipulator control system, is responsible for the receiving, analyzing, and resolving of tasks. It should be able to divide a task into a series of actions which can be planned and executed by manipulator directly. Due to the diversity of ways to execute a task, resources planning is also a part of task planning. Resources would be optimized in the process of the whole task, and planning result is given in the form of several task nodes and the resources allocation between two adjacent nodes.In this paper, the task planning for space manipulator is divided into two stages.(1)
Planner accepts the task target and divides complex task into simple tasks (primitive task) considering the ability of the manipulator. Logic feasibility of the task is ensured at the same time. Target task and initial state, as the input of planner, are the information including target location of objects and manipulators, the initial location of objects and manipulators, and whether the manipulator caught an object and which object the manipulator caught. We use HTN to do the dividing work. Although HTN is an existing method, it provides only ideas of decomposing complex task and how the method works, and no details about how a task is described mathematically. Those details usually depend on specific situation that HTN applies on. For manipulator, it is a problem to distinguish “move fromA toB” and “move fromC toD,” although they are all a type of MOVE task. The novelty of the HTN in this paper is
(a)
designing HTN plan domain for manipulator; in plan domain, some simple task (primitive task) that can be executed by manipulator directly is mathematically defined; so different tasks can be distinguished simply by their mask matrix (defined in Section3);
(b)
proposing a mathematical method for describing the task executing effect; with the help of this method, HTN reasoning can be processed by computer, and planning process can work automatically.
(2)
Each simple task is decomposed into several simple paths automatically using a heuristic search algorithm in order to ensure that the tasks can be performed. The input of the heuristic search algorithm is a primitive task which is output from HTN. Primitive task usually refers to moving from one position to another including initial configuration and target position of manipulator. Initial configuration and target position are the initial state and final state of a manipulator action and can be regarded as two points in its work space, while heuristic algorithm can elegantly solve the way-finding problem between two points. But, heuristic algorithm usually gives an irregular trajectory which is difficult for manipulator to execute. So, in this paper, an improved heuristic algorithm is proposed and is used to obtain a series of intermediate nodes (task node). Then, trajectories between any two adjacent nodes can be planned by an existing simple path plan algorithm for manipulator.It is worth noting that this task plan method can be applied to any manipulator theoretically, although it is particularly designed for space manipulator. When it is applied to a robot, a task can be assigned as “tighten the bolt.” Then, planner would decompose it into “move to spanner,” “grab (spanner),” “move to bolt,” and “tighten (bolt)” automatically. All those actions are part of predefined primitive tasks and can be executed by robot directly. However, there is usually no need to apply task planning to a manipulator which works on earth. On one hand, there is always a man nearby while the manipulator is working; the man who stands beside it could plan its task depending on the realities of situation and monitor any potential dangers on the manipulator. On the other hand, robot on earth (especially industrial robot) is always used to do very simple and repetitive works [24, 25]. It often works with a teach pendant or runs preprogrammed programs and has no need to do a task plan. However, space manipulator works in a harsh space environment. Space environment has the characteristics of difficult communication, lack of humans, and changing contents of task. So, it demands the autonomy of space manipulator, and task planning is necessary for space manipulator to do on-orbit servicing.Figure1 shows the double-layer framework for task planning.Figure 1
Framework of space manipulator task planning.


## 3. Mission Profile Analysis Based on Hierarchical Task Network

### 3.1. Hierarchical Task Network and General Planning Algorithm

Hierarchical task network planning uses the idea of task decomposition which divides complex nonprimitive tasks into executable primitive tasks step by step. HTN abstracts the goal state of task into goal task, a layered structure of the task will be formed from complex to simple, and a primitive task which is indissoluble will be placed into the lowest level. HTN’s programming domain consists of a list of operators of primitive tasks and a list of operators of compound tasks; when the goal task and the current state of environment are given, the feasible basic motion sequence will be calculated by the planner with the use of method of simplifying the task in planning domain.There are three types of tasks in HTN [6]:(1)
Goal tasks, like goals in STRIPS, are properties we wish to make true in the world.
(2)
Primitive tasks are tasks we can directly achieve by executing the corresponding action.
(3)
Compound tasks denote desired changes that involve several goal tasks and primitive tasks.Goal tasks and compound tasks are called nonprimitive tasks.A primitive task, a goal task, and a compound task are syntactic construct of the formd
o
(
f
(
x
1
,
…
,
x
k
)
), f
∈
F; a
c
h
i
e
v
e
(
l
), where l is a literal; p
e
r
f
o
r
m
[
t
(
x
1
,
…
,
x
k
)
]
⁡, t
∈
T, where x
1
,
…
,
x
k are task parameters.Tasks are connected together via the use of task networks; task network is a combination of tasks and task constraints; the form is as follows:(1)
n
1
:
α
1
,
…
,
n
m
:
α
m
,
ϕ
,where α
i is a task with the label of n
i and ϕ is a boolean formula constructed from variable binding constraints such as v
=
v
′ and v
=
c, temporal ordering constraints such as n
≺
n
′, and truth constraints such as (
n
,
l
), (
l
,
n
), and (
n
,
l
,
n
′
), where n
,
n
′
∈
N, v
,
v
′
∈
V, l is a literal, and c
∈
C. n
≺
n
′ means that the task labeled with n must precede the one labeled with n
′; (
n
,
l
), (
l
,
n
), and (
n
,
l
,
n
′
) mean that l must be true immediately after n, immediately before n, and between n and n
′, respectively.A planning domainD is a pair [7](2)
D
=
O
p
,
M
e
,where O
p is a set of operators (one for each primitive task) and M
e is a set of methods.An operator tells the effect of a primitive task and is a syntactic construct of the form(3)
O
p
≔
f
v
1
,
…
,
v
k
,
q
1
,
…
,
q
n
,
l
1
,
…
,
l
m
,where f is a primitive task symbol, v
i is a variable of f, q
i denote the preconditions that must be satisfied before executing primitive task f, and l
i denote the primitive task’s effects (also called postconditions).A primary task can be completed by performing the corresponding action. A nonprimary task is completed by telling the planner how to accomplish it using a method. A method is a construct of the form(4)
M
e
≔
α
,
d
,where α is a nonprimitive task and d is a task network. It says that one way to achieveαis to perform the tasks specified in the network d.A planning problem is a triple.(5)
P
=
d
,
I
,
D
,where, D is a planning domain, I is the initial state, and d is the task network.A plan strategy which could be used in any field is proposed in [7]. Planning process starts from task network d and performs the following steps repeatedly until nonprimitive task no longer exists:(1)
Find a nonprimitive task ind and find a method m
=
(
t
,
d
′
) in M, wherein t and u are consistent.
(2)
Simplifyu to generate a new d; namely, use the task in d
′ to replace u, and merge constraints of d and d
′.
(3)
Once there is no nonprimitive task ind, find an instance σ that could satisfy all constraints. σ is a successful planning result of the primitive task.In a given task network, the interaction between tasks is inevitable, some of which are beneficial, while others are harmful. For example, the result of a task will destroy the precondition of another task, or results and preconditions of the two tasks will conflict with each other. There is no general method to deal with conflicts; conflicts are resolved by adding a new task in task network in this paper.


### 3.2. Task Profile Analysis of Space Manipulator

Although a universal task planning program was given by HTN, all components of the planner should be designed for the specific application of space manipulator, for HTN’s operation is too abstract. A method for characterizing the state of scene in which space manipulator works is proposed in this section. Meanwhile, comparative method and state transfer operation for scene states are also given. Then, primitive task set and its operator for space manipulator are defined in this section. Task profile analysis for space manipulator based on HTN is realized by using these instancing planning elements.


#### 3.2.1. Characterization of Scene State

The size of objects is not considered during task profile analysis. Only the logical relations between objects which are operated by manipulator are analyzed. So, the objects in the scene are abstracted into some operation interface vectors. When the end position of space manipulator is consistent with object interface vector, the object could be operated and the movement of the object would be abstracted into the change of interface vector. Suppose there arek objects and a manipulator in the scene; then the state of scene is indicated by S:(6)
S
=
s
0
s
1
⋯
s
k
=
Θ
0
Θ
1
⋯
Θ
k
g
0
g
1
⋯
g
k
=
x
0
x
1
⋯
x
k
y
0
y
1
⋯
y
k
z
0
z
1
⋯
z
k
α
0
α
1
⋯
α
k
β
0
β
1
⋯
β
k
γ
0
γ
1
⋯
γ
k
g
0
g
1
⋯
g
k
,where s
0 represents the end effector of manipulator, s
1
~
s
k represent objects, and Θ
=
x
y
z
α
β
γ
T is a coordinate. For manipulator, Θ indicates the coordinate of end position; for the object in the environment, it indicates operation interface vector which is usually defined on capture position of the object; g indicates whether the manipulator carries an object or not, and g
=
g
0
g
1
⋯
g
k only have two values:(a)
g
=
0: there is no-load on the manipulator;
(b)
g
0
=
1: there is only one item g
i
=
1 among g
1
~
g
k; other items are all zero; it is used to indicate that theith object is being caught by manipulator.State mask is defined in order to help the calculation between state matrixes.(7)
M
=
m
11
m
12
⋯
m
1
k
m
21
m
22
⋯
m
2
k
m
31
m
32
⋯
m
3
k
m
41
m
42
⋯
m
4
k
m
51
m
52
⋯
m
5
k
m
61
m
62
⋯
m
6
k
m
71
m
72
⋯
m
7
k
,where m
i
j
∈
0,1.(
1) Judging Whether State Satisfies a Condition. It is necessary to check whether the current state of scene satisfies the precondition (postcondition) of a task before (after) executing the task. Only specific several objects and their properties are concerned during the checking of state, and others are not taken into consideration. Suppose S is the current state of the scene. State S
′ and mask M describe the condition that needs to be satisfied by S. If the following equation is set up:(8)
S
′
&
M
=
S
&
M
,then the current state of scene satisfies the condition described byS
′ and M. Mask M is on both sides of the formula which are consistent with each other.Operator& is an AND operation for matrix: if elements in M are 0, then the elements on the corresponding position of S are set to 0; if elements in M are 1, then the corresponding elements of S do not change.(
2) State Transfer. When an operator has an effect on the scene, the current scene will make the following change:(9)
S
n
e
w
=
S
o
l
d
&
M
-
+
S
′
&
M
,where S
n
e
w is the scene state after conversion, S
o
l
d is the scene state before conversion, M is mask that indicates operator’s effect, M
- is the inverse of M, and S
′ is the state matrix that indicates the effect of the operator.


#### 3.2.2. Typical Primitive Tasks and Their Operators

Having taken the characteristics of various kinds of space manipulator in-orbit missions into consideration, three basic primitive tasks are defined to constitute the primitive task set: move, capture, and release. Complex tasks can be formed by these primitive tasks. Their corresponding operators contain both the precondition and postcondition of the task.(
1) MOVE. m
o
v
e
(
v
) indicates that the end of the manipulator moves from the current position w to a target position v. Only the position of the manipulator in the state matrix is changed by MOVE tasks, as well as the location of the object caught by manipulator.Precondition:(10)
S
′
=
w
⋯
w
⋯
x
⋯
x
⋯
,
M
=
x
⋯
x
⋯
x
⋯
x
⋯
.Postcondition:(11)
S
′
=
v
⋯
v
⋯
x
⋯
x
⋯
,
M
=
1
⋯
x
⋯
0
⋯
0
⋯
,where, x
∈
{
0,1
}.Since unloaded and loaded manipulator both could execute MOVE task, the explicit form of the operator of the MOVE task is determined by the elementx in the first column of the last line of the initial state matrix of the manipulator.(
2) CAPTURE.
c
a
p
t
u
r
e
(
u
) indicates that theuth object in the environment is captured by manipulator. The position of the object is v
u. The end of manipulator and the object should be at the same position before capturing.Precondition:(12)
S
′
=
v
u
⋯
v
u
⋯
0
⋯
0
⋯
,
M
=
1
⋯
1
u
⋯
1
⋯
1
u
⋯
.Postcondition:(13)
S
′
=
v
u
⋯
v
u
⋯
1
⋯
1
⋯
,
M
=
0
⋯
0
u
⋯
1
⋯
1
u
⋯
.(
3) RELEASE.
r
e
l
e
a
s
e
(
u
) indicates that theuth object in the environment is released by manipulator. The position of the end of the manipulator is v
u. The object should have been caught by manipulator before releasing.Precondition:(14)
S
′
=
v
u
⋯
v
u
⋯
1
⋯
1
⋯
,
M
=
1
⋯
1
u
⋯
1
⋯
1
u
⋯
.Postcondition:(15)
S
′
=
v
u
⋯
v
u
⋯
0
⋯
0
⋯
,
M
=
0
⋯
0
u
⋯
1
⋯
1
u
⋯
.For a multiarm system which consists ofm manipulators, the manipulator is represented by the first m columns of the state matrix and its mask, and the object in the environment is represented by remaining columns.


#### 3.2.3. Simplification of Space Manipulator Network Task

Hierarchical task network for space manipulator is established by using the primitive tasks and operators defined above according to HTN theory. The core of HTN planning algorithm is simplifying task and resolving conflicts between tasks. Since the manipulator executes tasks serially, its task planning proceeds sequentially. A strategy that simplifies the tasks and deals with conflicts sequentially is proposed in this paper. The structure of hierarchical network of the planning problem is shown in Figure2.Figure 2
Structure of hierarchical network for task profile analysis.The following steps give an explicit procedure of task profile analysis for space manipulator, and its flow diagram is shown in Figure3.Figure 3
Simplification process of space manipulator network task.Step 1.
Extract task from the task network orderly.Step 2.
If current task is a nonprimitive task, find a correspondingM
e in planning domain and replace this nonprimitive task. In order to find an appropriate method, the mask of current task is compared with the masks of all tasks in the method set; if the item which has a 1 in the mask of current task also has a 1 in the mask of method, then this method could be used to simplify this task. Go to Step 1.Step 3.
Compare the current state and the completion state of this task, if current state satisfies the effect of the task, then this task does not need to be executed and is deleted from the task network.Step 4.
If the current state satisfies preconditions of this task, then update the current state by using the operator of this task. Go to Step 1.Step 5.
If the current state does not satisfy the preconditions of this task, then find a task that could satisfy the preconditions in planning domain and add this new task in front of the current task.Step 6.
If the preconditions of the current task could not be satisfied, then return to planning failure.When the planner starts work, its plan domain is predefined for space manipulator by using the method in Sections3.2.1 and 3.2.2. Then, the decomposition process follows the steps given in Figure 2. For example, primitive tasks are defined according to Section 3.2.2, and goal task is to move an objectU from pointA to pointB. Then planner would decompose the task into a primitive task sequence of “MOVE toA - CAPTUREU - MOVE toB - RELEASEU.” Section 5 shows the example of the decomposition process in detail.


## 3.1. Hierarchical Task Network and General Planning Algorithm

Hierarchical task network planning uses the idea of task decomposition which divides complex nonprimitive tasks into executable primitive tasks step by step. HTN abstracts the goal state of task into goal task, a layered structure of the task will be formed from complex to simple, and a primitive task which is indissoluble will be placed into the lowest level. HTN’s programming domain consists of a list of operators of primitive tasks and a list of operators of compound tasks; when the goal task and the current state of environment are given, the feasible basic motion sequence will be calculated by the planner with the use of method of simplifying the task in planning domain.There are three types of tasks in HTN [6]:(1)
Goal tasks, like goals in STRIPS, are properties we wish to make true in the world.
(2)
Primitive tasks are tasks we can directly achieve by executing the corresponding action.
(3)
Compound tasks denote desired changes that involve several goal tasks and primitive tasks.Goal tasks and compound tasks are called nonprimitive tasks.A primitive task, a goal task, and a compound task are syntactic construct of the formd
o
(
f
(
x
1
,
…
,
x
k
)
), f
∈
F; a
c
h
i
e
v
e
(
l
), where l is a literal; p
e
r
f
o
r
m
[
t
(
x
1
,
…
,
x
k
)
]
⁡, t
∈
T, where x
1
,
…
,
x
k are task parameters.Tasks are connected together via the use of task networks; task network is a combination of tasks and task constraints; the form is as follows:(1)
n
1
:
α
1
,
…
,
n
m
:
α
m
,
ϕ
,where α
i is a task with the label of n
i and ϕ is a boolean formula constructed from variable binding constraints such as v
=
v
′ and v
=
c, temporal ordering constraints such as n
≺
n
′, and truth constraints such as (
n
,
l
), (
l
,
n
), and (
n
,
l
,
n
′
), where n
,
n
′
∈
N, v
,
v
′
∈
V, l is a literal, and c
∈
C. n
≺
n
′ means that the task labeled with n must precede the one labeled with n
′; (
n
,
l
), (
l
,
n
), and (
n
,
l
,
n
′
) mean that l must be true immediately after n, immediately before n, and between n and n
′, respectively.A planning domainD is a pair [7](2)
D
=
O
p
,
M
e
,where O
p is a set of operators (one for each primitive task) and M
e is a set of methods.An operator tells the effect of a primitive task and is a syntactic construct of the form(3)
O
p
≔
f
v
1
,
…
,
v
k
,
q
1
,
…
,
q
n
,
l
1
,
…
,
l
m
,where f is a primitive task symbol, v
i is a variable of f, q
i denote the preconditions that must be satisfied before executing primitive task f, and l
i denote the primitive task’s effects (also called postconditions).A primary task can be completed by performing the corresponding action. A nonprimary task is completed by telling the planner how to accomplish it using a method. A method is a construct of the form(4)
M
e
≔
α
,
d
,where α is a nonprimitive task and d is a task network. It says that one way to achieveαis to perform the tasks specified in the network d.A planning problem is a triple.(5)
P
=
d
,
I
,
D
,where, D is a planning domain, I is the initial state, and d is the task network.A plan strategy which could be used in any field is proposed in [7]. Planning process starts from task network d and performs the following steps repeatedly until nonprimitive task no longer exists:(1)
Find a nonprimitive task ind and find a method m
=
(
t
,
d
′
) in M, wherein t and u are consistent.
(2)
Simplifyu to generate a new d; namely, use the task in d
′ to replace u, and merge constraints of d and d
′.
(3)
Once there is no nonprimitive task ind, find an instance σ that could satisfy all constraints. σ is a successful planning result of the primitive task.In a given task network, the interaction between tasks is inevitable, some of which are beneficial, while others are harmful. For example, the result of a task will destroy the precondition of another task, or results and preconditions of the two tasks will conflict with each other. There is no general method to deal with conflicts; conflicts are resolved by adding a new task in task network in this paper.


## 3.2. Task Profile Analysis of Space Manipulator

Although a universal task planning program was given by HTN, all components of the planner should be designed for the specific application of space manipulator, for HTN’s operation is too abstract. A method for characterizing the state of scene in which space manipulator works is proposed in this section. Meanwhile, comparative method and state transfer operation for scene states are also given. Then, primitive task set and its operator for space manipulator are defined in this section. Task profile analysis for space manipulator based on HTN is realized by using these instancing planning elements.


### 3.2.1. Characterization of Scene State

The size of objects is not considered during task profile analysis. Only the logical relations between objects which are operated by manipulator are analyzed. So, the objects in the scene are abstracted into some operation interface vectors. When the end position of space manipulator is consistent with object interface vector, the object could be operated and the movement of the object would be abstracted into the change of interface vector. Suppose there arek objects and a manipulator in the scene; then the state of scene is indicated by S:(6)
S
=
s
0
s
1
⋯
s
k
=
Θ
0
Θ
1
⋯
Θ
k
g
0
g
1
⋯
g
k
=
x
0
x
1
⋯
x
k
y
0
y
1
⋯
y
k
z
0
z
1
⋯
z
k
α
0
α
1
⋯
α
k
β
0
β
1
⋯
β
k
γ
0
γ
1
⋯
γ
k
g
0
g
1
⋯
g
k
,where s
0 represents the end effector of manipulator, s
1
~
s
k represent objects, and Θ
=
x
y
z
α
β
γ
T is a coordinate. For manipulator, Θ indicates the coordinate of end position; for the object in the environment, it indicates operation interface vector which is usually defined on capture position of the object; g indicates whether the manipulator carries an object or not, and g
=
g
0
g
1
⋯
g
k only have two values:(a)
g
=
0: there is no-load on the manipulator;
(b)
g
0
=
1: there is only one item g
i
=
1 among g
1
~
g
k; other items are all zero; it is used to indicate that theith object is being caught by manipulator.State mask is defined in order to help the calculation between state matrixes.(7)
M
=
m
11
m
12
⋯
m
1
k
m
21
m
22
⋯
m
2
k
m
31
m
32
⋯
m
3
k
m
41
m
42
⋯
m
4
k
m
51
m
52
⋯
m
5
k
m
61
m
62
⋯
m
6
k
m
71
m
72
⋯
m
7
k
,where m
i
j
∈
0,1.(
1) Judging Whether State Satisfies a Condition. It is necessary to check whether the current state of scene satisfies the precondition (postcondition) of a task before (after) executing the task. Only specific several objects and their properties are concerned during the checking of state, and others are not taken into consideration. Suppose S is the current state of the scene. State S
′ and mask M describe the condition that needs to be satisfied by S. If the following equation is set up:(8)
S
′
&
M
=
S
&
M
,then the current state of scene satisfies the condition described byS
′ and M. Mask M is on both sides of the formula which are consistent with each other.Operator& is an AND operation for matrix: if elements in M are 0, then the elements on the corresponding position of S are set to 0; if elements in M are 1, then the corresponding elements of S do not change.(
2) State Transfer. When an operator has an effect on the scene, the current scene will make the following change:(9)
S
n
e
w
=
S
o
l
d
&
M
-
+
S
′
&
M
,where S
n
e
w is the scene state after conversion, S
o
l
d is the scene state before conversion, M is mask that indicates operator’s effect, M
- is the inverse of M, and S
′ is the state matrix that indicates the effect of the operator.


### 3.2.2. Typical Primitive Tasks and Their Operators

Having taken the characteristics of various kinds of space manipulator in-orbit missions into consideration, three basic primitive tasks are defined to constitute the primitive task set: move, capture, and release. Complex tasks can be formed by these primitive tasks. Their corresponding operators contain both the precondition and postcondition of the task.(
1) MOVE. m
o
v
e
(
v
) indicates that the end of the manipulator moves from the current position w to a target position v. Only the position of the manipulator in the state matrix is changed by MOVE tasks, as well as the location of the object caught by manipulator.Precondition:(10)
S
′
=
w
⋯
w
⋯
x
⋯
x
⋯
,
M
=
x
⋯
x
⋯
x
⋯
x
⋯
.Postcondition:(11)
S
′
=
v
⋯
v
⋯
x
⋯
x
⋯
,
M
=
1
⋯
x
⋯
0
⋯
0
⋯
,where, x
∈
{
0,1
}.Since unloaded and loaded manipulator both could execute MOVE task, the explicit form of the operator of the MOVE task is determined by the elementx in the first column of the last line of the initial state matrix of the manipulator.(
2) CAPTURE.
c
a
p
t
u
r
e
(
u
) indicates that theuth object in the environment is captured by manipulator. The position of the object is v
u. The end of manipulator and the object should be at the same position before capturing.Precondition:(12)
S
′
=
v
u
⋯
v
u
⋯
0
⋯
0
⋯
,
M
=
1
⋯
1
u
⋯
1
⋯
1
u
⋯
.Postcondition:(13)
S
′
=
v
u
⋯
v
u
⋯
1
⋯
1
⋯
,
M
=
0
⋯
0
u
⋯
1
⋯
1
u
⋯
.(
3) RELEASE.
r
e
l
e
a
s
e
(
u
) indicates that theuth object in the environment is released by manipulator. The position of the end of the manipulator is v
u. The object should have been caught by manipulator before releasing.Precondition:(14)
S
′
=
v
u
⋯
v
u
⋯
1
⋯
1
⋯
,
M
=
1
⋯
1
u
⋯
1
⋯
1
u
⋯
.Postcondition:(15)
S
′
=
v
u
⋯
v
u
⋯
0
⋯
0
⋯
,
M
=
0
⋯
0
u
⋯
1
⋯
1
u
⋯
.For a multiarm system which consists ofm manipulators, the manipulator is represented by the first m columns of the state matrix and its mask, and the object in the environment is represented by remaining columns.


### 3.2.3. Simplification of Space Manipulator Network Task

Hierarchical task network for space manipulator is established by using the primitive tasks and operators defined above according to HTN theory. The core of HTN planning algorithm is simplifying task and resolving conflicts between tasks. Since the manipulator executes tasks serially, its task planning proceeds sequentially. A strategy that simplifies the tasks and deals with conflicts sequentially is proposed in this paper. The structure of hierarchical network of the planning problem is shown in Figure2.Figure 2
Structure of hierarchical network for task profile analysis.The following steps give an explicit procedure of task profile analysis for space manipulator, and its flow diagram is shown in Figure3.Figure 3
Simplification process of space manipulator network task.Step 1.
Extract task from the task network orderly.Step 2.
If current task is a nonprimitive task, find a correspondingM
e in planning domain and replace this nonprimitive task. In order to find an appropriate method, the mask of current task is compared with the masks of all tasks in the method set; if the item which has a 1 in the mask of current task also has a 1 in the mask of method, then this method could be used to simplify this task. Go to Step 1.Step 3.
Compare the current state and the completion state of this task, if current state satisfies the effect of the task, then this task does not need to be executed and is deleted from the task network.Step 4.
If the current state satisfies preconditions of this task, then update the current state by using the operator of this task. Go to Step 1.Step 5.
If the current state does not satisfy the preconditions of this task, then find a task that could satisfy the preconditions in planning domain and add this new task in front of the current task.Step 6.
If the preconditions of the current task could not be satisfied, then return to planning failure.When the planner starts work, its plan domain is predefined for space manipulator by using the method in Sections3.2.1 and 3.2.2. Then, the decomposition process follows the steps given in Figure 2. For example, primitive tasks are defined according to Section 3.2.2, and goal task is to move an objectU from pointA to pointB. Then planner would decompose the task into a primitive task sequence of “MOVE toA - CAPTUREU - MOVE toB - RELEASEU.” Section 5 shows the example of the decomposition process in detail.


## 3.2.1. Characterization of Scene State

The size of objects is not considered during task profile analysis. Only the logical relations between objects which are operated by manipulator are analyzed. So, the objects in the scene are abstracted into some operation interface vectors. When the end position of space manipulator is consistent with object interface vector, the object could be operated and the movement of the object would be abstracted into the change of interface vector. Suppose there arek objects and a manipulator in the scene; then the state of scene is indicated by S:(6)
S
=
s
0
s
1
⋯
s
k
=
Θ
0
Θ
1
⋯
Θ
k
g
0
g
1
⋯
g
k
=
x
0
x
1
⋯
x
k
y
0
y
1
⋯
y
k
z
0
z
1
⋯
z
k
α
0
α
1
⋯
α
k
β
0
β
1
⋯
β
k
γ
0
γ
1
⋯
γ
k
g
0
g
1
⋯
g
k
,where s
0 represents the end effector of manipulator, s
1
~
s
k represent objects, and Θ
=
x
y
z
α
β
γ
T is a coordinate. For manipulator, Θ indicates the coordinate of end position; for the object in the environment, it indicates operation interface vector which is usually defined on capture position of the object; g indicates whether the manipulator carries an object or not, and g
=
g
0
g
1
⋯
g
k only have two values:(a)
g
=
0: there is no-load on the manipulator;
(b)
g
0
=
1: there is only one item g
i
=
1 among g
1
~
g
k; other items are all zero; it is used to indicate that theith object is being caught by manipulator.State mask is defined in order to help the calculation between state matrixes.(7)
M
=
m
11
m
12
⋯
m
1
k
m
21
m
22
⋯
m
2
k
m
31
m
32
⋯
m
3
k
m
41
m
42
⋯
m
4
k
m
51
m
52
⋯
m
5
k
m
61
m
62
⋯
m
6
k
m
71
m
72
⋯
m
7
k
,where m
i
j
∈
0,1.(
1) Judging Whether State Satisfies a Condition. It is necessary to check whether the current state of scene satisfies the precondition (postcondition) of a task before (after) executing the task. Only specific several objects and their properties are concerned during the checking of state, and others are not taken into consideration. Suppose S is the current state of the scene. State S
′ and mask M describe the condition that needs to be satisfied by S. If the following equation is set up:(8)
S
′
&
M
=
S
&
M
,then the current state of scene satisfies the condition described byS
′ and M. Mask M is on both sides of the formula which are consistent with each other.Operator& is an AND operation for matrix: if elements in M are 0, then the elements on the corresponding position of S are set to 0; if elements in M are 1, then the corresponding elements of S do not change.(
2) State Transfer. When an operator has an effect on the scene, the current scene will make the following change:(9)
S
n
e
w
=
S
o
l
d
&
M
-
+
S
′
&
M
,where S
n
e
w is the scene state after conversion, S
o
l
d is the scene state before conversion, M is mask that indicates operator’s effect, M
- is the inverse of M, and S
′ is the state matrix that indicates the effect of the operator.


## 3.2.2. Typical Primitive Tasks and Their Operators

Having taken the characteristics of various kinds of space manipulator in-orbit missions into consideration, three basic primitive tasks are defined to constitute the primitive task set: move, capture, and release. Complex tasks can be formed by these primitive tasks. Their corresponding operators contain both the precondition and postcondition of the task.(
1) MOVE. m
o
v
e
(
v
) indicates that the end of the manipulator moves from the current position w to a target position v. Only the position of the manipulator in the state matrix is changed by MOVE tasks, as well as the location of the object caught by manipulator.Precondition:(10)
S
′
=
w
⋯
w
⋯
x
⋯
x
⋯
,
M
=
x
⋯
x
⋯
x
⋯
x
⋯
.Postcondition:(11)
S
′
=
v
⋯
v
⋯
x
⋯
x
⋯
,
M
=
1
⋯
x
⋯
0
⋯
0
⋯
,where, x
∈
{
0,1
}.Since unloaded and loaded manipulator both could execute MOVE task, the explicit form of the operator of the MOVE task is determined by the elementx in the first column of the last line of the initial state matrix of the manipulator.(
2) CAPTURE.
c
a
p
t
u
r
e
(
u
) indicates that theuth object in the environment is captured by manipulator. The position of the object is v
u. The end of manipulator and the object should be at the same position before capturing.Precondition:(12)
S
′
=
v
u
⋯
v
u
⋯
0
⋯
0
⋯
,
M
=
1
⋯
1
u
⋯
1
⋯
1
u
⋯
.Postcondition:(13)
S
′
=
v
u
⋯
v
u
⋯
1
⋯
1
⋯
,
M
=
0
⋯
0
u
⋯
1
⋯
1
u
⋯
.(
3) RELEASE.
r
e
l
e
a
s
e
(
u
) indicates that theuth object in the environment is released by manipulator. The position of the end of the manipulator is v
u. The object should have been caught by manipulator before releasing.Precondition:(14)
S
′
=
v
u
⋯
v
u
⋯
1
⋯
1
⋯
,
M
=
1
⋯
1
u
⋯
1
⋯
1
u
⋯
.Postcondition:(15)
S
′
=
v
u
⋯
v
u
⋯
0
⋯
0
⋯
,
M
=
0
⋯
0
u
⋯
1
⋯
1
u
⋯
.For a multiarm system which consists ofm manipulators, the manipulator is represented by the first m columns of the state matrix and its mask, and the object in the environment is represented by remaining columns.


## 3.2.3. Simplification of Space Manipulator Network Task

Hierarchical task network for space manipulator is established by using the primitive tasks and operators defined above according to HTN theory. The core of HTN planning algorithm is simplifying task and resolving conflicts between tasks. Since the manipulator executes tasks serially, its task planning proceeds sequentially. A strategy that simplifies the tasks and deals with conflicts sequentially is proposed in this paper. The structure of hierarchical network of the planning problem is shown in Figure2.Figure 2
Structure of hierarchical network for task profile analysis.The following steps give an explicit procedure of task profile analysis for space manipulator, and its flow diagram is shown in Figure3.Figure 3
Simplification process of space manipulator network task.Step 1.
Extract task from the task network orderly.Step 2.
If current task is a nonprimitive task, find a correspondingM
e in planning domain and replace this nonprimitive task. In order to find an appropriate method, the mask of current task is compared with the masks of all tasks in the method set; if the item which has a 1 in the mask of current task also has a 1 in the mask of method, then this method could be used to simplify this task. Go to Step 1.Step 3.
Compare the current state and the completion state of this task, if current state satisfies the effect of the task, then this task does not need to be executed and is deleted from the task network.Step 4.
If the current state satisfies preconditions of this task, then update the current state by using the operator of this task. Go to Step 1.Step 5.
If the current state does not satisfy the preconditions of this task, then find a task that could satisfy the preconditions in planning domain and add this new task in front of the current task.Step 6.
If the preconditions of the current task could not be satisfied, then return to planning failure.When the planner starts work, its plan domain is predefined for space manipulator by using the method in Sections3.2.1 and 3.2.2. Then, the decomposition process follows the steps given in Figure 2. For example, primitive tasks are defined according to Section 3.2.2, and goal task is to move an objectU from pointA to pointB. Then planner would decompose the task into a primitive task sequence of “MOVE toA - CAPTUREU - MOVE toB - RELEASEU.” Section 5 shows the example of the decomposition process in detail.


## 4. Task Node Planning Based on the Improved A∗ Algorithm

The instantiated HTN planning can be directly applied in many fields, such as logistics transportation and disaster treatment. These benefit from the autonomous capability of the persons who execute the bottom layer of task network. However, the primitive tasks which are planned by HTN could not always be executed by the kind of executor like manipulator which has no autonomous capability. Thus, the task planner of manipulator needs to decompose the primitive task into several path sections which are determined by task nodes and can be planned by a typical trajectory planning algorithm. Then, the manipulator completes the primitive task by using the combination of some simple trajectories which connect the adjacent task nodes.


### 4.1. Manipulator Collision Detection Based on Point Cloud Model

Task profile analysis makes the task transform from complex to simple, but it is difficult for a primitive task to obtain feasible trajectory by using traditional path planning algorithm because of various constraints. Obstacle avoidance is the only necessary constraint for all tasks; thus it should be payed special attention. In order to satisfy the requirements of precise operation in space, a new high-precision collision detection algorithm for manipulator is proposed in this paper. Then, the task node planning method is achieved based on the collision detection.


#### 4.1.1. Point Cloud Model of Scene

In order to detect the collision between different parts of the manipulator accurately, a mathematical method that can describe the shape of the whole manipulator and the environment is needed. Basic geometry envelope is widely used in the shape modeling of manipulator collision detection at present. However, it is obvious that if the surface of the object is not regular enough, the basic geometry envelope will cause the model distortion. This will lead to the loss of part of the manipulator’s workspace, and will result in the failure of many delicate tasks due to the imprecise collision detection. In addition, this method requires a lot of work of envelope of models, analyzing the shape of model artificially and selecting the approximate geometry. It is entirely unrealistic in space application. In this paper, a method of collision detection for manipulator based on point cloud modeling is proposed. In this method, dense scattered points are used to model for irregular object, then the AABB (Axis Aligned Bounding Box) algorithm is used to achieve the manipulator collision detection.Point cloud model is defined as dense scattered points which distribute on the surface of the object. All the points in the model are defined in the coordinate system of the object itself. When the object is moving, the rotation matrix of the object can be used to transfer every point of the point cloud model into the inertial coordinate system.After scanning all the objects in the scene by using Intersect Visitor tool of OSG (OpenSceneGraph), the point cloud model of the whole sceneM
=
M
1
,
M
2
,
…
,
M
N is obtained; example is shown as in Figure 4, where M
i
∈
R
n
i
×
3 is theith model’s point cloud matrix. M
i is composed of n
i 3-dimensional row vectors, which represent the n
i points on the surface ofith object.Figure 4
Example of point cloud model of object.


#### 4.1.2. Build Model’s AABB Tree

After obtaining the scene point cloud model, the collision detection of the scene can be done by testing all intersections betweenM
i and M
j
(
i
≠
j
). Intersection test between M
i and M
j
(
i
≠
j
) is operated as follows: all points in the M
i and M
j are converted to the same coordinate system (inertial system, e.g.), and whether distance between a pair of points m
i
,
u and m
j
,
v is less than a preset safety threshold β is determined, where points m
i
,
u and m
j
,
v separately belong to M
i and M
j. If a pair of points m
i
,
u and m
j
,
v can be found in the scene, then theith model and thejth model in the scene collide with each other. Besides, it is considered that the collision point exists in the middle of the connecting line between m
i
,
u and m
j
,
v, because the value of β is very small.Traversing all of the points between two point clouds is the simplest intersection test method, but it will consume large amount of computing resources. In this paper, the points of point cloud model are organized with clusters. AABBs of clusters are used to build AABB tree, and then AABB algorithm is used to detect the collision between any objects in the scene. A cluster is defined as a set of points which are near to each other in the point cloud model. The entire points of a cloud model areC
r
o
o
t which is called the root of cluster. Each cluster is divided into left and right child clusters C
l and C
r recursively from the root cluster until only one point is contained in a cluster. By following the steps above, the point cloud of a model can be organized with a binary tree which is shown in Figure 5.Figure 5
Binary tree of model point cloud.The method of cluster division affects the executing efficiency of the collision detection. In this paper, a cluster is divided into two child clusters according to the principle of dividing from the middle of the longest axis of the model, so that the center of the two child clusters could be far away; thereby the unintersected clusters can be quickly eliminated. In order to determine the longest axis of the model, the maximum and minimum points onX
,
Y
,
Z directions are obtained by traversing the model points.(16)
P
X
m
a
x
x
X
m
a
x
,
y
X
m
a
x
,
z
X
m
a
x
,
P
X
m
i
n
x
X
m
i
n
,
y
X
m
i
n
,
z
X
m
i
n
,
P
Y
m
a
x
x
Y
m
a
x
,
y
Y
m
a
x
,
z
Y
m
a
x
,
P
Y
m
i
n
x
Y
m
i
n
,
y
Y
m
i
n
,
z
Y
m
i
n
,
P
Z
m
a
x
x
Z
m
a
x
,
y
Z
m
a
x
,
z
Z
m
a
x
,
P
Z
m
i
n
x
Z
m
i
n
,
y
Z
m
i
n
,
z
Z
m
i
n
.Three axial dimensional sizes of the model can be calculated:(17)
A
X
=
x
X
m
a
x
-
x
X
m
i
n
,
A
Y
=
y
Y
m
a
x
-
y
Y
m
i
n
,
A
Z
=
z
Z
m
a
x
-
z
Z
m
i
n
.Then, the model’s longest axisW and its length A
W are obtained.(18)
A
W
=
max
⁡
A
X
,
A
Y
,
A
Z
,where W is one of X
,
Y
,
Z.AABB of the model is divided into two parts along the perpendicular bisection plane of axisW; the points belong to one of the two parts of point cloud model forming a new child cluster. A more intuitive way to express the segmentation method is that the vertical plane is made to the W axis at midpoint of P
W
m
a
x and P
W
m
i
n; each side belongs to a new child cluster. Figure 5 shows an example for a two-dimensional point cloud model which split into binary trees. The red line represents the longest axis of the point cloud cluster W. The blue line shows the line by which the points in the cluster are divided into two child clusters. The blue line would be a plane in 3D point cloud. The partition criterion for the left and right child clusters of model is as follows:(19)
C
l
:
P
x
,
y
,
z
∣
w
∈
x
,
y
,
z
,
w
<
w
W
m
a
x
+
w
W
m
i
n
2
,
C
r
:
P
x
,
y
,
z
∣
w
∈
x
,
y
,
z
,
w
>
w
W
m
a
x
+
w
W
m
i
n
2
,where w which is determined by (18) is the longest axis of the model.All nodes of the point cloud binary trees are enveloped with AABB, and then the AABB tree of the model is obtained.


#### 4.1.3. Intersection Test for AABB Trees

AABB binary trees are constructed for every rigid body of manipulator and environment obstacle, and trees which belong to manipulator or environment join together into an AABB forest. Thus, the scene modelM is divided into two subsets: manipulator model R and environmental obstacle E.(20)
R
∪
E
=
M
,
R
∩
E
=
⌀
.Collision detection between forests can be achieved by traversing the AABB trees which are from the two respective forests. Collision detection between every two AABB trees is achieved by examining nodes from the root node to the leave node between two trees. If there are two nodes that collide each other, further examination of the next layer is needed until leaf nodes still collide. If two leafs collide, a collision between the two objects which are represented by the two trees is considered, and the middle of the leaf nodes is the collision point. If there is no collision among the nodes from a layer and the objects which two trees represent do not collide, there is no need of further testing.If there is still no intersection when the two AABB trees are traversed to the leaf nodes, then the objects which the two AABB trees represent are unintersected. The collision detection between leaf nodes is the process that compares the distance between the leaf nodes which represent model point with the safety marginβ. If the distance is less than β, it is considered as a collision. At this moment, the midpoint of the line which connects the two leaf nodes is the collision point.


### 4.2. Idea for the Resolution of Task Node Planning

For a manipulator withk degrees of freedom, suppose the number of task nodes is n; then there is n intermediate moments. Each node has 6-dimension pose information. Therefore, the dimension of decision vector is R
=
n
+
n
+
6
n
+
k
n
=
(
8
+
k
)
n. It can be seen that the dimension of the decision vector is related to the number of the task node, that is, the dimension of the decision vector itself is also a variable that needs to be decided. So, it is difficult for PSO, GA, and other mainstream intelligent optimization algorithms to solve the problem.In this paper, heuristic search algorithm is adopted to avoid the problem of deciding the number of task nodes. The number of task nodes can be determined when the algorithm finishes. Because of the intervention of the heuristic item, the algorithm always conducts the solution towards the optimal resources allocation and therefore promises the minimum cost of the whole task.A
∗ algorithm is a typical heuristic search algorithm in artificial intelligence; the core of the algorithm is to introduce an evaluation function f
(
p
) when selecting the next point at a current point [26].(21)
f
p
=
g
p
+
h
p
,where g
(
p
) is the actual cost from the initial point to p in the state space and h
(
p
) is the estimate cost from p to target point.


### 4.3. Task Node Planning Using ImprovedA
∗ Algorithm

This paper proposes a variable topologyA
∗ algorithm suitable for space manipulator tasks based on the traditional A
∗ algorithm. The improvement idea is that each searching point can not only arrive from the adjacent parent point, but also arrive directly from the parent point of its parent point. These break the fixed topological relationship in traditional A
∗ algorithm search space. When g
(
p
) is being calculated, the traditional method of “the actual cost of arriving father point” + “the cost of parent point to the current point” is not used. Instead, by using parent point as the guide, the algorithm looks back to the farthest feasible start point. The costs of various ways that can reach the current point are calculated, and the plan with the least cost is selected. The improvement of calculating traditional A
∗ algorithm’s g
(
p
):(22)
g
′
p
c
=
g
p
f
′
+
C
p
f
′
,
p
c
,where C
(
p
1
,
p
2
) is the actual cost from point p
1 to point p
2, p
c is current point, and p
f is the father point of the current point. Boundary conditions: C
(
p
1
,
p
1
)
=
0.Define the pseudofather pointp
f
′: p
f
′ of p
c as the point between “p
f” and “p
f
′ of p
f” which makes g
′
(
p
c
) minimal. Boundary conditions: the p
f
′ of the start point p
s is itself.Theng
′
(
p
c
) can be expressed as(23)
g
′
p
c
=
min
⁡
g
p
g
+
C
p
g
,
p
c
,
g
p
f
+
C
p
f
,
p
c
,where p
g is the pseudofather point of the father point of the current point.Improved algorithm process is as follows.Step 1.
Set the search dimension of the planner asD, search step of position as Δ
l, and search step of attitude as Δ
θ.Step 2.
Set up two empty lists: OPEN list and CLOSE list.Step 3.
Set the pseudofather point of the start point (pointStart) as itself and add it to the OPEN list, and then calculatef
(
p
).Step 4.
If the CLOSE list contains the target point pointEnd, go to Step 12.Step 5.
If the OPEN list is empty, the target is not reachable and the planning ends.Step 6.
Select the point with smallestf
(
p
) in OPEN list as the current node and move it to CLOSE list.Step 7.
Generate candidate point setP by moving the current point ± 1 step in all dimensions.Step 8.
Eliminate the point which is in CLOSE list or in violation of the constraints fromP.Step 9.
Use the typical path planning algorithm to calculatef
(
p
) of all points in P, respectively, and remove the nodes in P which violate constraints in the process of path planning.Step 10.
Record pseudofather pointp
f
′ of all nodes in P and move all points of P in the OPEN list.Step 11.
Go to Step 4.Step 12.
Go back from the target point (pointEnd) to the start point (pointStart) through pseudofather points to derive the entire path, that is, all the task nodes.The flowchart of improved algorithm is shown as in Figure6.Figure 6
Flow chart of task node planning.In this paper, joint stroke during the task which is directly related to the life of the transmission system and affects the reliability of the space agency in orbit is used as the optimal resource, using “straight path planning” as the typical path planning algorithm. The cost between two points isC
(
p
1
,
p
2
):(24)
C
p
1
,
p
2
=
∑
i
=
1
k
q
2
,
i
-
q
1
,
i
,where k is the degree of freedom of manipulator and the initial and final configuration of the straight path planning are, respectively, q
1,1
,
q
1,2
,
…
,
q
1
,
k and q
2,1
,
q
2,2
,
…
,
q
2
,
k.End velocity, end acceleration, the collision interference of manipulator, and the environment obstacles are chosen as the constraints of the planner, where the velocity and acceleration constraints are guaranteed by the path planning algorithm; obstacle avoidance constraints are calculated by applying AABB algorithm to each configuration of path planning result.The proposed task node planning method is mainly used for finding a path that satisfies one or more constraints. The planed path is given in the form of several nodes and needs a trajectory planning method to connect these nodes. For manipulator, trajectory planning is an existing and mature technology, so task node planning can be applied well to the manipulator. In addition, task node planning also can be applied in other resources, if there is trajectory planning method for the application object.


### 4.4. Planning for Dual-Arms Robot

For single arm system, the algorithm can decompose the path that the manipulator cannot complete directly under multiple constraints into several simple paths satisfying the constraint. In multiarm systems, one arm’s movement relative to the other can be regarded as obstacles constraints. However, this obstacle constraint which is different from general object in the environment is of time-varying dynamic properties, for multiple manipulators always work at the same time. Thus, it is difficult to avoid interference between multiarms by directly using the single arm planning algorithm to each single arm, respectively, in a multiarm system. This paper introduces the concept of virtual obstacles and proposes a planning strategy to solve the conflict between multiarms. A dual-arms task planning algorithm based on this strategy can make manipulator complete the work independently in the same space and at the same time and does not interfere with each other.For a multiarm system consisting ofm manipulators, the scene model M is decomposed into m
+
1 subset: E
,
M
1
,
M
2
,
…
,
M
m
,
M
i
i
=
1
,
…
,
m is m manipulators, using this model sets to reform m virtual scenes E
,
M
i
i
=
1
,
…
,
m. It means that one arm of the multiarm system is in the scene and other arms are ignored. Do single arm task planning, respectively, for the m virtual scene E
,
M
i
i
=
1
,
…
,
m, and this process for the multiarm system is defined as MADP (Multi-Arm Distributed Planning). After that, m mission planning results K
i
i
=
1
,
…
,
m can be gotten. m virtual scene is planning independently, so each of the manipulators in the planning process does not take into account the impact of other manipulators’ movement. Therefore, these manipulators are very likely to interfere with each other when the planning results are overlapped in a common environment.The direct cause of the interference of multiarm system in common working space is that the collided parts of two manipulators should not appear in the same space at the same time. One way to solve this contradiction is to introduce time and space constraints at all collision points in the scene. So, the manipulators that will have a collision could avoid a particular location at a certain time. The simplest approach to add time and space constraint is to add a small virtual cube obstacle whose length is a configurable fixed valueγ at each collision point. Set G
=
G
1
,
G
2
,
…
,
G
ω, where ω is the number of collision points between manipulators after the fusion of m virtual scene planning and G
i
i
=
1
,
…
,
ω is the virtual obstacle model added to the collision point. Environment model E can be updated by using the following formula:(25)
E
i
+
1
=
E
i
∪
G
i
+
1
,where E
0
=
E and G
i
+
1 is the new virtual obstacle set of the virtual scene E
i
,
M
j
j
=
1
,
…
,
m after a MADP. Virtual obstacle elements of the set G are not real objects in the scene; they are only used to avoid the collision between multiarm system in some particular moment. So, G
i
i
=
1
,
…
,
ω does not always need to appear during the task and just needs to be added to the scene at the time before and after the moment of collision t
i
-
Δ
δ
,
t
i
+
Δ
δ, where t
i is the moment of collision between manipulators and Δ
δ is a configurable avoiding time for safety. So, the environment model with time-varying characteristic is as follows:(26)
E
i
+
1
t
=
E
i
t
∪
G
1
i
+
1
t
,
G
2
i
+
1
t
,
…
,
G
ω
i
+
1
t
,where expression of G
i
t is(27)
G
i
t
=
G
i
,
t
∈
t
i
-
Δ
δ
,
t
i
+
Δ
δ
,
⌀
,
t
∉
t
i
-
Δ
δ
,
t
i
+
Δ
δ
.Dual-arm task planning strategy is as follows: using (26) iterative algorithm to update environment model E until virtual obstacle set G
=
⌀; the scheme after MADP planning is feasible dual-arm system task planning results.


## 4.1. Manipulator Collision Detection Based on Point Cloud Model

Task profile analysis makes the task transform from complex to simple, but it is difficult for a primitive task to obtain feasible trajectory by using traditional path planning algorithm because of various constraints. Obstacle avoidance is the only necessary constraint for all tasks; thus it should be payed special attention. In order to satisfy the requirements of precise operation in space, a new high-precision collision detection algorithm for manipulator is proposed in this paper. Then, the task node planning method is achieved based on the collision detection.


### 4.1.1. Point Cloud Model of Scene

In order to detect the collision between different parts of the manipulator accurately, a mathematical method that can describe the shape of the whole manipulator and the environment is needed. Basic geometry envelope is widely used in the shape modeling of manipulator collision detection at present. However, it is obvious that if the surface of the object is not regular enough, the basic geometry envelope will cause the model distortion. This will lead to the loss of part of the manipulator’s workspace, and will result in the failure of many delicate tasks due to the imprecise collision detection. In addition, this method requires a lot of work of envelope of models, analyzing the shape of model artificially and selecting the approximate geometry. It is entirely unrealistic in space application. In this paper, a method of collision detection for manipulator based on point cloud modeling is proposed. In this method, dense scattered points are used to model for irregular object, then the AABB (Axis Aligned Bounding Box) algorithm is used to achieve the manipulator collision detection.Point cloud model is defined as dense scattered points which distribute on the surface of the object. All the points in the model are defined in the coordinate system of the object itself. When the object is moving, the rotation matrix of the object can be used to transfer every point of the point cloud model into the inertial coordinate system.After scanning all the objects in the scene by using Intersect Visitor tool of OSG (OpenSceneGraph), the point cloud model of the whole sceneM
=
M
1
,
M
2
,
…
,
M
N is obtained; example is shown as in Figure 4, where M
i
∈
R
n
i
×
3 is theith model’s point cloud matrix. M
i is composed of n
i 3-dimensional row vectors, which represent the n
i points on the surface ofith object.Figure 4
Example of point cloud model of object.


### 4.1.2. Build Model’s AABB Tree

After obtaining the scene point cloud model, the collision detection of the scene can be done by testing all intersections betweenM
i and M
j
(
i
≠
j
). Intersection test between M
i and M
j
(
i
≠
j
) is operated as follows: all points in the M
i and M
j are converted to the same coordinate system (inertial system, e.g.), and whether distance between a pair of points m
i
,
u and m
j
,
v is less than a preset safety threshold β is determined, where points m
i
,
u and m
j
,
v separately belong to M
i and M
j. If a pair of points m
i
,
u and m
j
,
v can be found in the scene, then theith model and thejth model in the scene collide with each other. Besides, it is considered that the collision point exists in the middle of the connecting line between m
i
,
u and m
j
,
v, because the value of β is very small.Traversing all of the points between two point clouds is the simplest intersection test method, but it will consume large amount of computing resources. In this paper, the points of point cloud model are organized with clusters. AABBs of clusters are used to build AABB tree, and then AABB algorithm is used to detect the collision between any objects in the scene. A cluster is defined as a set of points which are near to each other in the point cloud model. The entire points of a cloud model areC
r
o
o
t which is called the root of cluster. Each cluster is divided into left and right child clusters C
l and C
r recursively from the root cluster until only one point is contained in a cluster. By following the steps above, the point cloud of a model can be organized with a binary tree which is shown in Figure 5.Figure 5
Binary tree of model point cloud.The method of cluster division affects the executing efficiency of the collision detection. In this paper, a cluster is divided into two child clusters according to the principle of dividing from the middle of the longest axis of the model, so that the center of the two child clusters could be far away; thereby the unintersected clusters can be quickly eliminated. In order to determine the longest axis of the model, the maximum and minimum points onX
,
Y
,
Z directions are obtained by traversing the model points.(16)
P
X
m
a
x
x
X
m
a
x
,
y
X
m
a
x
,
z
X
m
a
x
,
P
X
m
i
n
x
X
m
i
n
,
y
X
m
i
n
,
z
X
m
i
n
,
P
Y
m
a
x
x
Y
m
a
x
,
y
Y
m
a
x
,
z
Y
m
a
x
,
P
Y
m
i
n
x
Y
m
i
n
,
y
Y
m
i
n
,
z
Y
m
i
n
,
P
Z
m
a
x
x
Z
m
a
x
,
y
Z
m
a
x
,
z
Z
m
a
x
,
P
Z
m
i
n
x
Z
m
i
n
,
y
Z
m
i
n
,
z
Z
m
i
n
.Three axial dimensional sizes of the model can be calculated:(17)
A
X
=
x
X
m
a
x
-
x
X
m
i
n
,
A
Y
=
y
Y
m
a
x
-
y
Y
m
i
n
,
A
Z
=
z
Z
m
a
x
-
z
Z
m
i
n
.Then, the model’s longest axisW and its length A
W are obtained.(18)
A
W
=
max
⁡
A
X
,
A
Y
,
A
Z
,where W is one of X
,
Y
,
Z.AABB of the model is divided into two parts along the perpendicular bisection plane of axisW; the points belong to one of the two parts of point cloud model forming a new child cluster. A more intuitive way to express the segmentation method is that the vertical plane is made to the W axis at midpoint of P
W
m
a
x and P
W
m
i
n; each side belongs to a new child cluster. Figure 5 shows an example for a two-dimensional point cloud model which split into binary trees. The red line represents the longest axis of the point cloud cluster W. The blue line shows the line by which the points in the cluster are divided into two child clusters. The blue line would be a plane in 3D point cloud. The partition criterion for the left and right child clusters of model is as follows:(19)
C
l
:
P
x
,
y
,
z
∣
w
∈
x
,
y
,
z
,
w
<
w
W
m
a
x
+
w
W
m
i
n
2
,
C
r
:
P
x
,
y
,
z
∣
w
∈
x
,
y
,
z
,
w
>
w
W
m
a
x
+
w
W
m
i
n
2
,where w which is determined by (18) is the longest axis of the model.All nodes of the point cloud binary trees are enveloped with AABB, and then the AABB tree of the model is obtained.


### 4.1.3. Intersection Test for AABB Trees

AABB binary trees are constructed for every rigid body of manipulator and environment obstacle, and trees which belong to manipulator or environment join together into an AABB forest. Thus, the scene modelM is divided into two subsets: manipulator model R and environmental obstacle E.(20)
R
∪
E
=
M
,
R
∩
E
=
⌀
.Collision detection between forests can be achieved by traversing the AABB trees which are from the two respective forests. Collision detection between every two AABB trees is achieved by examining nodes from the root node to the leave node between two trees. If there are two nodes that collide each other, further examination of the next layer is needed until leaf nodes still collide. If two leafs collide, a collision between the two objects which are represented by the two trees is considered, and the middle of the leaf nodes is the collision point. If there is no collision among the nodes from a layer and the objects which two trees represent do not collide, there is no need of further testing.If there is still no intersection when the two AABB trees are traversed to the leaf nodes, then the objects which the two AABB trees represent are unintersected. The collision detection between leaf nodes is the process that compares the distance between the leaf nodes which represent model point with the safety marginβ. If the distance is less than β, it is considered as a collision. At this moment, the midpoint of the line which connects the two leaf nodes is the collision point.


## 4.1.1. Point Cloud Model of Scene

In order to detect the collision between different parts of the manipulator accurately, a mathematical method that can describe the shape of the whole manipulator and the environment is needed. Basic geometry envelope is widely used in the shape modeling of manipulator collision detection at present. However, it is obvious that if the surface of the object is not regular enough, the basic geometry envelope will cause the model distortion. This will lead to the loss of part of the manipulator’s workspace, and will result in the failure of many delicate tasks due to the imprecise collision detection. In addition, this method requires a lot of work of envelope of models, analyzing the shape of model artificially and selecting the approximate geometry. It is entirely unrealistic in space application. In this paper, a method of collision detection for manipulator based on point cloud modeling is proposed. In this method, dense scattered points are used to model for irregular object, then the AABB (Axis Aligned Bounding Box) algorithm is used to achieve the manipulator collision detection.Point cloud model is defined as dense scattered points which distribute on the surface of the object. All the points in the model are defined in the coordinate system of the object itself. When the object is moving, the rotation matrix of the object can be used to transfer every point of the point cloud model into the inertial coordinate system.After scanning all the objects in the scene by using Intersect Visitor tool of OSG (OpenSceneGraph), the point cloud model of the whole sceneM
=
M
1
,
M
2
,
…
,
M
N is obtained; example is shown as in Figure 4, where M
i
∈
R
n
i
×
3 is theith model’s point cloud matrix. M
i is composed of n
i 3-dimensional row vectors, which represent the n
i points on the surface ofith object.Figure 4
Example of point cloud model of object.


## 4.1.2. Build Model’s AABB Tree

After obtaining the scene point cloud model, the collision detection of the scene can be done by testing all intersections betweenM
i and M
j
(
i
≠
j
). Intersection test between M
i and M
j
(
i
≠
j
) is operated as follows: all points in the M
i and M
j are converted to the same coordinate system (inertial system, e.g.), and whether distance between a pair of points m
i
,
u and m
j
,
v is less than a preset safety threshold β is determined, where points m
i
,
u and m
j
,
v separately belong to M
i and M
j. If a pair of points m
i
,
u and m
j
,
v can be found in the scene, then theith model and thejth model in the scene collide with each other. Besides, it is considered that the collision point exists in the middle of the connecting line between m
i
,
u and m
j
,
v, because the value of β is very small.Traversing all of the points between two point clouds is the simplest intersection test method, but it will consume large amount of computing resources. In this paper, the points of point cloud model are organized with clusters. AABBs of clusters are used to build AABB tree, and then AABB algorithm is used to detect the collision between any objects in the scene. A cluster is defined as a set of points which are near to each other in the point cloud model. The entire points of a cloud model areC
r
o
o
t which is called the root of cluster. Each cluster is divided into left and right child clusters C
l and C
r recursively from the root cluster until only one point is contained in a cluster. By following the steps above, the point cloud of a model can be organized with a binary tree which is shown in Figure 5.Figure 5
Binary tree of model point cloud.The method of cluster division affects the executing efficiency of the collision detection. In this paper, a cluster is divided into two child clusters according to the principle of dividing from the middle of the longest axis of the model, so that the center of the two child clusters could be far away; thereby the unintersected clusters can be quickly eliminated. In order to determine the longest axis of the model, the maximum and minimum points onX
,
Y
,
Z directions are obtained by traversing the model points.(16)
P
X
m
a
x
x
X
m
a
x
,
y
X
m
a
x
,
z
X
m
a
x
,
P
X
m
i
n
x
X
m
i
n
,
y
X
m
i
n
,
z
X
m
i
n
,
P
Y
m
a
x
x
Y
m
a
x
,
y
Y
m
a
x
,
z
Y
m
a
x
,
P
Y
m
i
n
x
Y
m
i
n
,
y
Y
m
i
n
,
z
Y
m
i
n
,
P
Z
m
a
x
x
Z
m
a
x
,
y
Z
m
a
x
,
z
Z
m
a
x
,
P
Z
m
i
n
x
Z
m
i
n
,
y
Z
m
i
n
,
z
Z
m
i
n
.Three axial dimensional sizes of the model can be calculated:(17)
A
X
=
x
X
m
a
x
-
x
X
m
i
n
,
A
Y
=
y
Y
m
a
x
-
y
Y
m
i
n
,
A
Z
=
z
Z
m
a
x
-
z
Z
m
i
n
.Then, the model’s longest axisW and its length A
W are obtained.(18)
A
W
=
max
⁡
A
X
,
A
Y
,
A
Z
,where W is one of X
,
Y
,
Z.AABB of the model is divided into two parts along the perpendicular bisection plane of axisW; the points belong to one of the two parts of point cloud model forming a new child cluster. A more intuitive way to express the segmentation method is that the vertical plane is made to the W axis at midpoint of P
W
m
a
x and P
W
m
i
n; each side belongs to a new child cluster. Figure 5 shows an example for a two-dimensional point cloud model which split into binary trees. The red line represents the longest axis of the point cloud cluster W. The blue line shows the line by which the points in the cluster are divided into two child clusters. The blue line would be a plane in 3D point cloud. The partition criterion for the left and right child clusters of model is as follows:(19)
C
l
:
P
x
,
y
,
z
∣
w
∈
x
,
y
,
z
,
w
<
w
W
m
a
x
+
w
W
m
i
n
2
,
C
r
:
P
x
,
y
,
z
∣
w
∈
x
,
y
,
z
,
w
>
w
W
m
a
x
+
w
W
m
i
n
2
,where w which is determined by (18) is the longest axis of the model.All nodes of the point cloud binary trees are enveloped with AABB, and then the AABB tree of the model is obtained.


## 4.1.3. Intersection Test for AABB Trees

AABB binary trees are constructed for every rigid body of manipulator and environment obstacle, and trees which belong to manipulator or environment join together into an AABB forest. Thus, the scene modelM is divided into two subsets: manipulator model R and environmental obstacle E.(20)
R
∪
E
=
M
,
R
∩
E
=
⌀
.Collision detection between forests can be achieved by traversing the AABB trees which are from the two respective forests. Collision detection between every two AABB trees is achieved by examining nodes from the root node to the leave node between two trees. If there are two nodes that collide each other, further examination of the next layer is needed until leaf nodes still collide. If two leafs collide, a collision between the two objects which are represented by the two trees is considered, and the middle of the leaf nodes is the collision point. If there is no collision among the nodes from a layer and the objects which two trees represent do not collide, there is no need of further testing.If there is still no intersection when the two AABB trees are traversed to the leaf nodes, then the objects which the two AABB trees represent are unintersected. The collision detection between leaf nodes is the process that compares the distance between the leaf nodes which represent model point with the safety marginβ. If the distance is less than β, it is considered as a collision. At this moment, the midpoint of the line which connects the two leaf nodes is the collision point.


## 4.2. Idea for the Resolution of Task Node Planning

For a manipulator withk degrees of freedom, suppose the number of task nodes is n; then there is n intermediate moments. Each node has 6-dimension pose information. Therefore, the dimension of decision vector is R
=
n
+
n
+
6
n
+
k
n
=
(
8
+
k
)
n. It can be seen that the dimension of the decision vector is related to the number of the task node, that is, the dimension of the decision vector itself is also a variable that needs to be decided. So, it is difficult for PSO, GA, and other mainstream intelligent optimization algorithms to solve the problem.In this paper, heuristic search algorithm is adopted to avoid the problem of deciding the number of task nodes. The number of task nodes can be determined when the algorithm finishes. Because of the intervention of the heuristic item, the algorithm always conducts the solution towards the optimal resources allocation and therefore promises the minimum cost of the whole task.A
∗ algorithm is a typical heuristic search algorithm in artificial intelligence; the core of the algorithm is to introduce an evaluation function f
(
p
) when selecting the next point at a current point [26].(21)
f
p
=
g
p
+
h
p
,where g
(
p
) is the actual cost from the initial point to p in the state space and h
(
p
) is the estimate cost from p to target point.


## 4.3. Task Node Planning Using ImprovedA
∗ Algorithm

This paper proposes a variable topologyA
∗ algorithm suitable for space manipulator tasks based on the traditional A
∗ algorithm. The improvement idea is that each searching point can not only arrive from the adjacent parent point, but also arrive directly from the parent point of its parent point. These break the fixed topological relationship in traditional A
∗ algorithm search space. When g
(
p
) is being calculated, the traditional method of “the actual cost of arriving father point” + “the cost of parent point to the current point” is not used. Instead, by using parent point as the guide, the algorithm looks back to the farthest feasible start point. The costs of various ways that can reach the current point are calculated, and the plan with the least cost is selected. The improvement of calculating traditional A
∗ algorithm’s g
(
p
):(22)
g
′
p
c
=
g
p
f
′
+
C
p
f
′
,
p
c
,where C
(
p
1
,
p
2
) is the actual cost from point p
1 to point p
2, p
c is current point, and p
f is the father point of the current point. Boundary conditions: C
(
p
1
,
p
1
)
=
0.Define the pseudofather pointp
f
′: p
f
′ of p
c as the point between “p
f” and “p
f
′ of p
f” which makes g
′
(
p
c
) minimal. Boundary conditions: the p
f
′ of the start point p
s is itself.Theng
′
(
p
c
) can be expressed as(23)
g
′
p
c
=
min
⁡
g
p
g
+
C
p
g
,
p
c
,
g
p
f
+
C
p
f
,
p
c
,where p
g is the pseudofather point of the father point of the current point.Improved algorithm process is as follows.Step 1.
Set the search dimension of the planner asD, search step of position as Δ
l, and search step of attitude as Δ
θ.Step 2.
Set up two empty lists: OPEN list and CLOSE list.Step 3.
Set the pseudofather point of the start point (pointStart) as itself and add it to the OPEN list, and then calculatef
(
p
).Step 4.
If the CLOSE list contains the target point pointEnd, go to Step 12.Step 5.
If the OPEN list is empty, the target is not reachable and the planning ends.Step 6.
Select the point with smallestf
(
p
) in OPEN list as the current node and move it to CLOSE list.Step 7.
Generate candidate point setP by moving the current point ± 1 step in all dimensions.Step 8.
Eliminate the point which is in CLOSE list or in violation of the constraints fromP.Step 9.
Use the typical path planning algorithm to calculatef
(
p
) of all points in P, respectively, and remove the nodes in P which violate constraints in the process of path planning.Step 10.
Record pseudofather pointp
f
′ of all nodes in P and move all points of P in the OPEN list.Step 11.
Go to Step 4.Step 12.
Go back from the target point (pointEnd) to the start point (pointStart) through pseudofather points to derive the entire path, that is, all the task nodes.The flowchart of improved algorithm is shown as in Figure6.Figure 6
Flow chart of task node planning.In this paper, joint stroke during the task which is directly related to the life of the transmission system and affects the reliability of the space agency in orbit is used as the optimal resource, using “straight path planning” as the typical path planning algorithm. The cost between two points isC
(
p
1
,
p
2
):(24)
C
p
1
,
p
2
=
∑
i
=
1
k
q
2
,
i
-
q
1
,
i
,where k is the degree of freedom of manipulator and the initial and final configuration of the straight path planning are, respectively, q
1,1
,
q
1,2
,
…
,
q
1
,
k and q
2,1
,
q
2,2
,
…
,
q
2
,
k.End velocity, end acceleration, the collision interference of manipulator, and the environment obstacles are chosen as the constraints of the planner, where the velocity and acceleration constraints are guaranteed by the path planning algorithm; obstacle avoidance constraints are calculated by applying AABB algorithm to each configuration of path planning result.The proposed task node planning method is mainly used for finding a path that satisfies one or more constraints. The planed path is given in the form of several nodes and needs a trajectory planning method to connect these nodes. For manipulator, trajectory planning is an existing and mature technology, so task node planning can be applied well to the manipulator. In addition, task node planning also can be applied in other resources, if there is trajectory planning method for the application object.


## 4.4. Planning for Dual-Arms Robot

For single arm system, the algorithm can decompose the path that the manipulator cannot complete directly under multiple constraints into several simple paths satisfying the constraint. In multiarm systems, one arm’s movement relative to the other can be regarded as obstacles constraints. However, this obstacle constraint which is different from general object in the environment is of time-varying dynamic properties, for multiple manipulators always work at the same time. Thus, it is difficult to avoid interference between multiarms by directly using the single arm planning algorithm to each single arm, respectively, in a multiarm system. This paper introduces the concept of virtual obstacles and proposes a planning strategy to solve the conflict between multiarms. A dual-arms task planning algorithm based on this strategy can make manipulator complete the work independently in the same space and at the same time and does not interfere with each other.For a multiarm system consisting ofm manipulators, the scene model M is decomposed into m
+
1 subset: E
,
M
1
,
M
2
,
…
,
M
m
,
M
i
i
=
1
,
…
,
m is m manipulators, using this model sets to reform m virtual scenes E
,
M
i
i
=
1
,
…
,
m. It means that one arm of the multiarm system is in the scene and other arms are ignored. Do single arm task planning, respectively, for the m virtual scene E
,
M
i
i
=
1
,
…
,
m, and this process for the multiarm system is defined as MADP (Multi-Arm Distributed Planning). After that, m mission planning results K
i
i
=
1
,
…
,
m can be gotten. m virtual scene is planning independently, so each of the manipulators in the planning process does not take into account the impact of other manipulators’ movement. Therefore, these manipulators are very likely to interfere with each other when the planning results are overlapped in a common environment.The direct cause of the interference of multiarm system in common working space is that the collided parts of two manipulators should not appear in the same space at the same time. One way to solve this contradiction is to introduce time and space constraints at all collision points in the scene. So, the manipulators that will have a collision could avoid a particular location at a certain time. The simplest approach to add time and space constraint is to add a small virtual cube obstacle whose length is a configurable fixed valueγ at each collision point. Set G
=
G
1
,
G
2
,
…
,
G
ω, where ω is the number of collision points between manipulators after the fusion of m virtual scene planning and G
i
i
=
1
,
…
,
ω is the virtual obstacle model added to the collision point. Environment model E can be updated by using the following formula:(25)
E
i
+
1
=
E
i
∪
G
i
+
1
,where E
0
=
E and G
i
+
1 is the new virtual obstacle set of the virtual scene E
i
,
M
j
j
=
1
,
…
,
m after a MADP. Virtual obstacle elements of the set G are not real objects in the scene; they are only used to avoid the collision between multiarm system in some particular moment. So, G
i
i
=
1
,
…
,
ω does not always need to appear during the task and just needs to be added to the scene at the time before and after the moment of collision t
i
-
Δ
δ
,
t
i
+
Δ
δ, where t
i is the moment of collision between manipulators and Δ
δ is a configurable avoiding time for safety. So, the environment model with time-varying characteristic is as follows:(26)
E
i
+
1
t
=
E
i
t
∪
G
1
i
+
1
t
,
G
2
i
+
1
t
,
…
,
G
ω
i
+
1
t
,where expression of G
i
t is(27)
G
i
t
=
G
i
,
t
∈
t
i
-
Δ
δ
,
t
i
+
Δ
δ
,
⌀
,
t
∉
t
i
-
Δ
δ
,
t
i
+
Δ
δ
.Dual-arm task planning strategy is as follows: using (26) iterative algorithm to update environment model E until virtual obstacle set G
=
⌀; the scheme after MADP planning is feasible dual-arm system task planning results.


## 5. Experiment and Simulation

An 8-DOF fixed base manipulator is used as the test subject to verify the task plan method in this paper. Figure7 shows the coordinate systems definition of manipulator, and Table 1 shows the D-H parameter of this manipulator.Table 1
ManipulatorD
-
H parameter table.
Numerical order
Joint angle
Torsion angle
The length of the connecting rod
Connecting rod bias
θ
/
°
α
/
°
a
/
m
d
/
m
1
90
0
0
0.38
2
−90
−90
0
0.11
3
0
90
0
0.24
4
0
0
0.13
0
5
−90
0
0.13
0
6
0
−90
0
0.30
7
0
90
0
0
8
0
−90
0
0.09Figure 7
Coordinate systems definition of manipulator.A manipulator simulation system with 3D simulation unit which is based on OpenGL is built under IDE of VS2010. The whole task cycle of manipulator can be simulated visually by this simulation system. The hardware platform for simulation is CPU Intel i3 3.3 GHz, 4 GB RAM. Manipulator control cycle is 50 ms.There are a manipulatorM, an obstacle O, and an object U to be operated in the simulation environment. The initial conditions are as follows: operation interface of U is A
=
-
0.54
m
,
0.45
m
,
0.18
m
,
131.78
°
,
-
79.64
°
,
-
177.62
°
T; initial configuration of M is 16
°
,
18.1
°
,
67.6
°
,
56.2
°
,
21.9
°
,
-
29.5
°
,
-
41.4
°
,
0
°
T. Planning domain of planner is configured as the three primitive task operators described in this paper and a compound tasks “transfer”:(28)
trans
⁡
u
,
v
,
n
1
:
d
o
c
a
p
t
u
r
e
u
,
n
2
:
d
o
m
o
v
e
v
,
n
3
:
d
o
r
e
l
e
a
s
e
u
,
n
1
,
n
2
,
n
3
.The manipulatorM only has the ability to plan linear trajectory in Cartesian space and can only move in a straight line. The task goal is to transfer U to the position C
=
-
0.54
m
,
0
.
5
5
m
,
0.18
m
,
131.78
°
,
-
79.64
°
,
-
177.62
°
T.


### 5.1. Example of Task Profile Analysis for Object Transfer

The goal task network is described as(
a
c
h
i
e
v
e
(
trans
⁡
(
U
,
C
)
)
). The end executor’s coordinate can be calculated as B
=
-
0.48
m
,
-
0.51
m
,
0.18
m
,
-
142.09
°
,
-
79.64
°
,
-
177.62
°
T based on the initial configuration and the robot forward kinematics. So, the initial status to the environment is B
0
A
0.(1)
The goal network contains only one nonprimitive task. Thus, search the correspondingM
e; in the planning domain, t
r
a
n
s
(
U
,
C
) is replaced by (28).
(2)
By retraversing the whole task network,n
1 is confirmed as a primitive task. Then, the current state is compared with the prerequisite of c
a
p
t
u
r
e
(
u
) by using the state criterion: B
0
A
0
-
A
0
A
0
=
B
-
A
0
0
0. And, mask of the wrong state is 1
0
0
0.
(3)
By search planning domain,m
o
v
e
(
v
) operator can eliminate this difference of state. So a new task network (
n
4
:
d
o
[
m
o
v
e
(
A
)
]
) is added in front of n
1. Task network constraints become (
n
4
,
n
1
,
n
2
,
n
3
).
(4)
On retraversing task network again, initial stateB
A
0
0 transfers to A
A
0
0 through n
4 operator, then transfers to A
A
1
1 through n
1 operator, then transfers to C
C
1
1 through n
2 operator, and then transfers to C
C
0
0 through n
3 operator at last.At this moment, the task network has no conflict any more. The primitive task sequence which is given by planner ism
o
v
e
(
A
) → c
a
p
t
u
r
e
(
U
) → m
o
v
e
(
C
) → r
e
l
e
a
s
e
(
U
). Objects U are successfully transferred toC.


### 5.2. Simulation of Task Node Planning for Moving Task

The primitive task sequence which is given by task profile analysis is checked by typical path planning method. In this check,m
o
v
e
(
A
) cannot be executed directly, because of the environmental obstacle. The initial configuration of the primitive task is 16
°
,
18.1
°
,
67.6
°
,
56.2
°
,
21.9
°
,
-
29.5
°
,
-
41.4
°
⁡
,
0
°
T; the target point A
=
[
-
0.54
m
,
0.45
m
,
0.18
m
,
131.78
°
,
-
79.64
°, -
177.62
°
]
T. Set the planner parameters as follows: the end velocity constraints are <0.03 m/s, the end acceleration constraints are <0.03 m/s2, configuration constraints are to avoid collision from manipulator itself, and environmental constraint is to avoid obstaclesO; planner search dimension is three and search step is 0.05 m. Use the improved A
∗ algorithm to plan the task node; the movement of manipulator is shown in Figure 8.Figure 8
Simulation movement of task node planning.
(a)
Starting pointB
(b)
Cause a collision without task planning
(c)
Task nodeD
(d)
Task nodeE
(e)
Target pointAIt can be seen in the figure that direct path planning betweenB and A will cause manipulator’s collisions as shown in Figure 8(b). With the introduction of task planning, the task nodes D
=
-
0.68
m
,
-
0.01
m
,
0.73
m
,
16.04
°
,
-
55
°
,
-
31.51
°
T and E
=
-
0.68
m
,
0.34
m
,
0.48
m
,
-
42.4
°
,
-
71.62
,
-
17.19
°
T are added into the movement of B to A. These make the manipulator M reach A from B passing D andE and bypass obstacles at the same time. All manipulator joints travel with minimum stroke under this condition.On the basis of single arm task node planning simulation, a dual-arms task node planning simulation is carried out. A new manipulator which is completely symmetrical with the manipulator used before is added to the environment. Then, a dual-arms system is constructed which is shown in Figure9.Figure 9
16-DOF manipulator system.The planning parameters in previous section are reused. In addition, side length of virtual obstacles isγ
=
0.1
m and avoiding time is Δ
δ
=
10
s. A new task is set: initial configurations of manipulator 1 are -
48
°
,
-
25.7
°
,
126.7
°
,
-
10.5
°
,
-
25.7
°
,
0
°
,
-
6.7
°
,
0
°
T, initial configurations of manipulator 2 are 18.1
°
,
-
33.3
°
,
-
56.2
°
,
-
48.6
°
,
-
27.6
°
,
0
°
,
-
58.1
°
,
0
°
T, manipulator 1 is required to move to point F
=
-
0.348
m
,
0.43
m
,
0.654
m
,
99.12
°
,
-
77.35
°
,
-
180
°
T, and manipulator 2 is required to move to point G
=
-
0.463,0.43
m
,
0.733
m
,
36.67
°
,
25.78
°
,
-
142.66
°
T at the same time. When simple linear trajectory path planning is used for arms, the task is broken by a collision between these two arms, as shown in Figure 10(a). Then, multiarm task planning algorithm is used to plan the task again, and the planner of manipulator adds a task node for manipulators 1 and 2, respectively: H
=
-
0.516
m
,
0.342
m
,
0.159
m
,
48.59
°
,
-
73.28
°
,
-
117
°
T and I
=
-
0.645
m
,
0.355
m
,
0.502
m
,
25.32
°
,
15.18
°
,
-
122.61
°
T
. At this time, the two manipulators can complete their tasks at the same time satisfying all constraints, as shown in Figure 10.Figure 10
Simulation of moving task for dual-arm system.
(a)
Cause collision without task planning
(b)
Initial configuration
(c)
Task nodeH
(d)
Task nodeI
(e)
Target of taskIt can be proved through simulation that the proposed algorithm can well decompose the object moving task and give the feasible task nodes for manipulator. And, the whole process is smooth and continuous.


## 5.1. Example of Task Profile Analysis for Object Transfer

The goal task network is described as(
a
c
h
i
e
v
e
(
trans
⁡
(
U
,
C
)
)
). The end executor’s coordinate can be calculated as B
=
-
0.48
m
,
-
0.51
m
,
0.18
m
,
-
142.09
°
,
-
79.64
°
,
-
177.62
°
T based on the initial configuration and the robot forward kinematics. So, the initial status to the environment is B
0
A
0.(1)
The goal network contains only one nonprimitive task. Thus, search the correspondingM
e; in the planning domain, t
r
a
n
s
(
U
,
C
) is replaced by (28).
(2)
By retraversing the whole task network,n
1 is confirmed as a primitive task. Then, the current state is compared with the prerequisite of c
a
p
t
u
r
e
(
u
) by using the state criterion: B
0
A
0
-
A
0
A
0
=
B
-
A
0
0
0. And, mask of the wrong state is 1
0
0
0.
(3)
By search planning domain,m
o
v
e
(
v
) operator can eliminate this difference of state. So a new task network (
n
4
:
d
o
[
m
o
v
e
(
A
)
]
) is added in front of n
1. Task network constraints become (
n
4
,
n
1
,
n
2
,
n
3
).
(4)
On retraversing task network again, initial stateB
A
0
0 transfers to A
A
0
0 through n
4 operator, then transfers to A
A
1
1 through n
1 operator, then transfers to C
C
1
1 through n
2 operator, and then transfers to C
C
0
0 through n
3 operator at last.At this moment, the task network has no conflict any more. The primitive task sequence which is given by planner ism
o
v
e
(
A
) → c
a
p
t
u
r
e
(
U
) → m
o
v
e
(
C
) → r
e
l
e
a
s
e
(
U
). Objects U are successfully transferred toC.


## 5.2. Simulation of Task Node Planning for Moving Task

The primitive task sequence which is given by task profile analysis is checked by typical path planning method. In this check,m
o
v
e
(
A
) cannot be executed directly, because of the environmental obstacle. The initial configuration of the primitive task is 16
°
,
18.1
°
,
67.6
°
,
56.2
°
,
21.9
°
,
-
29.5
°
,
-
41.4
°
⁡
,
0
°
T; the target point A
=
[
-
0.54
m
,
0.45
m
,
0.18
m
,
131.78
°
,
-
79.64
°, -
177.62
°
]
T. Set the planner parameters as follows: the end velocity constraints are <0.03 m/s, the end acceleration constraints are <0.03 m/s2, configuration constraints are to avoid collision from manipulator itself, and environmental constraint is to avoid obstaclesO; planner search dimension is three and search step is 0.05 m. Use the improved A
∗ algorithm to plan the task node; the movement of manipulator is shown in Figure 8.Figure 8
Simulation movement of task node planning.
(a)
Starting pointB
(b)
Cause a collision without task planning
(c)
Task nodeD
(d)
Task nodeE
(e)
Target pointAIt can be seen in the figure that direct path planning betweenB and A will cause manipulator’s collisions as shown in Figure 8(b). With the introduction of task planning, the task nodes D
=
-
0.68
m
,
-
0.01
m
,
0.73
m
,
16.04
°
,
-
55
°
,
-
31.51
°
T and E
=
-
0.68
m
,
0.34
m
,
0.48
m
,
-
42.4
°
,
-
71.62
,
-
17.19
°
T are added into the movement of B to A. These make the manipulator M reach A from B passing D andE and bypass obstacles at the same time. All manipulator joints travel with minimum stroke under this condition.On the basis of single arm task node planning simulation, a dual-arms task node planning simulation is carried out. A new manipulator which is completely symmetrical with the manipulator used before is added to the environment. Then, a dual-arms system is constructed which is shown in Figure9.Figure 9
16-DOF manipulator system.The planning parameters in previous section are reused. In addition, side length of virtual obstacles isγ
=
0.1
m and avoiding time is Δ
δ
=
10
s. A new task is set: initial configurations of manipulator 1 are -
48
°
,
-
25.7
°
,
126.7
°
,
-
10.5
°
,
-
25.7
°
,
0
°
,
-
6.7
°
,
0
°
T, initial configurations of manipulator 2 are 18.1
°
,
-
33.3
°
,
-
56.2
°
,
-
48.6
°
,
-
27.6
°
,
0
°
,
-
58.1
°
,
0
°
T, manipulator 1 is required to move to point F
=
-
0.348
m
,
0.43
m
,
0.654
m
,
99.12
°
,
-
77.35
°
,
-
180
°
T, and manipulator 2 is required to move to point G
=
-
0.463,0.43
m
,
0.733
m
,
36.67
°
,
25.78
°
,
-
142.66
°
T at the same time. When simple linear trajectory path planning is used for arms, the task is broken by a collision between these two arms, as shown in Figure 10(a). Then, multiarm task planning algorithm is used to plan the task again, and the planner of manipulator adds a task node for manipulators 1 and 2, respectively: H
=
-
0.516
m
,
0.342
m
,
0.159
m
,
48.59
°
,
-
73.28
°
,
-
117
°
T and I
=
-
0.645
m
,
0.355
m
,
0.502
m
,
25.32
°
,
15.18
°
,
-
122.61
°
T
. At this time, the two manipulators can complete their tasks at the same time satisfying all constraints, as shown in Figure 10.Figure 10
Simulation of moving task for dual-arm system.
(a)
Cause collision without task planning
(b)
Initial configuration
(c)
Task nodeH
(d)
Task nodeI
(e)
Target of taskIt can be proved through simulation that the proposed algorithm can well decompose the object moving task and give the feasible task nodes for manipulator. And, the whole process is smooth and continuous.


## 6. Conclusion

In this paper, a double-layer framework of task plan for complex working environment is proposed considering the characteristic of space manipulator and its various kinds of on-orbit servicing missions. First, state matrix, state mask, and their relative operation are proposed based on the characteristic of space manipulator. Meanwhile, three typical primitive tasks and their operators of manipulator are defined in order to realize the HTN planner for space manipulator. Then, complex tasks of manipulator can be analyzed and resolved by using HTN automatically. Second, in order to ensure the feasibility of the task, collision avoidance which is a necessary constraint for all tasks is given special attention. A collision modeling method based on point cloud model is proposed in this paper and is applied to the AABB algorithm for collision detection. The improved collision detection method could get higher precision with little cost of calculating time, thus satisfying the requirement of space application. Finally, a task node planning method is designed by improving theA
∗ algorithm. Based on this, manipulator could finish the task considering multiconstraint. In addition, the problem of collision between multiarms is also solved by introducing the concept of virtual obstacles.A typical task of space manipulator is simulated based on a 3D visual manipulator simulation system. It has been shown that manipulator could finish a complex task successfully under the condition of multiconstrains by using a combination of simple paths. The task planning method has high computation efficiency, so that the computation of a typical task for an 8-DOF manipulator can be finished in 1-2 minutes on a small business computer. Thus, the method would work fine with spaceborne computer for space application.In addition, HTN is a universal task plan method for lots of fields. However, when it is applied to a field, it may need to have some changes in order to adapt the field’s characteristic. For example, when we apply HTN to the space manipulator’s task planning, we designed a characterization method for space manipulator’s primitive task. Based on this characterization method, various kinds of manipulator tasks can be calculated mathematically, and HTN is used for space manipulator successfully. Thus, HTN can also be used for industrial related fields, but some work has to be done in order to adapt the method to related fields. Task node planning in this paper is a peculiar planning method for manipulator. It is appropriate for manipulator’s characteristic of smooth and continuous movement. So, task node planning is not suitable for other industrial fields, unless there is a trajectory planning method to guarantee the smooth and continuous movement.



---

*Source: 2508304-2016-08-30.xml*