Whole-body motion planning for humanoids based on CoM movement primitives