| 817 | self.actors_surface = None |
| 818 | |
| 819 | def _get_data_from_carla(self): |
| 820 | try: |
| 821 | self.client = carla.Client(self.args.host, self.args.port) |
| 822 | self.client.set_timeout(self.timeout) |
| 823 | |
| 824 | if self.args.map is None: |
| 825 | world = self.client.get_world() |
| 826 | else: |
| 827 | world = self.client.load_world(self.args.map) |
| 828 | |
| 829 | town_map = world.get_map() |
| 830 | return (world, town_map) |
| 831 | |
| 832 | except RuntimeError as ex: |
| 833 | logging.error(ex) |
| 834 | exit_game() |
| 835 | |
| 836 | def start(self): |
| 837 | self.world, self.town_map = self._get_data_from_carla() |