CARLA
Loading...
Searching...
No Matches
ATagger Class Reference

Sets actors' custom depth stencil value for semantic segmentation according to their meshes. More...

#include <Tagger.h>

Inheritance diagram for ATagger:

Public Member Functions

 ATagger ()

Static Public Member Functions

static FLinearColor GetActorLabelColor (const AActor &Actor, const crp::CityObjectLabel &Label)
static crp::CityObjectLabel GetLabelByFolderName (const FString &String)
 Method that computes the label corresponding to a folder path.
template<typename T>
static crp::CityObjectLabel GetLabelByPath (const T *Object)
 Method that computes the label corresponding to an specific object using the folder path in which it is stored.
template<typename T>
static crp::CityObjectLabel GetLabelByPath (TObjectPtr< T > Object)
 Method that computes the label corresponding to an specific object using the folder path in which it is stored.
static FString GetTagAsString (crp::CityObjectLabel Tag)
 Transform a CityObjectLabel into a string.
static crp::CityObjectLabel GetTagFromName (const FName &Tag)
 Transform a tag name into a CityObjectLabel.
static crp::CityObjectLabel GetTagFromString (FString Tag)
 Transform a string into a CityObjectLabel.
static crp::CityObjectLabel GetTagOfTaggedComponent (const UPrimitiveComponent &Component)
 Retrieve the tag of an already tagged component.
static void GetTagsOfTaggedActor (const AActor &Actor, TSet< crp::CityObjectLabel > &Tags)
 Retrieve the tags of an already tagged actor.
static bool IsThing (const crp::CityObjectLabel &Label)
static bool MatchComponent (const UPrimitiveComponent &Component, crp::CityObjectLabel Tag)
 Return true if Component has been tagged with the given Tag.
static void SetStencilValue (UPrimitiveComponent &Component, const uint32 ActorID, const crp::CityObjectLabel &Label, const bool bSetRenderCustomDepth)
static void TagActor (const AActor &Actor, bool bTagForSemanticSegmentation)
 Set the tag of an actor.
static void TagActorsInLevel (ULevel &Level, bool bTagForSemanticSegmentation)
static void TagActorsInLevel (UWorld &World, bool bTagForSemanticSegmentation)
 Set the tag of every actor in level.

Private Attributes

bool bTagForSemanticSegmentation = false
bool bTriggerTagObjects = false

Detailed Description

Sets actors' custom depth stencil value for semantic segmentation according to their meshes.

Non-static functions present so it can be dropped into the scene for testing purposes.

Definition at line 28 of file Tagger.h.

Constructor & Destructor Documentation

◆ ATagger()

ATagger::ATagger ( )

Definition at line 313 of file Tagger.cpp.

Member Function Documentation

◆ GetActorLabelColor()

FLinearColor ATagger::GetActorLabelColor ( const AActor & Actor,
const crp::CityObjectLabel & Label )
static

Definition at line 97 of file Tagger.cpp.

References CastEnum().

◆ GetLabelByFolderName()

◆ GetLabelByPath() [1/2]

template<typename T>
crp::CityObjectLabel ATagger::GetLabelByPath ( const T * Object)
inlinestatic

Method that computes the label corresponding to an specific object using the folder path in which it is stored.

Definition at line 81 of file Tagger.h.

References GetLabelByFolderName(), and carla::rpc::None.

Referenced by GetLabelByPath(), and TagActor().

◆ GetLabelByPath() [2/2]

template<typename T>
crp::CityObjectLabel ATagger::GetLabelByPath ( TObjectPtr< T > Object)
inlinestatic

Method that computes the label corresponding to an specific object using the folder path in which it is stored.

Definition at line 128 of file Tagger.h.

References GetLabelByPath().

◆ GetTagAsString()

◆ GetTagFromName()

crp::CityObjectLabel ATagger::GetTagFromName ( const FName & Tag)
static

