changed input parser a bit
This commit is contained in:
@@ -273,25 +273,37 @@ if __name__ == '__main__':
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
args=''
|
# allow additional arguments when running the function like
|
||||||
|
# stand
|
||||||
|
# rest
|
||||||
|
# kick
|
||||||
|
|
||||||
|
# try to readout arguments
|
||||||
try:
|
try:
|
||||||
args=sys.argv[1]
|
args=sys.argv[1]
|
||||||
except:
|
except NameError:
|
||||||
print("error")
|
args=''
|
||||||
|
|
||||||
|
# check input argument
|
||||||
if args:
|
if args:
|
||||||
|
|
||||||
|
# bring robot in stand_up position
|
||||||
if args == 'stand':
|
if args == 'stand':
|
||||||
striker.mover.stand_up()
|
striker.mover.stand_up()
|
||||||
|
|
||||||
|
# bring robot in rest postion
|
||||||
elif args == 'rest':
|
elif args == 'rest':
|
||||||
striker.mover.rest()
|
striker.mover.rest()
|
||||||
|
|
||||||
|
# perform a fancy kick
|
||||||
elif args == 'kick':
|
elif args == 'kick':
|
||||||
striker.mover.stand_up()
|
striker.mover.stand_up()
|
||||||
striker.mover.kick()
|
striker.mover.kick()
|
||||||
striker.mover.rest()
|
striker.mover.rest()
|
||||||
|
|
||||||
|
# perform normal state-machine if no input argument is given
|
||||||
else:
|
else:
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# start with ball tracking first
|
# start with ball tracking first
|
||||||
state = 'tracking'
|
state = 'tracking'
|
||||||
|
|||||||
Reference in New Issue
Block a user