Motion planning under uncertainties