collision detection algorithms for motion planning