1
0
mirror of https://github.com/gryf/coach.git synced 2025-12-17 19:20:19 +01:00

Enabling Coach Documentation to be run even when environments are not installed (#326)

This commit is contained in:
anabwan
2019-05-27 10:46:07 +03:00
committed by Gal Leibovich
parent 2b7d536da4
commit 342b7184bc
157 changed files with 5167 additions and 7477 deletions

View File

@@ -17,7 +17,6 @@
import random
import sys
from os import path, environ
from rl_coach.logger import screen
from rl_coach.filters.action.partial_discrete_action_space_map import PartialDiscreteActionSpaceMap
from rl_coach.filters.observation.observation_rgb_to_y_filter import ObservationRGBToYFilter
@@ -27,7 +26,8 @@ try:
if 'CARLA_ROOT' in environ:
sys.path.append(path.join(environ.get('CARLA_ROOT'), 'PythonClient'))
else:
screen.error("CARLA_ROOT was not defined. Please set it to point to the CARLA root directory and try again.")
screen.error("CARLA_ROOT was not defined. Please set it to point to the CARLA root directory and try again.", crash=False)
from carla.client import CarlaClient
from carla.settings import CarlaSettings
from carla.tcp import TCPConnectionError
@@ -39,21 +39,20 @@ except ImportError:
from rl_coach.logger import failed_imports
failed_imports.append("CARLA")
import logging
import subprocess
from rl_coach.environments.environment import Environment, EnvironmentParameters, LevelSelection
from rl_coach.spaces import BoxActionSpace, ImageObservationSpace, StateSpace, \
VectorObservationSpace
from rl_coach.utils import get_open_port, force_list
from enum import Enum
import os
import signal
import logging
import subprocess
import numpy as np
from rl_coach.environments.environment import Environment, EnvironmentParameters, LevelSelection
from rl_coach.spaces import BoxActionSpace, ImageObservationSpace, StateSpace, VectorObservationSpace
from rl_coach.utils import get_open_port, force_list
from enum import Enum
from typing import List, Union
from rl_coach.base_parameters import VisualizationParameters
from rl_coach.filters.filter import InputFilter, NoOutputFilter
from rl_coach.filters.observation.observation_rescale_to_size_filter import ObservationRescaleToSizeFilter
from rl_coach.filters.observation.observation_stacking_filter import ObservationStackingFilter
import numpy as np
# enum of the available levels and their path
@@ -61,6 +60,7 @@ class CarlaLevel(Enum):
TOWN1 = {"map_name": "Town01", "map_path": "/Game/Maps/Town01"}
TOWN2 = {"map_name": "Town02", "map_path": "/Game/Maps/Town02"}
key_map = {
'BRAKE': (274,), # down arrow
'GAS': (273,), # up arrow