## 1 Introduction  
A wheelchair mounted robotic arm (WMRA) is a typical service robot, which is developed to help the elderly and disabled to take care of themselves in a home environment [1; 2; 3; 4]. However, due to the physical or cognitive defects of the users, it is still hard or impossible for them to manipulate the WMRA flexibly to complete daily tasks [5; 6]. From the perspective of the disabled and the elderly, it is better to achieve the autonomous manipulation of such service robots to help them accomplish related tasks existed in a home environment [7; 8]. Unlike the well-structured factory environment, the natural home environment is full of dynamic, unpredictable, and stochastic events. In this situation, the robot requires a flexible motion planning and controlling approach in response to the changes in the environment, such as changed goals, encountered obstacles, and external perturbations [9; 10]. The traditional approach of generating a complex movement plan is based on the search process or related controllers [11; 12] to satisfy all the constraints, including the changes in the environment. However, these approaches are unsuitable for service robot to make rapid reactions due to its drawbacks of computationally expensive and time-consuming. At the same time, easy to program is another factor that affects the service robot to become widespread. This can be achieved by learning from demonstration (LfD) [13; 14; 15]. The robot can learn new skills just by reproducing the recorded human movements. In consideration of the large number of tasks that exist in the home environment, it is feasible only if a demonstrated movement can be generalized to other contexts, like different goal positions [16]. In order to address the above questions, much recent work has focused on dynamic movement primitives (DMPs) [17; 18; 19; 20; 21; 22], which offer a simple and versatile framework to represent and generate related movements. The core of DMPs is learning from demonstration (LfD). Usually, LfD offers a simple and convenient way to obtain the movement information of related tasks. Then, DMPs can represent the arbitrarily recorded movement with a set of nonlinear differential equations in which a linear point attractor is modulated by a nonlinear function [23; 24]. Representing the movement with differential equation has the advantages that it can be easily initialized with learning from demonstration and the generated movement is robust against the following changes, such as the task duration, goal points, and slight perturbations [7]. Moreover, it can ensure system converge to the specified goal position. In other words, the learned movement can be easily generalized to a new goal by simply changing the goal parameters [16]. This generalization characteristic is very suitable for a service robot to replay various learned tasks in different situations. For online obstacle avoidance, it is also a difficult and classical problem that robots often encounter in the process of autonomous manipulation. So far, various approaches have been proposed to solve it [25]. They can be divided into two categories, the local methods and the global methods. The local methods can offer fast response in face of the obstacles with local optimization, mainly including the vector field histogram [26], motion field flow [27], the curvature-velocity method [28], and the artificial potential field approach [29; 30]; the global methods can ensure that a valid and whole trajectory optimized solution can be found if it exists, but requires large computation and global representation of the environments and obstacles, mainly containing the path planning algorithms [31; 32] and the global search approaches [33; 34]. The artificial potential field approach, which was proposed by [PERSON] [29] in 1986, has been widely studied to avoid obstacles.