(self, path_to_conf_file, ckpt="roach/log/ckpt_11833344.pth")
| 68 | |
| 69 | class ROACHAgent(autonomous_agent.AutonomousAgent): |
| 70 | def setup(self, path_to_conf_file, ckpt="roach/log/ckpt_11833344.pth"): |
| 71 | self._render_dict = None |
| 72 | self.supervision_dict = None |
| 73 | self._ckpt = ckpt |
| 74 | cfg = OmegaConf.load(path_to_conf_file) |
| 75 | cfg = OmegaConf.to_container(cfg) |
| 76 | self.cfg = cfg |
| 77 | self._obs_configs = cfg['obs_configs'] |
| 78 | self._train_cfg = cfg['training'] |
| 79 | self._policy_class = load_entry_point(cfg['policy']['entry_point']) |
| 80 | self._policy_kwargs = cfg['policy']['kwargs'] |
| 81 | if self._ckpt is None: |
| 82 | self._policy = None |
| 83 | else: |
| 84 | self._policy, self._train_cfg['kwargs'] = self._policy_class.load(self._ckpt) |
| 85 | self._policy = self._policy.eval() |
| 86 | self._wrapper_class = load_entry_point(cfg['env_wrapper']['entry_point']) |
| 87 | self._wrapper_kwargs = cfg['env_wrapper']['kwargs'] |
| 88 | |
| 89 | self.track = autonomous_agent.Track.SENSORS |
| 90 | self.config_path = path_to_conf_file |
| 91 | self.step = -1 |
| 92 | self.wall_start = time.time() |
| 93 | self.initialized = False |
| 94 | |
| 95 | self._3d_bb_distance = 50 |
| 96 | |
| 97 | self.prev_lidar = None |
| 98 | |
| 99 | self.save_path = None |
| 100 | if SAVE_PATH is not None: |
| 101 | now = datetime.datetime.now() |
| 102 | string = pathlib.Path(os.environ['ROUTES']).stem + '_' |
| 103 | string += '_'.join(map(lambda x: '%02d' % x, (now.month, now.day, now.hour, now.minute, now.second))) |
| 104 | |
| 105 | |
| 106 | self.save_path = pathlib.Path(os.environ['SAVE_PATH']) / string |
| 107 | self.save_path.mkdir(parents=True, exist_ok=False) |
| 108 | |
| 109 | (self.save_path / 'rgb').mkdir() |
| 110 | (self.save_path / 'measurements').mkdir() |
| 111 | (self.save_path / 'supervision').mkdir() |
| 112 | (self.save_path / 'bev').mkdir() |
| 113 | |
| 114 | def _init(self): |
| 115 | self._waypoint_planner = RoutePlanner(4.0, 50) |
nothing calls this directly
no test coverage detected