Optimal control of such devices requires accurate classification of the patient 's ambulation mode ( eg , on level ground or ascending stairs ) and natural transitions between different ambulation modes .