Task-priority redundancy resolution with robustness to algorithmic singularities