A Probabilistic Framework for Semi-Autonomous Robots Based on Interaction Primitives with Phase Estimation