  This paper proposes an approach for segmenting a task consisting of compliant
motions into phases, learning a primitive for each segmented phase of the task,
and reproducing the task by sequencing primitives online based on the learned
model. As compliant motions can "probe" the environment, using the interaction
between the robot and the environment to detect phase transitions can make the
transitions less prone to positional errors. This intuition leads us to model a
task with a non-homogeneous Hidden Markov Model (HMM), wherein hidden phase
transition probabilities depend on the interaction with the environment (wrench
measured by an F/T sensor). Expectation-maximization algorithm is employed in
estimating the parameters of the HMM model. During reproduction, the phase
changes of a task are detected online using the forward algorithm, with the
parameters learned from demonstrations. Cartesian impedance controller
parameters are learned from the demonstrations to reproduce each phase of the
task. The proposed approach is studied with a KUKA LWR4+ arm in two setups.
Experiments show that the method can successfully segment and reproduce a task
consisting of compliant motions with one or more demonstrations, even when
demonstrations do not have the same starting position and external forces occur
from different directions. Finally, we demonstrate that the method can also
handle rotational motions.
