type=float, default=0.0, help='hysteresis threshold') parser.add_argument('pathfile', help='path waypoint file') args = parser.parse_args() # Load path waypoints. print('Loading path waypoints...') points = [] with open(args.pathfile, 'r') as pf: for line in pf.readlines(): points.append(Point(*[float(s) for s in line.rstrip().split(',')])) path = interpolate_points(points) # Set up displays and load the model. print('Loading model...') ex = Experiment(zoom=True) ex.add_display() ex.display.autoscale = True ex.display.userspin = False ex.display.forward = (0, 0, -1) ex.display.up = (0, 1, 0) ex.execute('loadmodel follow.yaml') ex.execute('loadconfig') # Compute the vision graph. if os.path.exists('vgraph.pickle'): print('Loading vision graph...') vision_graph = pickle.load(open('vgraph.pickle', 'r')) else: try: print('Computing vision graph...') vision_graph = ex.model.coverage_hypergraph(ex.tasks['scene'], K=2) with open('vgraph.pickle', 'w') as vgf:
type=int, default=100, help='interpolation pitch') parser.add_argument('-t', '--threshold', dest='threshold', type=float, default=0.0, help='hysteresis threshold') parser.add_argument('pathfile', help='path waypoint file') args = parser.parse_args() # Load path waypoints. print('Loading path waypoints...') points = [] with open(args.pathfile, 'r') as pf: for line in pf.readlines(): points.append(Point(*[float(s) for s in line.rstrip().split(',')])) path = interpolate_points(points) # Set up displays and load the model. print('Loading model...') ex = Experiment(zoom=True) ex.add_display() ex.display.autoscale = True ex.display.userspin = False ex.display.forward = (0, 0, -1) ex.display.up = (0, 1, 0) ex.execute('loadmodel follow.yaml') ex.execute('loadconfig') # Compute the vision graph. if os.path.exists('vgraph.pickle'): print('Loading vision graph...') vision_graph = pickle.load(open('vgraph.pickle', 'r')) else: try: print('Computing vision graph...') vision_graph = ex.model.coverage_hypergraph(ex.tasks['scene'], K=2) with open('vgraph.pickle', 'w') as vgf: