User Manual

Table Of Contents
76
def commandInput(command_input):
global direction_command, turn_command, SmoothMode, steadyMode
if 'forward' == command_input:
direction_command = 'forward' #move forward
rm.resume()
elif 'backward' == command_input:
direction_command = 'backward' #move backward
rm.resume()
elif 'stand' in command_input:
direction_command = 'stand' #stand at attention
rm.pause()
elif 'left' == command_input:
turn_command = 'left' #turn left
rm.resume()
elif 'right' == command_input:
turn_command = 'right' #turn right
rm.resume()
elif 'no' in command_input: #stop
turn_command = 'no'
rm.pause()
elif 'automaticOff' == command_input: #Switch to fast gait
SmoothMode = 0
steadyMode = 0
rm.pause()
elif 'automatic' == command_input: #Switch to slow gait
rm.resume()
SmoothMode = 1
elif 'KD' == command_input: #Self-balancing
steadyMode = 1
rm.resume()