Transform a tag name into a CityObjectLabel.

Definition at line 192 of file Tagger.cpp.

References GetTagAsString(), GetTagFromString(), and carla::rpc::Rock.

Referenced by GetTagOfTaggedComponent().

◆ GetTagFromString()

◆ GetTagOfTaggedComponent()

◆ GetTagsOfTaggedActor()

void ATagger::GetTagsOfTaggedActor ( const AActor & Actor,
TSet< crp::CityObjectLabel > & Tags )
static

Retrieve the tags of an already tagged actor.

CityObjectLabel::None is not added to the array.

Definition at line 221 of file Tagger.cpp.

References GetTagOfTaggedComponent(), and carla::rpc::None.

Referenced by FActorRegistry::MakeCarlaActor(), and UCarlaEpisode::SerializeActor().

◆ IsThing()

◆ MatchComponent()

bool ATagger::MatchComponent ( const UPrimitiveComponent & Component,
crp::CityObjectLabel Tag )
inlinestatic

Return true if Component has been tagged with the given Tag.

Definition at line 61 of file Tagger.h.

References GetTagOfTaggedComponent().

Referenced by LineTrace().

◆ SetStencilValue()

void ATagger::SetStencilValue ( UPrimitiveComponent & Component,
const uint32 ActorID,
const crp::CityObjectLabel & Label,
const bool bSetRenderCustomDepth )
static

Definition at line 63 of file Tagger.cpp.

References CastEnum().

Referenced by FCarlaServer::FPimpl::BindActions(), and TagActor().

◆ TagActor()

void ATagger::TagActor ( const AActor & Actor,
bool bTagForSemanticSegmentation )
static

Set the tag of an actor.

If bTagForSemanticSegmentation true, activate the custom depth pass. This pass is necessary for rendering the semantic segmentation. However, it may add a performance penalty since occlusion doesn't seem to be applied to objects having this value active.

Definition at line 130 of file Tagger.cpp.

References ATagger_SetLabelTag(), bTagForSemanticSegmentation, GetLabelByPath(), GetTagAsString(), carla::rpc::Pedestrians, carla::rpc::Rider, and SetStencilValue().

Referenced by ALargeMapManager::ConvertDormantToActiveActors(), UTaggerDelegate::OnActorSpawned(), UActorDispatcher::SpawnActor(), TagActorsInLevel(), TagActorsInLevel(), and AWalkerBase::TagWheelchair().

◆ TagActorsInLevel() [1/2]

void ATagger::TagActorsInLevel ( ULevel & Level,
bool bTagForSemanticSegmentation )
static

Definition at line 185 of file Tagger.cpp.

References bTagForSemanticSegmentation, and TagActor().

◆ TagActorsInLevel() [2/2]

void ATagger::TagActorsInLevel ( UWorld & World,
bool bTagForSemanticSegmentation )
static

Set the tag of every actor in level.

If bTagForSemanticSegmentation true, activate the custom depth pass. This pass is necessary for rendering the semantic segmentation. However, it may add a performance penalty since occlusion doesn't seem to be applied to objects having this value active.

Definition at line 177 of file Tagger.cpp.

References bTagForSemanticSegmentation, and TagActor().

Referenced by ACarlaGameModeBase::BeginPlay(), ACityMapGenerator::GenerateRoadMap(), ACarlaGameModeBase::OnLevelAddedToWorld(), ALargeMapManager::OnLevelAddedToWorld(), and ACarlaGameModeBase::OnLoadStreamLevel().

Member Data Documentation

◆ bTagForSemanticSegmentation

bool ATagger::bTagForSemanticSegmentation = false
private

Definition at line 155 of file Tagger.h.

Referenced by TagActor(), TagActorsInLevel(), and TagActorsInLevel().

◆ bTriggerTagObjects

bool ATagger::bTriggerTagObjects = false
private

Definition at line 152 of file Tagger.h.


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