Task sequencing for sensor-based control