Add touch sensor to MJX.

PiperOrigin-RevId: 688056696
Change-Id: I50b0ebf3141aab0a5b07e5ae770101ff8b7737d4
This commit is contained in:
Taylor Howell
2024-10-21 02:47:43 -07:00
committed by Copybara-Service
parent 680fb3e5dd
commit b00a7c6705
6 changed files with 99 additions and 4 deletions
@@ -27,6 +27,7 @@
-subtreelinvel
-subtreeangmom
* acceleration/force-dependent sensors:
-touch
-accelerometer
-force
-torque
@@ -100,6 +101,17 @@
<site name="site_torque"/>
<geom size="0.1"/>
</body>
<!-- plane and body for touch sensors -->
<geom type="plane" size="1 1 .1" pos="-20 -20 -20"/>
<body pos="-20 -20 -19.985">
<joint type="slide" axis="0 0 1"/>
<joint type="hinge" axis="0 1 0"/>
<geom type="capsule" fromto="-.5 0 0 .5 0 0" size="0.0125"/>
<site name="touch_sphere" type="sphere" pos="-0.5 0 0" size="0.025"/>
<site name="touch_capsule" type="capsule" fromto="-0.1 0 0.01 0.1 0 0.01" size="0.025"/>
<site name="touch_box" pos="0.5 0 0" type="box" size="0.025 0.025 0.025"/>
</body>
</worldbody>
<actuator>
@@ -121,6 +133,7 @@
</tendon>
<sensor>
<touch name="touch_sphere" site="touch_sphere"/>
<torque site="site_torque"/>
<tendonpos tendon="fixed"/>
<tendonvel tendon="fixed"/>
@@ -128,6 +141,7 @@
<velocimeter name="velocimeter0" site="site0"/>
<velocimeter name="velocimeter0cutoff" site="site0" cutoff="3e-4"/>
<gyro name="gyro0" site="site0"/>
<touch name="touch_box" site="touch_box"/>
<gyro name="gyro0cutoff" site="site0" cutoff="2e-3"/>
<rangefinder name="rangefinder0" site="site_rangefinder0"/>
<accelerometer name="accelerometer1" site="site1"/>
@@ -138,6 +152,7 @@
<jointpos name="jointpos0cutoff" joint="hinge0" cutoff="1e-4"/>
<jointvel name="jointvel0" joint="hinge0"/>
<jointvel name="jointvel0cutoff" joint="hinge0" cutoff="1e-3"/>
<touch name="touch_capsule" site="touch_capsule"/>
<actuatorfrc name="actuatorfrc0" actuator="motor0"/>
<framelinvel name="framelinvel3" objtype="site" objname="site3"/>
<framelinvel name="framelinvel3ref" objtype="site" objname="site3" reftype="body" refname="body2"/>