Go to the documentation of this file.00001 import exceptions
00002
00003
00004
00005
00006
00007
00008 def get_number(prompt, dtype):
00009 no_number = True
00010 number = -9999.0
00011 while no_number:
00012 print prompt
00013 str = raw_input()
00014 try:
00015 number = dtype(str)
00016 no_number = False
00017 except exceptions.ValueError, e:
00018 print 'That was not a valid %s! Try again.'%(dtype.__str__)
00019
00020 return number
00021
00022
00023 if __name__ == '__main__':
00024 import hrl_lib.util as hut
00025
00026 checkerboard_number = get_number('Enter visible hook checkerboard number (number on top right hand corner of checkerboard)',
00027 dtype = int)
00028 height = get_number('Enter height of the mechanism checkerboard origin (top left hand corner).', dtype = float)
00029 radius = get_number('Enter distance of handle (hooking location) from the hinge of door. (-1 for drawer)', dtype = float)
00030 print 'Please take a picture of the mechanism. Press enter when done'
00031 raw_input()
00032
00033 s = {
00034 'checkerboard_number': checkerboard_number,
00035 'height': height,
00036 'radius': radius
00037 }
00038
00039 hut.save_pickle(s, 'mechanism_info.pkl')
00040
00041