(self, args=VisualizerArgs())
| 238 | |
| 239 | class 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() |
nothing calls this directly
no test coverage detected