Conditional nonlinear planning