MCPcopy Index your code
hub / github.com/SpectacularAI/sdk / Visualizer

Class Visualizer

python/cli/visualization/visualizer.py:239–605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237 self.recordPipe.stdin.write(buffer)
238
239class Visualizer:
240 def __init__(self, args=VisualizerArgs()):
241 self.args = args
242
243 # State
244 self.shouldQuit = False
245 self.shouldPause = False
246 self.displayInitialized = False
247 self.vioOutputQueue = []
248 self.mapperOutputQueue = []
249 self.clock = pygame.time.Clock()
250
251 # Window
252 self.fullScreen = args.fullScreen
253 self.targetResolution = [int(s) for s in args.resolution.split("x")]
254 self.adjustedResolution = None
255 self.scale = None
256 self.aspectRatio = None
257
258 # Camera
259 self.cameraMode = self.args.cameraMode
260 self.cameraSmooth = CameraSmooth() if args.cameraSmooth else None
261 self.cameraControls2D = CameraControls2D()
262 self.cameraControls3D = CameraControls3D()
263
264 # Toggle visualization components
265 self.showGrid = args.showGrid
266 self.showPoseTrail = args.showPoseTrail
267 self.showCameraModel = args.showCameraModel
268 self.showCameraFrustum = args.showCameraFrustum
269
270 # Renderers
271 self.map = MapRenderer(
272 pointSize=args.pointSize,
273 pointOpacity=args.pointOpacity,
274 colorMode=args.colorMode.value,
275 voxelSize=args.pointCloudVoxelSize,
276 keyFrameCount=args.keyFrameCount,
277 maxZ=args.pointCloudMaxHeight,
278 skipPointsWithoutColor=args.skipPointsWithoutColor,
279 visualizationScale=args.visualizationScale,
280 renderPointCloud=args.showPointCloud,
281 renderSparsePointCloud=args.showSparsePointCloud,
282 renderKeyFrames=args.showKeyFrames,
283 renderMesh=args.showMesh)
284 self.poseTrail = PoseTrailRenderer(maxLength=args.poseTrailLength)
285 self.grid = GridRenderer(radius=args.gridRadius, length=args.gridCellLength, origin=args.gridOrigin)
286 self.cameraModelRenderer = CameraWireframeRenderer()
287 self.cameraFrustumRenderer = None # initialized later when camera projection matrix is available
288
289 # Recording
290 self.recorder = None
291
292 def __resetAfterLost(self):
293 self.map.reset()
294 self.poseTrail.reset()
295
296 def __initDisplay(self):

Callers 3

smoothFunction · 0.90
recordFunction · 0.90
processFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected