Skip to content

Commit

Permalink
Fixed warnings. Fixed missing assets in package.
Browse files Browse the repository at this point in the history
  • Loading branch information
Axel1092 committed Mar 30, 2020
1 parent a89e505 commit d140688
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ class CARLA_API ATrafficLightManager : public AActor
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down

0 comments on commit d140688

Please sign in to comment.