Skip to content

Commit 0cff5b2

Browse files
Milotrinceduburcqa
andauthored
[FEATURE] Add new point-cloud-based tactile sensors. (#2735)
Co-authored-by: Alexis Duburcq <alexis.duburcq@gmail.com>
1 parent 6527989 commit 0cff5b2

23 files changed

Lines changed: 4176 additions & 2391 deletions

examples/sensors/kinematic_contact_sandbox.py

Lines changed: 0 additions & 237 deletions
This file was deleted.

examples/sensors/proximity_shadowhand.py renamed to examples/sensors/surface_distance_shadowhand.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
Interactive Proximity sensor with Shadow Hand and keyboard teleop.
2+
Interactive SurfaceDistanceProbe demo with Shadow Hand and keyboard teleop.
33
4-
Proximity sensors on the hand measure distance to a rubber duck (mesh) and a box.
4+
Surface distance probes on the hand measure distance to a rubber duck (mesh) and a box.
55
Use keyboard controls to move the hand via IK; the hand tracks target positions
66
for the wrist and fingertips.
77
"""
@@ -19,7 +19,7 @@
1919
KEY_DPOS = 0.015
2020
FORCE_SCALE = 10.0
2121

22-
# Proximity sensor
22+
# Surface distance probe
2323
MAX_RANGE = 0.5
2424

2525
# Objects
@@ -30,7 +30,7 @@
3030

3131

3232
def main():
33-
parser = argparse.ArgumentParser(description="Interactive Proximity sensor with Shadow Hand")
33+
parser = argparse.ArgumentParser(description="Interactive SurfaceDistanceProbe with Shadow Hand")
3434
parser.add_argument("--vis", "-v", action="store_true", default=False, help="Show visualization GUI")
3535
parser.add_argument("--gpu", action="store_true", default=False, help="Run on GPU instead of CPU")
3636
parser.add_argument("--seconds", "-t", type=float, default=3.0, help="Seconds to simulate (headless mode)")
@@ -95,12 +95,12 @@ def main():
9595
"thumb_distal",
9696
):
9797
sensor = scene.add_sensor(
98-
gs.sensors.Proximity(
98+
gs.sensors.SurfaceDistanceProbe(
9999
entity_idx=robot.idx,
100100
link_idx_local=robot.get_link(link_name).idx_local,
101101
probe_local_pos=((0.0, 0.0, 0.0),),
102+
probe_radius=MAX_RANGE,
102103
track_link_idx=(duck.base_link_idx, box.base_link_idx),
103-
max_range=MAX_RANGE,
104104
draw_debug=args.vis,
105105
)
106106
)
@@ -146,8 +146,8 @@ def reset_pose():
146146
Keybind("quit", Key.ESCAPE, KeyAction.RELEASE, callback=stop),
147147
)
148148

149-
print("\n=== Proximity sensor with Shadow Hand ===")
150-
print("Proximity sensors on hand palm and fingertips, tracking duck and box links")
149+
print("\n=== SurfaceDistanceProbe with Shadow Hand ===")
150+
print("Surface distance probes on hand palm and fingertips, tracking duck and box links")
151151
if args.vis:
152152
print("Keyboard: [↑/↓/←/→] move hand XY, [n/m] up/down, [\\] reset, [ESC] quit")
153153
else:
@@ -163,7 +163,7 @@ def reset_pose():
163163
distances = []
164164
for sensor in sensors:
165165
distances.append(sensor.read())
166-
print(f"Proximity distances: {distances}")
166+
print(f"Surface distances: {distances}")
167167

168168
scene.step()
169169

0 commit comments

Comments
 (0)