A key control challenge for many autonomous systems is to achieve the performance goals safely with minimal resource use in the presence of mission constraints and uncertainties. In principle these problems can be formulated and solved as optimization problems. The challenge is solving them reliably onboard the autonomous system in real time.