Hi, I think the same question was ask in 2023 but didn't get answered yet (https://www.mathworks.com/matlabcentral/answers/1909405-how-to-write-a-junction-in-roadrunner-hdmap-using-matlab?s_tid=srchtitle).
I tried to understand the documantation (https://ww2.mathworks.cn/help/driving/ref/roadrunner.hdmap.junction.html#) and create a simple junction by myself. But the juction doesn't show up in the Roadrunner. Can you please help me diagonise which step might be wrong in my example? Thanks!
rrMap = roadrunnerHDMap;
outer1 = [0 0; 4 0; 4 4; 0 4; 0 0];
outer2 = [5 5 0; 7 5 0; 7 7 0; 5 7 0; 5 5 0];
polygon1 = roadrunner.hdmap.Polygon( ...
'ExteriorRing', outer1, ...
'InteriorRings', {} ...
);
polygon2 = roadrunner.hdmap.Polygon( ...
'ExteriorRing', outer2, ...
'InteriorRings', {} ...
);
multiPoly = roadrunner.hdmap.MultiPolygon( ...
'Polygons', [polygon1;] ...
);
rrMap.Junctions(1) = roadrunner.hdmap.Junction(ID="Junction1", Geometry=multiPoly)