An Opportunistic Strategy for Motion Planning in the Presence of Soft Task Constraints