Path planning algorithm for an arm robot with obstacles