MCPcopy Create free account
hub / github.com/Ar-Ray-code/lingbot-depth-trt / start

Method start

python/scripts/camera/orbbec.py:167–203  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

165 return self._intrinsics
166
167 def start(self) -> None:
168 ob = _ob()
169 device = _get_device(self._info)
170 pipeline = ob.Pipeline(device)
171 config = ob.Config()
172
173 color_profile = pipeline.get_stream_profile_list(ob.OBSensorType.COLOR_SENSOR).get_video_stream_profile(
174 self._width, self._height, ob.OBFormat.RGB, self._fps
175 )
176 depth_profile = pipeline.get_stream_profile_list(ob.OBSensorType.DEPTH_SENSOR).get_video_stream_profile(
177 self._width, self._height, ob.OBFormat.Y16, self._fps
178 )
179 config.enable_stream(color_profile)
180 config.enable_stream(depth_profile)
181 config.set_frame_aggregate_output_mode(ob.OBFrameAggregateOutputMode.FULL_FRAME_REQUIRE)
182
183 try:
184 pipeline.enable_frame_sync()
185 except Exception:
186 pass
187
188 pipeline.start(config)
189 self._pipeline = pipeline
190 self._align_filter = ob.AlignFilter(align_to_stream=ob.OBStreamType.COLOR_STREAM)
191 self._intrinsics = CameraIntrinsics.from_orbbec(color_profile.get_intrinsic())
192 self._info.update(
193 {
194 "width": str(self._width),
195 "height": str(self._height),
196 "fps": str(self._fps),
197 "depth_unit": "meter",
198 "depth_scale_m": f"{ORBBEC_DEPTH_SCALE_TO_METERS:.12g} * depth_frame.get_depth_scale()",
199 "color_format": "RGB",
200 "depth_format": "Y16",
201 "alignment": "software_depth_to_color",
202 }
203 )
204
205 def wait_frame(self, timeout_ms: int) -> RgbdFrame | None:
206 if self._pipeline is None or self._align_filter is None:

Callers

nothing calls this directly

Calls 4

_obFunction · 0.85
_get_deviceFunction · 0.85
from_orbbecMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected