Real-Time Optimization For Control Of A Multi-Modal Legged Robotic System