Commit fac110b3 authored by Uwe Woessner's avatar Uwe Woessner
Browse files

setup laneMarkingsLeft and Right, this fixes the issue that cars could not change lane


initialize uninitialized variables
Signed-off-by: Uwe Woessner's avatarhpcwoess <woessner@hlrs.de>
parent 5f8bddcd
......@@ -305,10 +305,10 @@ int ActionDeduction::checkChangeWithinEdge(int laneOffset,
bool nfexists = false;
bool lexists = false;
bool fexists = false;
SurroundingMovingObjectsData *NeighLeader;
SurroundingMovingObjectsData *NeighFollower;
SurroundingMovingObjectsData *Leader;
SurroundingMovingObjectsData *Follower;
SurroundingMovingObjectsData *NeighLeader=nullptr;
SurroundingMovingObjectsData *NeighFollower = nullptr;
SurroundingMovingObjectsData *Leader = nullptr;
SurroundingMovingObjectsData *Follower = nullptr;
RelationType neighlead = laneOffset==-1 ? RelationType::LeaderRight : RelationType::LeaderLeft;
RelationType neighfollow = laneOffset==-1 ? RelationType::FollowerRight : RelationType::FollowerLeft;
RelationType leader = RelationType::Leader;
......
......@@ -304,9 +304,21 @@ void Sensor_Modular_Driver_Implementation::SetMovingObjects(AgentInterface *agen
void Sensor_Modular_Driver_Implementation::GetTrafficRuleInformation()
{
StaticEnvironment.roadGeometry.visibilityDistance = GetWorld()->GetVisibilityDistance();
StaticEnvironment.trafficRuleInformation.laneEgo = GetTrafficRuleLaneInformationEgo();
StaticEnvironment.trafficRuleInformation.laneLeft = GetTrafficRuleLaneInformationLeft();
StaticEnvironment.trafficRuleInformation.laneRight = GetTrafficRuleLaneInformationRight();
StaticEnvironment.trafficRuleInformation.laneMarkingsLeft = GetAgent()->GetLaneMarkingsInRange(StaticEnvironment.roadGeometry.visibilityDistance, 0, Side::Left);
StaticEnvironment.trafficRuleInformation.laneMarkingsRight = GetAgent()->GetLaneMarkingsInRange(StaticEnvironment.roadGeometry.visibilityDistance, 0, Side::Right);
if (GetAgent()->ExistsLaneLeft())
{
StaticEnvironment.trafficRuleInformation.laneMarkingsLeftOfLeftLane = GetAgent()->GetLaneMarkingsInRange(StaticEnvironment.roadGeometry.visibilityDistance, 1, Side::Left);
}
if (GetAgent()->ExistsLaneRight())
{
StaticEnvironment.trafficRuleInformation.laneMarkingsLeftOfLeftLane = GetAgent()->GetLaneMarkingsInRange(StaticEnvironment.roadGeometry.visibilityDistance, -1, Side::Right);
}
}
LaneInformationTrafficRules Sensor_Modular_Driver_Implementation::GetTrafficRuleLaneInformationEgo()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment