added mesh surface arrows

This commit is contained in:
ykcheungab
2026-06-19 21:22:28 +08:00
parent 2e5c047d1e
commit 258948bcb7
20 changed files with 951 additions and 194 deletions
+5 -30
View File
@@ -87,35 +87,6 @@ class FingerPipeline:
if self.runtime is not None:
self.runtime.tactile.reset()
def _read_frame_view(self, tactile, unrolled) -> FingerFrameView:
fps, flow, vnormal, depth_map, centroid, fnormal, fshearx, fsheary = tactile.read_info(
tactile.info.FPS,
tactile.info.VRAW,
tactile.info.VNORMAL,
tactile.info.DEPTH,
tactile.info.CENTROID,
tactile.info.FNORMAL,
tactile.info.FSHEARX,
tactile.info.FSHEARY,
)
return FingerFrameView(
timestamp=time.time() - self._start_time,
fps=float(fps),
unrolled=unrolled,
flow=flow,
vnormal=vnormal,
depth_map=depth_map,
img=np.array([]),
contour=np.array([]),
centroid=centroid,
fnormal=float(fnormal),
fshearx=float(fshearx),
fsheary=float(fsheary),
centroid_found=bool(tactile.raw_sensor.centroid_found),
mask_coverage=float(tactile.mask_stats["coverage"]),
raw_frame=tactile.frame,
)
def tick(self) -> FingerFrameView | None:
frame, _timings = self.tick_timed()
return frame
@@ -165,7 +136,11 @@ class FingerPipeline:
self.profiler.record("contact", timings.contact_ms)
t0 = time.perf_counter()
view = self._read_frame_view(tactile, unrolled)
view = FingerFrameView.from_tactile(
tactile,
unrolled,
timestamp=time.time() - self._start_time,
)
timings.read_info_ms = (time.perf_counter() - t0) * 1000.0
if profile:
self.profiler.record("read_info", timings.read_info_ms)