Fixed warnings. Fixed missing assets in package.

This commit is contained in:
Axel1092 2020-03-27 16:54:55 +01:00 committed by Axel1092
parent a89e505785
commit d140688042
4 changed files with 21 additions and 24 deletions

View File

@ -134,16 +134,16 @@ void UStopSignComponent::InitializeSign(const carla::road::Map &Map)
}
while (!WaypointQueue.empty())
{
auto CurrentWaypoint = WaypointQueue.front();
auto CurrentElement = WaypointQueue.front();
WaypointQueue.pop();
GenerateCheckBox(Map.ComputeTransform(CurrentWaypoint.second), UEBoxSize);
GenerateCheckBox(Map.ComputeTransform(CurrentElement.second), UEBoxSize);
float Speed = Map.GetLane(CurrentWaypoint.second).GetRoad()->GetInfo<carla::road::element::RoadInfoSpeed>(CurrentWaypoint.second.s)->GetSpeed();
float Speed = Map.GetLane(CurrentElement.second).GetRoad()->GetInfo<carla::road::element::RoadInfoSpeed>(CurrentElement.second.s)->GetSpeed();
carla::log_warning("Speed:", Speed);
float RemainingTime = CurrentWaypoint.first - BoxSize/Speed;
float RemainingTime = CurrentElement.first - BoxSize/Speed;
if(RemainingTime > 0)
{
Previous = Map.GetPrevious(CurrentWaypoint.second, 2*BoxSize);
Previous = Map.GetPrevious(CurrentElement.second, 2*BoxSize);
for (auto & Prev : Previous)
{
WaypointQueue.push({RemainingTime, Prev});

View File

@ -23,30 +23,27 @@ ATrafficLightManager::ATrafficLightManager()
RootComponent = SceneComponent;
// Hard codded default traffic light blueprint
static ConstructorHelpers::FObjectFinder<UBlueprint> TrafficLightFinder(
TEXT( "Blueprint'/Game/Carla/Blueprints/TrafficLight/BP_TLOpenDrive.BP_TLOpenDrive'" ) );
static ConstructorHelpers::FClassFinder<AActor> TrafficLightFinder(
TEXT( "/Game/Carla/Blueprints/TrafficLight/BP_TLOpenDrive" ) );
if (TrafficLightFinder.Succeeded())
{
TSubclassOf<AActor> Model;
Model = TrafficLightFinder.Object->GeneratedClass;
TSubclassOf<AActor> Model = TrafficLightFinder.Class;
TrafficLightModel = Model;
}
// Default traffic signs models
static ConstructorHelpers::FObjectFinder<UBlueprint> StopFinder(
TEXT( "Blueprint'/Game/Carla/Static/TrafficSigns/BP_Stop.BP_Stop'" ) );
static ConstructorHelpers::FClassFinder<AActor> StopFinder(
TEXT( "/Game/Carla/Static/TrafficSigns/BP_Stop" ) );
if (StopFinder.Succeeded())
{
TSubclassOf<ATrafficSignBase> StopSignModel;
StopSignModel = StopFinder.Object->GeneratedClass;
TSubclassOf<AActor> StopSignModel = StopFinder.Class;
TrafficSignsModels.Add(carla::road::SignalType::StopSign().c_str(), StopSignModel);
SignComponentModels.Add(carla::road::SignalType::StopSign().c_str(), UStopSignComponent::StaticClass());
}
static ConstructorHelpers::FObjectFinder<UBlueprint> YieldFinder(
TEXT( "Blueprint'/Game/Carla/Static/TrafficSigns/BP_Yield.BP_Yield'" ) );
static ConstructorHelpers::FClassFinder<AActor> YieldFinder(
TEXT( "/Game/Carla/Static/TrafficSigns/BP_Yield" ) );
if (YieldFinder.Succeeded())
{
TSubclassOf<ATrafficSignBase> YieldSignModel;
YieldSignModel = YieldFinder.Object->GeneratedClass;
TSubclassOf<AActor> YieldSignModel = YieldFinder.Class;
TrafficSignsModels.Add(carla::road::SignalType::YieldSign().c_str(), YieldSignModel);
SignComponentModels.Add(carla::road::SignalType::YieldSign().c_str(), UYieldSignComponent::StaticClass());
}

View File

@ -82,11 +82,11 @@ private:
TArray<ATrafficSignBase*> TrafficSigns;
UPROPERTY(EditAnywhere, Category= "Traffic Light Manager")
TSubclassOf<ATrafficSignBase> TrafficLightModel;
TSubclassOf<AActor> TrafficLightModel;
// Relates an OpenDRIVE type to a traffic sign blueprint
UPROPERTY(EditAnywhere, Category= "Traffic Light Manager")
TMap<FString, TSubclassOf<ATrafficSignBase>> TrafficSignsModels;
TMap<FString, TSubclassOf<AActor>> TrafficSignsModels;
UPROPERTY(EditAnywhere, Category= "Traffic Light Manager")
TMap<FString, TSubclassOf<USignComponent>> SignComponentModels;

View File

@ -135,16 +135,16 @@ void UYieldSignComponent::InitializeSign(const carla::road::Map &Map)
}
while (!WaypointQueue.empty())
{
auto CurrentWaypoint = WaypointQueue.front();
auto CurrentElement = WaypointQueue.front();
WaypointQueue.pop();
GenerateCheckBox(Map.ComputeTransform(CurrentWaypoint.second), UEBoxSize);
GenerateCheckBox(Map.ComputeTransform(CurrentElement.second), UEBoxSize);
float Speed = Map.GetLane(CurrentWaypoint.second).GetRoad()->GetInfo<carla::road::element::RoadInfoSpeed>(CurrentWaypoint.second.s)->GetSpeed();
float Speed = Map.GetLane(CurrentElement.second).GetRoad()->GetInfo<carla::road::element::RoadInfoSpeed>(CurrentElement.second.s)->GetSpeed();
carla::log_warning("Speed:", Speed);
float RemainingTime = CurrentWaypoint.first - BoxSize/Speed;
float RemainingTime = CurrentElement.first - BoxSize/Speed;
if(RemainingTime > 0)
{
Previous = Map.GetPrevious(CurrentWaypoint.second, 2*BoxSize);
Previous = Map.GetPrevious(CurrentElement.second, 2*BoxSize);
for (auto & Prev : Previous)
{
WaypointQueue.push({RemainingTime, Prev});