User Manual

Table Of Contents
73
In webserver.py, use the functionSelect() function to start the action of the robot:
def functionSelect(command_input, response):
global direction_command, turn_command, SmoothMode, steadyMode, functionMode
if 'scan' == command_input:
pass
elif 'findColor' == command_input:
flask_app.modeselect('findColor')
elif 'motionGet' == command_input: # Moving object detection
flask_app.modeselect('watchDog')
elif 'stopCV' == command_input:
flask_app.modeselect('none')
switch.switch(1,0)
switch.switch(2,0)
switch.switch(3,0)
elif 'KD' == command_input: #Self-balancing
move.commandInput(command_input)
elif 'automaticOff' == command_input: # switch to default fast gait
move.commandInput(command_input)
elif 'automatic' == command_input: # switch to slow gait
move.commandInput(command_input)
elif 'trackLine' == command_input: # track line on
flask_app.modeselect('findlineCV')
elif 'trackLineOff' == command_input: # track line off
flask_app.modeselect('none')
elif 'speech' == command_input: # turn on the alarm light
RL.police()
elif 'speechOff' == command_input: # turn off the alarm light
RL.pause()