Trajectory Planning for Redundant Manipulators in the Presence of Obstacles