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

Method start

python/scripts/camera/realsense.py:95–117  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

93 return self._intrinsics
94
95 def start(self) -> None:
96 rs = _rs()
97 pipeline = rs.pipeline()
98 config = rs.config()
99 config.enable_device(self._serial)
100 config.enable_stream(rs.stream.depth, self._width, self._height, rs.format.z16, self._fps)
101 config.enable_stream(rs.stream.color, self._width, self._height, rs.format.bgr8, self._fps)
102
103 profile = pipeline.start(config)
104 self._pipeline = pipeline
105 self._align = rs.align(rs.stream.color)
106 self._depth_scale = float(profile.get_device().first_depth_sensor().get_depth_scale())
107 self._intrinsics = CameraIntrinsics.from_realsense(
108 profile.get_stream(rs.stream.color).as_video_stream_profile().get_intrinsics()
109 )
110 self._info.update(
111 {
112 "width": str(self._width),
113 "height": str(self._height),
114 "fps": str(self._fps),
115 "depth_scale_m": f"{self._depth_scale:.12g}",
116 }
117 )
118
119 def wait_frame(self, timeout_ms: int) -> RgbdFrame | None:
120 if self._pipeline is None or self._align is None:

Callers

nothing calls this directly

Calls 3

_rsFunction · 0.85
from_realsenseMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected