(args)
| 107 | |
| 108 | |
| 109 | def record(args): |
| 110 | import depthai |
| 111 | import spectacularAI |
| 112 | import subprocess |
| 113 | import os |
| 114 | import json |
| 115 | import threading |
| 116 | import time |
| 117 | |
| 118 | if args.list_devices: |
| 119 | list_oakd_devices() |
| 120 | return |
| 121 | |
| 122 | config = spectacularAI.depthai.Configuration() |
| 123 | pipeline = depthai.Pipeline() |
| 124 | |
| 125 | config.useSlam = True |
| 126 | config.inputResolution = args.resolution |
| 127 | if args.output: |
| 128 | outputFolder = args.output |
| 129 | if args.auto_subfolders: outputFolder = auto_subfolder(outputFolder) |
| 130 | else: |
| 131 | outputFolder = auto_subfolder("data") |
| 132 | |
| 133 | internalParameters = {} |
| 134 | |
| 135 | if not args.no_inputs: |
| 136 | config.recordingFolder = outputFolder |
| 137 | if args.map: |
| 138 | try: os.makedirs(outputFolder) # SLAM only |
| 139 | except: pass |
| 140 | config.mapSavePath = os.path.join(outputFolder, 'slam_map._') |
| 141 | if args.no_slam: |
| 142 | assert args.map == False |
| 143 | config.useSlam = False |
| 144 | if args.no_feature_tracker: |
| 145 | config.useFeatureTracker = False |
| 146 | if args.vio_auto_exposure: |
| 147 | config.useVioAutoExposure = True |
| 148 | if args.use_rgb: |
| 149 | config.useColor = True |
| 150 | if args.mono: |
| 151 | config.useStereo = False |
| 152 | if args.recording_only: |
| 153 | config.recordingOnly = True |
| 154 | if args.april_tag_path: |
| 155 | config.aprilTagPath = args.april_tag_path |
| 156 | if args.disable_cameras: |
| 157 | config.disableCameras = True |
| 158 | if args.ffmpeg_codec is not None: |
| 159 | internalParameters["ffmpegVideoCodec"] = args.ffmpeg_codec + ' -b:v 8M' |
| 160 | if args.no_usb_speed_check: |
| 161 | config.ensureSufficientUsbSpeed = False |
| 162 | if args.color_stereo: |
| 163 | config.useColorStereoCameras = True |
| 164 | if args.use_encoded_video: |
| 165 | config.forceUnrectified = True |
| 166 | config.useEncodedVideo = True |
no test coverage detected