GUI for finger v1
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
"""Configuration for the finger tactile example pipeline."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
from viz.mesh_camera import DEFAULT_FINGER_VIZ_POSE
|
||||
|
||||
|
||||
def mesh_threshold(mesh_map: str, threshold: float | None) -> float:
|
||||
if threshold is not None:
|
||||
return threshold
|
||||
return 0.0 if mesh_map == "depth" else 0.4
|
||||
|
||||
|
||||
@dataclass
|
||||
class PipelineConfig:
|
||||
video: str = "0"
|
||||
config: str = "./config/dd02-ov.json"
|
||||
calib: str | None = None
|
||||
verbose: bool = False
|
||||
mesh_map: str = "depth"
|
||||
threshold: float | None = None
|
||||
viz_pose: str = DEFAULT_FINGER_VIZ_POSE
|
||||
enable_3d: bool = True
|
||||
use_color: bool = True
|
||||
lowpass_cutoff_hz: float = 5.0
|
||||
force_sample_rate_hz: float = 30.0
|
||||
|
||||
@classmethod
|
||||
def from_args(cls, args) -> "PipelineConfig":
|
||||
return cls(
|
||||
video=args.video,
|
||||
config=args.config,
|
||||
calib=getattr(args, "cal", None) or None,
|
||||
verbose=args.verbose,
|
||||
mesh_map=args.mesh_map,
|
||||
threshold=args.threshold,
|
||||
viz_pose=args.viz_pose,
|
||||
enable_3d=not args.no_3d,
|
||||
lowpass_cutoff_hz=getattr(args, "cutoff", 5.0),
|
||||
)
|
||||
|
||||
@property
|
||||
def flow_threshold(self) -> float:
|
||||
return mesh_threshold(self.mesh_map, self.threshold)
|
||||
Reference in New Issue
Block a user