CARLA
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AOpenDriveGenerator Class Reference

#include <OpenDriveGenerator.h>

+ Inheritance diagram for AOpenDriveGenerator:
+ Collaboration diagram for AOpenDriveGenerator:

Public Member Functions

 AOpenDriveGenerator (const FObjectInitializer &ObjectInitializer)
 
void GenerateAll ()
 
void GeneratePoles ()
 Generates pole meshes based on the OpenDRIVE information. More...
 
void GenerateRoadMesh ()
 Generates the road and sidewalk mesh based on the OpenDRIVE information. More...
 
void GenerateSpawnPoints ()
 Generates spawn points along the road. More...
 
const FString & GetOpenDrive () const
 Get the OpenDRIVE information as string. More...
 
bool IsOpenDriveValid () const
 Checks if the OpenDrive has been loaded and it's valid. More...
 
bool LoadOpenDrive (const FString &OpenDrive)
 Set the OpenDRIVE information as string and generates the queryable map structure. More...
 

Protected Member Functions

virtual void BeginPlay () override
 

Protected Attributes

TArray< AActor * > ActorMeshList
 
FString OpenDriveData
 
float SpawnersHeight = 300.f
 Determine the height where the spawners will be placed, relative to each RoutePlanner. More...
 
TArray< AVehicleSpawnPoint * > VehicleSpawners
 

Detailed Description

Definition at line 33 of file OpenDriveGenerator.h.

Constructor & Destructor Documentation

◆ AOpenDriveGenerator()

AOpenDriveGenerator::AOpenDriveGenerator ( const FObjectInitializer &  ObjectInitializer)

Definition at line 28 of file OpenDriveGenerator.cpp.

Member Function Documentation

◆ BeginPlay()

void AOpenDriveGenerator::BeginPlay ( )
overrideprotectedvirtual

Definition at line 168 of file OpenDriveGenerator.cpp.

References GenerateAll(), UOpenDrive::GetXODR(), and LoadOpenDrive().

+ Here is the call graph for this function:

◆ GenerateAll()

void AOpenDriveGenerator::GenerateAll ( )

Definition at line 161 of file OpenDriveGenerator.cpp.

References GeneratePoles(), GenerateRoadMesh(), and GenerateSpawnPoints().

Referenced by BeginPlay().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GeneratePoles()

void AOpenDriveGenerator::GeneratePoles ( )

Generates pole meshes based on the OpenDRIVE information.

TODO: To implement

Definition at line 132 of file OpenDriveGenerator.cpp.

References IsOpenDriveValid().

Referenced by GenerateAll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateRoadMesh()

void AOpenDriveGenerator::GenerateRoadMesh ( )

Generates the road and sidewalk mesh based on the OpenDRIVE information.

Definition at line 61 of file OpenDriveGenerator.cpp.

References ActorMeshList, carla::rpc::OpendriveGenerationParameters::enable_mesh_visibility, UCarlaStatics::GetGameInstance(), UCarlaStatics::GetGameMode(), ACarlaGameModeBase::GetMap(), UCarlaGameInstance::GetOpendriveGenerationParameters(), IsOpenDriveValid(), carla::log_warning(), AProceduralMeshActor::MeshComponent, FProceduralCustomMesh::Normals, FProceduralCustomMesh::Triangles, and FProceduralCustomMesh::Vertices.

Referenced by GenerateAll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GenerateSpawnPoints()

void AOpenDriveGenerator::GenerateSpawnPoints ( )

Generates spawn points along the road.

Definition at line 142 of file OpenDriveGenerator.cpp.

References UCarlaStatics::GetGameMode(), ACarlaGameModeBase::GetMap(), IsOpenDriveValid(), SpawnersHeight, and VehicleSpawners.

Referenced by GenerateAll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetOpenDrive()

const FString & AOpenDriveGenerator::GetOpenDrive ( ) const

Get the OpenDRIVE information as string.

Definition at line 51 of file OpenDriveGenerator.cpp.

References OpenDriveData.

◆ IsOpenDriveValid()

bool AOpenDriveGenerator::IsOpenDriveValid ( ) const

Checks if the OpenDrive has been loaded and it's valid.

Definition at line 56 of file OpenDriveGenerator.cpp.

References UCarlaStatics::GetGameMode(), and ACarlaGameModeBase::GetMap().

Referenced by GeneratePoles(), GenerateRoadMesh(), and GenerateSpawnPoints().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadOpenDrive()

bool AOpenDriveGenerator::LoadOpenDrive ( const FString &  OpenDrive)

Set the OpenDRIVE information as string and generates the queryable map structure.

Definition at line 37 of file OpenDriveGenerator.cpp.

References OpenDriveData.

Referenced by BeginPlay().

+ Here is the caller graph for this function:

Member Data Documentation

◆ ActorMeshList

TArray<AActor *> AOpenDriveGenerator::ActorMeshList
protected

Definition at line 78 of file OpenDriveGenerator.h.

Referenced by GenerateRoadMesh().

◆ OpenDriveData

FString AOpenDriveGenerator::OpenDriveData
protected

Definition at line 75 of file OpenDriveGenerator.h.

Referenced by GetOpenDrive(), and LoadOpenDrive().

◆ SpawnersHeight

float AOpenDriveGenerator::SpawnersHeight = 300.f
protected

Determine the height where the spawners will be placed, relative to each RoutePlanner.

Definition at line 69 of file OpenDriveGenerator.h.

Referenced by GenerateSpawnPoints().

◆ VehicleSpawners

TArray<AVehicleSpawnPoint *> AOpenDriveGenerator::VehicleSpawners
protected

Definition at line 72 of file OpenDriveGenerator.h.

Referenced by GenerateSpawnPoints().


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