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

Class DummyVehicle

limsim/simModel/common/carFactory.py:495–518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493
494
495class DummyVehicle:
496 def __init__(self, x: float, y: float, radius: float) -> None:
497 self.x = x
498 self.y = y
499 if radius > 100:
500 print(
501 '[yellow]The given local radius is too large, and is resized to 100![/yellow]')
502 self.radius = 100
503 elif radius < 20:
504 print(
505 '[yellow]The given local radius is too small, and is resized to 20![/yellow]')
506 self.radius = 20
507 else:
508 self.radius = radius
509
510 def plotArea(self, node: dpg.node, ex: float, ey: float, ctf: CoordTF):
511 cx, cy = ctf.qtCoord(self.x, self.y, ex, ey)
512 dpg.draw_circle(
513 (cx, cy),
514 ctf.zoomScale*self.radius,
515 thickness=0,
516 fill=(243, 156, 18, 20),
517 parent=node
518 )

Callers 3

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected