Automatize tagging for semantic segmentation
This commit is contained in:
parent
af9841768f
commit
f11870f32a
|
@ -13,6 +13,7 @@
|
|||
#include "CarlaPlayerState.h"
|
||||
#include "CarlaSettings.h"
|
||||
#include "CarlaVehicleController.h"
|
||||
#include "Tagger.h"
|
||||
|
||||
ACarlaGameMode::ACarlaGameMode() :
|
||||
Super(),
|
||||
|
@ -69,6 +70,7 @@ void ACarlaGameMode::RestartPlayer(AController* NewPlayer)
|
|||
void ACarlaGameMode::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
TagObjectsForSemanticSegmentation();
|
||||
GameController->BeginPlay();
|
||||
}
|
||||
|
||||
|
@ -100,6 +102,13 @@ void ACarlaGameMode::AttachCaptureCamerasToPlayer(AController &Player)
|
|||
}
|
||||
}
|
||||
|
||||
void ACarlaGameMode::TagObjectsForSemanticSegmentation()
|
||||
{
|
||||
auto Tagger = GetWorld()->SpawnActor<ATagger>();
|
||||
Tagger->TagObjects();
|
||||
Tagger->Destroy(); // We don't need you anymore.
|
||||
}
|
||||
|
||||
APlayerStart *ACarlaGameMode::FindUnOccupiedStartPoints(
|
||||
AController *Player,
|
||||
TArray<APlayerStart *> &UnOccupiedStartPoints)
|
||||
|
|
|
@ -35,6 +35,8 @@ private:
|
|||
|
||||
void AttachCaptureCamerasToPlayer(AController &Player);
|
||||
|
||||
void TagObjectsForSemanticSegmentation();
|
||||
|
||||
/// Iterate all the APlayerStart present in the world and add the ones with
|
||||
/// unoccupied locations to @a UnOccupiedStartPoints.
|
||||
///
|
||||
|
|
|
@ -14,6 +14,8 @@ public:
|
|||
|
||||
ATagger();
|
||||
|
||||
void TagObjects();
|
||||
|
||||
protected:
|
||||
|
||||
#if WITH_EDITOR
|
||||
|
@ -22,8 +24,6 @@ protected:
|
|||
|
||||
private:
|
||||
|
||||
void TagObjects();
|
||||
|
||||
UPROPERTY(Category = "Tagger", EditAnywhere)
|
||||
bool bTriggerTagObjects = false;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue