Skip to content
Snippets Groups Projects
Commit 99a6835f authored by Qiang Lu's avatar Qiang Lu Committed by Martins Mozeiko
Browse files

Correctly skip stop lines in AutowareMapTool

parent d6a79082
No related branches found
No related tags found
No related merge requests found
......@@ -180,6 +180,8 @@ namespace Simulator.Editor
// Link before and after segment for each line segment
foreach (var lineSegment in allLineSegments)
{
if(lineSegment.lineType != MapData.LineType.STOP) continue; // Skip stop lines
// Each segment must have at least 2 waypoints for calculation, otherwise exit
while (lineSegment.mapLocalPositions.Count < 2)
{
......@@ -197,6 +199,7 @@ namespace Simulator.Editor
{
continue;
}
if(lineSegmentCmp.lineType != MapData.LineType.STOP) continue; // Skip stop lines
var firstPt_cmp = lineSegmentCmp.transform.TransformPoint(lineSegmentCmp.mapLocalPositions[0]);
var lastPt_cmp = lineSegmentCmp.transform.TransformPoint(lineSegmentCmp.mapLocalPositions[lineSegmentCmp.mapLocalPositions.Count - 1]);
......@@ -205,20 +208,12 @@ namespace Simulator.Editor
{
lineSegmentCmp.mapLocalPositions[lineSegmentCmp.mapLocalPositions.Count - 1] = lineSegmentCmp.transform.InverseTransformPoint(firstPt);
lineSegmentCmp.mapWorldPositions[lineSegmentCmp.mapWorldPositions.Count - 1] = firstPt;
if(lineSegment.lineType != MapData.LineType.STOP)
{
lineSegment.befores.Add(lineSegmentCmp);
}
}
if ((lastPt - firstPt_cmp).magnitude < MapAnnotationTool.PROXIMITY / MapAnnotationTool.EXPORT_SCALE_FACTOR)
{
lineSegmentCmp.mapLocalPositions[0] = lineSegmentCmp.transform.InverseTransformPoint(lastPt);
lineSegmentCmp.mapWorldPositions[0] = lastPt;
if (lineSegment.lineType != MapData.LineType.STOP)
{
lineSegment.afters.Add(lineSegmentCmp);
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment