choices=['copter', 'drone'], default="copter") parser.add_argument('--drone', help='drone type', choices=['ar_drone', 'mock_drone'], default="mock_drone") parser.add_argument('--guard', help='guard type', choices=['copter', 'drone']) args = parser.parse_args() predictor = CopterSpeedPredictor(predictor_config) if args.world == "copter": world = CopterWorld(world_config) else: if args.drone == "ar_drone": drone = ARDrone() else: drone = MockDrone() world = DroneWorld(world_config, drone=drone) if args.controller == "CLA": controller = CopterCLAController(None) elif args.controller == "CopterPID": controller = CopterPIDController(None) elif args.controller == "DronePID": controller = DronePIDController(None) elif args.controller == "unsupervised":
if __name__ == "__main__": parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('init_y', type=int, help='starting y position') parser.add_argument('target_y', type=int, help='target y position') parser.add_argument('--log', help='path to log file') parser.add_argument('--learn', action='store_const', const=True, help='enable learning') parser.add_argument('--controller', help='controller type', choices=['PID', 'CLA'], default="PID") args = parser.parse_args() world = CopterWorld() predictor = CopterSpeedPredictor(predictor_config) if args.controller == "CLA": controller = CopterCLAController(None) else: controller = CopterPIDController(None) runner = Runner(runner_config, world, predictor, controller, learning_enabled=args.learn, target_y=args.target_y) runner.addLogger(ConsoleLogger(logger_config)) if args.log: runner.addLogger(CsvLogger(logger_config, args.log))
parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('init_y', type=int, help='starting y position') parser.add_argument('target_y', type=int, help='target y position') parser.add_argument('--log', help='path to log file') parser.add_argument('--learn', action='store_const', const=True, help='enable learning') parser.add_argument('--controller', help='controller type', choices=['PID', 'CLA'], default="PID") args = parser.parse_args() world = CopterWorld() predictor = CopterSpeedPredictor(predictor_config) if args.controller == "CLA": controller = CopterCLAController(None) else: controller = CopterPIDController(None) runner = Runner(runner_config, world, predictor, controller, learning_enabled=args.learn, target_y=args.target_y) runner.addLogger(ConsoleLogger(logger_config))