Automatize tagging for semantic segmentation

This commit is contained in:
nsubiron 2017-04-21 14:47:38 +02:00
parent af9841768f
commit f11870f32a
3 changed files with 13 additions and 2 deletions

View File

@ -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)

View File

@ -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.
///

View File

@ -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;
};