A gradient-based path optimization method for motion planning. (16th September 2016)