User Manual

Table Of Contents
72
def robotCtrl(command_input, response):
global direction_command, turn_command
if 'forward' == command_input: #move forward
direction_command = 'forward'
move.commandInput(direction_command) #move backward
elif 'backward' == command_input:
direction_command = 'backward'
move.commandInput(direction_command)
elif 'DS' in command_input: #stop
direction_command = 'stand'
move.commandInput(direction_command)
elif 'left' == command_input: #turn left
turn_command = 'left'
move.commandInput(turn_command)
elif 'right' == command_input: #turn right
turn_command = 'right'
move.commandInput(turn_command)
elif 'TS' in command_input: #stop
turn_command = 'no'
move.commandInput(turn_command)
elif 'lookleft' == command_input: # the platform turns left
P_sc.singleServo(12, 1, 7)
elif 'lookright' == command_input: #the platform turns right
P_sc.singleServo(12,-1, 7)
elif 'LRstop' in command_input: #the platform stops turning left and right
P_sc.stopWiggle()
elif 'up' == command_input: #platform turns upward
T_sc.singleServo(13, -1, 7)
elif 'down' == command_input: #platform turns downward
T_sc.singleServo(13, 1, 7)
elif 'UDstop' in command_input: #the platform stops turning up and down
T_sc.stopWiggle()