A quadratic-cost dual control-based approach for optimal trajectory planning under uncertainty