| 161 | return viewMatrix |
| 162 | |
| 163 | class VisualizerArgs: |
| 164 | # Window |
| 165 | resolution = "1280x720" # Window resolution |
| 166 | fullScreen = False # Full screen mode |
| 167 | visualizationScale = 10.0 # Generic scale of visualizations. Affects color maps, camera size, etc. |
| 168 | backGroundColor = [1, 1, 1] # Background color RGB color (0-1). |
| 169 | keepOpenAfterFinalMap = False # If false, window is automatically closed on final mapper output |
| 170 | targetFps = 0 # 0 = render when vio output is available, otherwise tries to render at specified target fps |
| 171 | |
| 172 | # Camera |
| 173 | cameraNear = 0.01 # Camera near plane (m) |
| 174 | cameraFar = 100.0 # Camera far plane (m) |
| 175 | cameraMode = CameraMode.THIRD_PERSON # Camera mode (options: AR, 3rd person, 2D). Note: AR mode should have 'useRectification: True' |
| 176 | cameraSmooth = True # Enable camera smoothing in 3rd person mode |
| 177 | cameraFollow = True # When true, camera follows estimated camera pose. Otherwise, use free camera (3rd person, 2D) |
| 178 | flip = False # Vertically flip image in AR mode |
| 179 | |
| 180 | # Initial state for visualization components |
| 181 | showGrid = True |
| 182 | showPoseTrail = True |
| 183 | showCameraModel = True |
| 184 | showCameraFrustum = True |
| 185 | |
| 186 | # SLAM map |
| 187 | pointSize = 2.0 |
| 188 | pointOpacity = 1.0 |
| 189 | pointCloudVoxelSize = None # Voxel size (m) for downsampling point clouds |
| 190 | pointCloudMaxHeight = None # Point cloud max height (m) in world coordinates. Visualization only |
| 191 | skipPointsWithoutColor = False # Deletes points whose color is [0, 0, 0]. Visualization only |
| 192 | keyFrameCount = None # None = show all. Visualization only |
| 193 | colorMode = ColorMode.ORIGINAL # Point cloud shader mode |
| 194 | showPointCloud = True # Show key frame point clouds |
| 195 | showKeyFrames = True # Show key frame poses |
| 196 | showMesh = False # Show SLAM map mesh. Note: requires 'recEnabled: True' |
| 197 | |
| 198 | # Pose trail |
| 199 | poseTrailLength = None # Number of frames in pose trail (unlimited=None) |
| 200 | |
| 201 | # Sparse point cloud (yes, no, auto = only if dense point clouds do not exist) |
| 202 | showSparsePointCloud = 'auto' |
| 203 | |
| 204 | # Grid |
| 205 | gridRadius = 20 # Grid side length is 2*n |
| 206 | gridCellLength = 1.0 # Length of single cell (m) |
| 207 | gridOrigin = [0., 0., 0.] # Grid origin in world coordinates |
| 208 | |
| 209 | # Camera frustum |
| 210 | frustumNear = 0.2 # Frustum near plane (m). Visualization only |
| 211 | frustumFar = 20.0 # Frustum far plane (m). Visualization only |
| 212 | |
| 213 | # Recording |
| 214 | recordPath = None # Record the window to video file given by path |
| 215 | |
| 216 | # Callbacks |
| 217 | customRenderCallback = None # Used to render custom OpenGL objects in user code |
| 218 | customKeyDownCallbacks = {} # User callback is called when event.type == pygame.KEYDOWN and event.key == key |
| 219 | |
| 220 | class Recorder: |