CARLA
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
UCarlaSettings Class Reference

Global settings for CARLA. More...

#include <CarlaSettings.h>

+ Inheritance diagram for UCarlaSettings:

Public Member Functions

EQualityLevel GetQualityLevel () const
 
void LoadSettings ()
 Load the settings based on the command-line arguments and the INI file if provided.
 
void LoadSettingsFromString (const FString &INIFileContents)
 Load the settings from the given string (formatted as INI).
 
void LogSettings () const
 Log settings values.
 
void SetQualityLevel (EQualityLevel InQualityLevel)
 Sets the new quality settings level and make changes in the game related to it.
 

Public Attributes

CARLA Server
uint32 RPCPort = 2000u
 World port to listen for client connections.
 
uint32 StreamingPort = 2001u
 setting for the streaming port.
 
uint32 SecondaryPort = 2002u
 setting for the secondary servers port.
 
std::string PrimaryIP = ""
 setting for the IP and Port of the primary server to connect.
 
uint32 PrimaryPort = 2002u
 
bool bSynchronousMode = false
 In synchronous mode, CARLA waits every tick until the control from the client is received.
 
bool bDisableRendering = false
 Enable or disable the viewport rendering of the world.
 

Static Public Attributes

static const FName CARLA_ROAD_TAG = FName("CARLA_ROAD")
 CARLA_ROAD name to tag road mesh actors.
 
static const FName CARLA_SKY_TAG = FName("CARLA_SKY")
 CARLA_SKY name to tag the sky sphere (BPS) actors in the scenes.
 

Private Member Functions

void LoadSettingsFromFile (const FString &FilePath, bool bLogOnFailure)
 

Private Attributes

FString CurrentFileName
 File name of the settings file used to load this settings.
 

Quality Settings

EQualityLevel QualityLevel = EQualityLevel::Epic
 Quality Settings level.
 
 UPROPERTY (Category="Quality Settings/Epic", BlueprintReadOnly, EditAnywhere, config, DisplayName="Road Materials List for EPIC Quality") TArray< FStaticMaterial > EpicRoadMaterials
 EPIC quality Road Materials.
 
 UPROPERTY (Category="Quality Settings/ROS2", BlueprintReadOnly, EditAnywhere, config, DisplayName="Enable ROS2") bool ROS2
 Enable ROS2.
 
 UPROPERTY (Category="Quality Settings/ROS2", BlueprintReadOnly, EditAnywhere, config, DisplayName="ROS2 Topics Visible On Startup") bool ROS2TopicVisibility
 Default ROS2 topic visibility on startup.
 
 UPROPERTY (Category="Quality Settings/ROS2", BlueprintReadOnly, EditAnywhere, config, DisplayName="ROS2 RMW") FString RmwName
 DDS middleware (RMW) used by the native ROS2 connector.
 
 UPROPERTY (Category="Quality Settings/ROS2", BlueprintReadOnly, EditAnywhere, config, DisplayName="ROS2 Domain ID") int32 ROS2DomainId
 ROS2 domain id.
 

Detailed Description

Global settings for CARLA.

Setting object used to hold both config settings and editable ones in one place. To ensure the settings are saved to the specified config file make sure to add props using the globalconfig or config meta.

Definition at line 22 of file CarlaSettings.h.

Member Function Documentation

◆ GetQualityLevel()

EQualityLevel UCarlaSettings::GetQualityLevel ( ) const
inline
Returns
current quality settings level (could not have been applied yet).

Definition at line 42 of file CarlaSettings.h.

Referenced by UCarlaSettingsDelegate::ApplyQualityLevelPostRestart().

◆ LoadSettings()

void UCarlaSettings::LoadSettings ( )

Load the settings based on the command-line arguments and the INI file if provided.

Definition at line 114 of file CarlaSettings.cpp.

References bDisableRendering, CurrentFileName, Epic, GetSettingsFilePathFromCommandLine(), LoadSettingsFromFile(), PrimaryIP, PrimaryPort, QualityLevel, QualityLevelFromString(), RPCPort, SecondaryPort, and StreamingPort.

Referenced by UCarlaGameInstance::UCarlaGameInstance().

◆ LoadSettingsFromFile()

void UCarlaSettings::LoadSettingsFromFile ( const FString &  FilePath,
bool  bLogOnFailure 
)
private

Definition at line 216 of file CarlaSettings.cpp.

References CurrentFileName, and LoadSettingsFromConfig().

Referenced by LoadSettings().

◆ LoadSettingsFromString()

void UCarlaSettings::LoadSettingsFromString ( const FString &  INIFileContents)

Load the settings from the given string (formatted as INI).

CarlaServer section is ignored.

Definition at line 185 of file CarlaSettings.cpp.

References CurrentFileName, LoadSettingsFromConfig(), and FIniFile::ProcessInputFileContents().

◆ LogSettings()

void UCarlaSettings::LogSettings ( ) const

◆ SetQualityLevel()

void UCarlaSettings::SetQualityLevel ( EQualityLevel  InQualityLevel)
inline

Sets the new quality settings level and make changes in the game related to it.

Note
This will not apply the quality settings. Use ApplyQualitySettings functions instead
Parameters
InQualityLevelStore the new quality.

