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.
55Use keyboard controls to move the hand via IK; the hand tracks target positions
66for the wrist and fingertips.
77"""
1919KEY_DPOS = 0.015
2020FORCE_SCALE = 10.0
2121
22- # Proximity sensor
22+ # Surface distance probe
2323MAX_RANGE = 0.5
2424
2525# Objects
3030
3131
3232def 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