Motion Planning In Dynamic Environments With Application to Self-Driving Vehicles