OPTIMAL TRAJECTORY PLANNING OF ROBOT MANIPULATORS IN THE PRESENCE OF MOVING OBSTACLES