An anticipative kinematic limitation avoidance algorithm for collaborative robots: Three-dimensional case