Skip to content

Configurations

Configuration pydantic-model ¤

car_color: CarlaCarColor pydantic-field ¤

Your Vehicle Color

carla_vehicle_blueprint_filter: str pydantic-field ¤

For more detail, see https://carla.readthedocs.io/en/0.9.9/bp_library/

carla_version: str pydantic-field ¤

carla_weather: CarlaWeather pydantic-field ¤

Weather Setting

fixed_delta_seconds: float pydantic-field ¤

Note that for us, this will ONLY take effect when you are on sync mode. https://carla.readthedocs.io/en/0.9.9/adv_synchrony_timestep/#client-server-synchrony

gamma: float pydantic-field ¤

Gamma Correction of the camera

height: int pydantic-field ¤

host: str pydantic-field ¤

The IP Address of the Carla Server

no_rendering_mode: bool pydantic-field ¤

https://carla.readthedocs.io/en/0.9.9/adv_rendering_options/

npc_config_file_path: str pydantic-field ¤

port: int pydantic-field ¤

The Port number of the Carla Server

print_keyboard_hint: bool pydantic-field ¤

role_name: str pydantic-field ¤

Your name in Carla, can be used to correctly identify you later

save_semantic_segmentation: bool pydantic-field ¤

should_spawn_npcs: bool pydantic-field ¤

synchronous_mode: bool pydantic-field ¤

https://carla.readthedocs.io/en/0.9.9/adv_synchrony_timestep/#client-server-synchrony

timeout: float pydantic-field ¤

width: int pydantic-field ¤

__config__ ¤

__json_encoder__(obj) special staticmethod ¤

import_carla() ¤

Source code in configurations/configuration.py
def import_carla():
    from pathlib import Path
    import os, sys

    # clear path s.t. path contains no carla

    sys.path = [p for p in sys.path if "carla" not in p]
    if "carla" in sys.modules:
        del sys.modules["carla"]
    roar_sim_folder_path = Path(os.getcwd())/ "ROAR_Sim"

    if roar_sim_folder_path.exists() is False:
        roar_sim_folder_path = Path(os.getcwd()).parent / "ROAR_Sim"
    if roar_sim_folder_path.exists() is False:
        roar_sim_folder_path = Path(os.getcwd()).parent.parent / "ROAR_Sim"

    carla_version_file_path = roar_sim_folder_path / "configurations" / "carla_version.txt"
    carla_version = (carla_version_file_path.open('r').readline()).strip()
    carla_client_folder_path = roar_sim_folder_path / "carla_client"

    if sys.platform == 'darwin':
        assert False, "MacOS is currently not supported"

    carla_client_egg_file_name = f'carla-{carla_version}-py3.7-win-amd64.egg' if \
        sys.platform == "win32" else f"carla-{carla_version}-py3.6-linux-x86_64.egg"
    carla_client_egg_file_path = carla_client_folder_path / carla_client_egg_file_name
    if not carla_client_egg_file_path.is_file():
        raise FileNotFoundError(
            "Please make sure carla client distribution is installed under the "
            "carla_client directory")
    sys.path.append(carla_client_egg_file_path.as_posix())
    import carla