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

Class CoordTF

limsim/utils/simBase.py:22–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20 self.data = data
21
22class CoordTF:
23 # Ego is always in the center of the window
24 def __init__(self, realSize: float, height:float) -> None:
25 self.realSize: float = realSize
26 self.drawCenter: float = self.realSize / 2
27 self.qtDrawSize: float = height
28 self.offset = (0, 0)
29
30 @property
31 def zoomScale(self) -> float:
32 return self.qtDrawSize / self.realSize
33
34 def qtCoord(
35 self, x: float, y: float, ex: float, ey: float) -> tuple[QPointF]:
36 relx, rely = x - ex, y - ey
37 return QPointF(
38 self.zoomScale * (self.drawCenter + relx + self.offset[0]),
39 self.zoomScale * (self.drawCenter - rely + self.offset[1])
40 )
41
42
43def deduceEdge(laneID: str) -> str:

Callers 1

__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected