MCPcopy Create free account
hub / github.com/PJLab-ADG/OASim / AbstractLane

Class AbstractLane

limsim/utils/roadgraph.py:66–90  ·  view source on GitHub ↗

Abstract lane class.

Source from the content-addressed store, hash-verified

64
65@dataclass
66class AbstractLane(ABC):
67 """
68 Abstract lane class.
69 """
70 id: str
71 width: float = 0
72 speed_limit: float = 13.89
73 sumo_length: float = 0
74 course_spline: Spline2D = None
75
76 @property
77 def spline_length(self):
78 return self.course_spline.s[-1]
79
80 def getPlotElem(self):
81 s = np.linspace(0, self.course_spline.s[-1], num=50)
82 self.center_line = [
83 self.course_spline.calc_position(si) for si in s
84 ]
85 self.left_bound = [
86 self.course_spline.frenet_to_cartesian1D(si, self.width / 2) for si in s
87 ]
88 self.right_bound = [
89 self.course_spline.frenet_to_cartesian1D(si, -self.width / 2) for si in s
90 ]
91
92
93@dataclass

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected