Randomized path planning for tasks requiring the release and regrasp of objects