Fixed trigger box generation for traffic signs with road width equal to 0
This commit is contained in:
parent
49c4286fce
commit
cc4f86b8d6
|
@ -41,6 +41,9 @@ void UStopSignComponent::InitializeSign(const carla::road::Map &Map)
|
|||
// Get 90% of the half size of the width of the lane
|
||||
float BoxSize = static_cast<float>(
|
||||
0.9*Map.GetLaneWidth(signal_waypoint)*0.5);
|
||||
// Prevent a situation where the road width is 0
|
||||
// This could happen in a lane that is just appearing
|
||||
BoxSize = std::max(0.01f, BoxSize);
|
||||
// Get min and max
|
||||
double LaneLength = Map.GetLane(signal_waypoint).GetLength();
|
||||
double LaneDistance = Map.GetLane(signal_waypoint).GetDistance();
|
||||
|
@ -103,6 +106,9 @@ void UStopSignComponent::InitializeSign(const carla::road::Map &Map)
|
|||
auto NextWaypoint = CurrentWaypoint;
|
||||
float BoxSize = static_cast<float>(
|
||||
0.9*Map.GetLaneWidth(NextWaypoint)*0.5);
|
||||
// Prevent a situation where the road width is 0
|
||||
// This could happen in a lane that is just appearing
|
||||
BoxSize = std::max(0.01f, BoxSize);
|
||||
float UEBoxSize = 100*BoxSize;
|
||||
GenerateCheckBox(Map.ComputeTransform(NextWaypoint), UEBoxSize);
|
||||
while (true)
|
||||
|
|
|
@ -43,6 +43,9 @@ void UTrafficLightComponent::InitializeSign(const carla::road::Map &Map)
|
|||
// Get 90% of the half size of the width of the lane
|
||||
float BoxSize = static_cast<float>(
|
||||
0.9f*Map.GetLaneWidth(signal_waypoint)*0.5);
|
||||
// Prevent a situation where the road width is 0
|
||||
// This could happen in a lane that is just appearing
|
||||
BoxSize = std::max(0.01f, BoxSize);
|
||||
// Get min and max
|
||||
double LaneLength = Map.GetLane(signal_waypoint).GetLength();
|
||||
double LaneDistance = Map.GetLane(signal_waypoint).GetDistance();
|
||||
|
|
|
@ -41,6 +41,9 @@ void UYieldSignComponent::InitializeSign(const carla::road::Map &Map)
|
|||
// Get 90% of the half size of the width of the lane
|
||||
float BoxSize = static_cast<float>(
|
||||
0.9*Map.GetLaneWidth(signal_waypoint)/2.0);
|
||||
// Prevent a situation where the road width is 0
|
||||
// This could happen in a lane that is just appearing
|
||||
BoxSize = std::max(0.01f, BoxSize);
|
||||
// Get min and max
|
||||
double LaneLength = Map.GetLane(signal_waypoint).GetLength();
|
||||
double LaneDistance = Map.GetLane(signal_waypoint).GetDistance();
|
||||
|
@ -104,6 +107,9 @@ void UYieldSignComponent::InitializeSign(const carla::road::Map &Map)
|
|||
auto NextWaypoint = CurrentWaypoint;
|
||||
float BoxSize = static_cast<float>(
|
||||
0.9*Map.GetLaneWidth(NextWaypoint)/2.0);
|
||||
// Prevent a situation where the road width is 0
|
||||
// This could happen in a lane that is just appearing
|
||||
BoxSize = std::max(0.01f, BoxSize);
|
||||
float UEBoxSize = 100*BoxSize;
|
||||
GenerateCheckBox(Map.ComputeTransform(NextWaypoint), UEBoxSize);
|
||||
while (true)
|
||||
|
|
Loading…
Reference in New Issue