Gravar-mail: Automatic and real-time locomotion mode recognition of a humanoid robot