@@ -450,11 +450,11 @@ def onVioOutput(self, cameraPose, image=None, width=None, height=None, colorForm
450
450
if image is not None :
451
451
# Flip the image upside down for OpenGL.
452
452
if not self .args .flip : image = np .ascontiguousarray (np .flipud (image ))
453
+ output ["image" ] = image
453
454
output ['width' ] = width
454
455
output ['height' ] = height
455
456
output ['colorFormat' ] = colorFormat
456
457
457
-
458
458
if self .outputQueueMutex :
459
459
self .outputQueue .append (output )
460
460
@@ -476,6 +476,7 @@ def onMappingOutput(self, mapperOutput):
476
476
477
477
def run (self ):
478
478
vioOutput = None
479
+ prevVioOutput = None
479
480
wasTracking = False
480
481
481
482
while not self .shouldQuit :
@@ -507,12 +508,20 @@ def run(self):
507
508
mapperOutput = output ["mapperOutput" ]
508
509
if wasTracking : # Don't render if not tracking. Messes up this visualization easily
509
510
self .map .onMappingOutput (mapperOutput )
510
- if mapperOutput .finalMap and not self .args .keepOpenAfterFinalMap :
511
- self .shouldQuit = True
511
+ if mapperOutput .finalMap :
512
+ if self .args .keepOpenAfterFinalMap :
513
+ self .showCameraFrustum = False
514
+ self .showCameraModel = False
515
+ if self .args .targetFps == 0 : self .args .targetFps = 30 # No vio outputs -> set 30fps mode instead
516
+ if self .cameraSmooth : self .cameraSmooth .reset () # Stop camera moving automatically
517
+ vioOutput = prevVioOutput
518
+ else :
519
+ self .shouldQuit = True
512
520
else :
513
521
print ("Unknown output type: {}" .format (output ["type" ]))
514
522
515
523
if vioOutput :
524
+ prevVioOutput = vioOutput
516
525
self .__render (
517
526
vioOutput ["cameraPose" ],
518
527
vioOutput ["width" ],
0 commit comments