Definition at line 35 of file CarlaSettings.h.

Referenced by LoadSettingsFromConfig().

◆ UPROPERTY() [1/5]

UCarlaSettings::UPROPERTY ( Category  = "Quality Settings/Epic",
BlueprintReadOnly  ,
EditAnywhere  ,
config  ,
DisplayName  = "Road Materials List for EPIC Quality" 
)

EPIC quality Road Materials.

Uses slots name to set material for each part of the road for Epic quality.

◆ UPROPERTY() [2/5]

UCarlaSettings::UPROPERTY ( Category  = "Quality Settings/ROS2",
BlueprintReadOnly  ,
EditAnywhere  ,
config  ,
DisplayName  = "Enable ROS2" 
)

Enable ROS2.

◆ UPROPERTY() [3/5]

UCarlaSettings::UPROPERTY ( Category  = "Quality Settings/ROS2",
BlueprintReadOnly  ,
EditAnywhere  ,
config  ,
DisplayName  = "ROS2 Domain ID" 
)

ROS2 domain id.

Set via –ros-domain-id=<N> on the command line. -1 (the default) keeps each middleware's native default domain.

◆ UPROPERTY() [4/5]

UCarlaSettings::UPROPERTY ( Category  = "Quality Settings/ROS2",
BlueprintReadOnly  ,
EditAnywhere  ,
config  ,
DisplayName  = "ROS2 RMW" 
)

DDS middleware (RMW) used by the native ROS2 connector.

Accepted values: "fastdds" (default) and "cyclonedds". Set via the –rmw= command-line argument. CycloneDDS is only available on Linux.

◆ UPROPERTY() [5/5]

UCarlaSettings::UPROPERTY ( Category  = "Quality Settings/ROS2",
BlueprintReadOnly  ,
EditAnywhere  ,
config  ,
DisplayName  = "ROS2 Topics Visible On Startup" 
)

Default ROS2 topic visibility on startup.

When true, every topic offered by the implementation is visible from the beginning; when false, only the sensors/actors explicitly enabled via EnableForROS calls are visible.

Member Data Documentation

◆ bDisableRendering

bool UCarlaSettings::bDisableRendering = false

Enable or disable the viewport rendering of the world.

Disabled by default.

Definition at line 104 of file CarlaSettings.h.

Referenced by UCarlaSettingsDelegate::ApplyQualityLevelPreRestart(), LoadSettings(), LoadSettingsFromConfig(), and LogSettings().

◆ bSynchronousMode

bool UCarlaSettings::bSynchronousMode = false

In synchronous mode, CARLA waits every tick until the control from the client is received.

Definition at line 99 of file CarlaSettings.h.

Referenced by LoadSettingsFromConfig(), and LogSettings().

◆ CARLA_ROAD_TAG

const FName UCarlaSettings::CARLA_ROAD_TAG = FName("CARLA_ROAD")
static

◆ CARLA_SKY_TAG

const FName UCarlaSettings::CARLA_SKY_TAG = FName("CARLA_SKY")
static

CARLA_SKY name to tag the sky sphere (BPS) actors in the scenes.

Definition at line 64 of file CarlaSettings.h.

Referenced by UCarlaSettingsDelegate::ApplyPerActorQualitySettings(), and UCarlaSettingsDelegate::SetAllActorsDrawDistance().

◆ CurrentFileName

FString UCarlaSettings::CurrentFileName
private

File name of the settings file used to load this settings.

Empty if none used.

Definition at line 73 of file CarlaSettings.h.

Referenced by LoadSettings(), LoadSettingsFromFile(), LoadSettingsFromString(), and LogSettings().

◆ PrimaryIP

std::string UCarlaSettings::PrimaryIP = ""

setting for the IP and Port of the primary server to connect.

Definition at line 93 of file CarlaSettings.h.

Referenced by LoadSettings(), LoadSettingsFromConfig(), and FCarlaEngine::NotifyInitGame().

◆ PrimaryPort

uint32 UCarlaSettings::PrimaryPort = 2002u

◆ QualityLevel

EQualityLevel UCarlaSettings::QualityLevel = EQualityLevel::Epic
private

Quality Settings level.

Definition at line 115 of file CarlaSettings.h.

Referenced by LoadSettings(), and LogSettings().

◆ RPCPort

uint32 UCarlaSettings::RPCPort = 2000u

World port to listen for client connections.

Definition at line 84 of file CarlaSettings.h.

Referenced by LoadSettings(), LoadSettingsFromConfig(), LogSettings(), and FCarlaEngine::NotifyInitGame().

◆ SecondaryPort

uint32 UCarlaSettings::SecondaryPort = 2002u

setting for the secondary servers port.

Definition at line 90 of file CarlaSettings.h.

Referenced by LoadSettings(), LoadSettingsFromConfig(), LogSettings(), and FCarlaEngine::NotifyInitGame().

◆ StreamingPort

uint32 UCarlaSettings::StreamingPort = 2001u

setting for the streaming port.

Definition at line 87 of file CarlaSettings.h.

Referenced by LoadSettings(), LoadSettingsFromConfig(), LogSettings(), and FCarlaEngine::NotifyInitGame().


The documentation for this class was generated from the following files: