Files
Mujoco_WASM/model/surfacevel/treadmill.xml
T
Yuval Tassa 4787c8094c Add geom surfacevel: zero-dof conveyors, treadmills and turntables.
https://www.youtube.com/watch?v=PdSdrqhSiZA

The new geom attribute surfacevel (6 numbers: linear and angular velocity in the geom's local frame, angular about the geom frame origin) specifies the velocity of the geom's surface material relative to the geom frame. The relative surface velocity of the two geoms is added to the tangential contact rows of efc_vel in mj_referenceConstraint, so friction drives touching bodies toward the motion of the surface: objects on a conveyor are transported at belt speed, turntables impart omega x r with torsional spin-up for condim >= 4, and surface velocities compose with each other and with body motion. The component along the contact normal is projected out: probe experiments showed that velocity-space emission chatters mass-independently and ingestion merely deepens penetration; normal-direction effects belong to force-space features.

surfacevel is interpreted in the geom frame as authored: for mesh geoms, whose compiled frame absorbs the mesh centering and principal-axes transform, the compiler re-expresses the authored value in the compiled frame.

No special interaction with sleeping: objects being transported do not fall asleep because they are moving; objects at rest on an active surface may sleep like any other resting object.

Includes showcase models (model/surfacevel/): a luggage carousel whose ring is a spinning square-profile supertorus fed by a cascade of belts with matched spinning end rollers, bags dropping in and circulating indefinitely; and a treadmill with a passive humanoid.

PiperOrigin-RevId: 948647785
Change-Id: I0c6559a91cc7ece1237eb8ac2e51986e7342d962
2026-07-15 17:58:17 -07:00

73 lines
3.5 KiB
XML

<mujoco model="Treadmill">
<!-- A treadmill with no degrees of freedom: the deck surface moves via surfacevel,
with matched spinning end rollers (w = v/r). Standard running-treadmill
dimensions: 0.51 x 1.52 m belt, deck top 0.20 m, console at 1.35 m. The
attached humanoid is passive: it collapses and is swept off the back. -->
<statistic center="0 0 .7" extent="2.5"/>
<visual>
<headlight diffuse=".7 .7 .7" ambient=".3 .3 .3"/>
<quality shadowsize="8192"/>
</visual>
<asset>
<texture type="skybox" builtin="gradient" rgb1=".4 .5 .6" rgb2=".1 .1 .15"
width="32" height="512"/>
<texture name="tm_floor" type="2d" builtin="checker" rgb1=".25 .27 .28" rgb2=".3 .32 .34"
width="300" height="300"/>
<material name="tm_floor" texture="tm_floor" texrepeat="10 10" reflectance=".1"/>
<material name="tm_belt" rgba=".3 .45 .7 1"/>
<material name="tm_frame" rgba=".2 .2 .22 1"/>
<material name="tm_step" rgba=".5 .5 .52 1"/>
<model name="humanoid" file="../humanoid/humanoid.xml"/>
</asset>
<worldbody>
<!-- soft key (large bulb = soft shadows), shadowless cool fill, dim ambience -->
<light pos="-2.5 -1.5 3" dir=".6 .35 -.7" diffuse=".65 .6 .52" intensity="1000000" range="15"
bulbradius=".15"/>
<light pos="2 1.5 2.5" dir="-.5 -.4 -.6" diffuse=".35 .4 .48" intensity="700000" range="15"
castshadow="false"/>
<light type="point" pos="0 0 4" diffuse=".3 .3 .33" intensity="300000" range="20"
castshadow="false"/>
<geom name="floor" type="plane" size="4 4 .1" material="tm_floor"/>
<!-- deck: belt surface flows front to rear (+x), sweeping the rider off the back;
end rollers have radius = deck half-thickness, spin matched: w = 1.4/.05 -->
<geom name="deck" type="box" size=".76 .255 .05" pos="0 0 .15" material="tm_belt"
surfacevel="1.4 0 0 0 0 0"/>
<geom name="roller_front" type="cylinder" size=".05 .255" pos="-.76 0 .15" euler="90 0 0"
material="tm_belt" surfacevel="0 0 0 0 0 -28"/>
<geom name="roller_rear" type="cylinder" size=".05 .255" pos=".76 0 .15" euler="90 0 0"
material="tm_belt" surfacevel="0 0 0 0 0 -28"/>
<!-- side steps, flush with the belt surface -->
<geom name="step_left" type="box" size=".76 .04 .05" pos="0 -.295 .155" material="tm_step"/>
<geom name="step_right" type="box" size=".76 .04 .05" pos="0 .295 .155" material="tm_step"/>
<!-- motor hood over the front roller -->
<geom name="hood" type="box" size=".16 .3 .05" pos="-.86 0 .25" euler="0 -10 0"
material="tm_frame"/>
<!-- uprights, handrails and console -->
<geom name="upright_left" type="capsule" size=".025" fromto="-.8 -.28 .25 -.95 -.28 1.15"
material="tm_frame"/>
<geom name="upright_right" type="capsule" size=".025" fromto="-.8 .28 .25 -.95 .28 1.15"
material="tm_frame"/>
<geom name="rail_left" type="capsule" size=".02" fromto="-.95 -.28 1.15 -.35 -.28 1.05"
material="tm_step"/>
<geom name="rail_right" type="capsule" size=".02" fromto="-.95 .28 1.15 -.35 .28 1.05"
material="tm_step"/>
<geom name="console" type="box" size=".04 .3 .12" pos="-1 0 1.3" euler="0 -30 0"
material="tm_frame"/>
<geom name="screen" type="box" size=".005 .14 .07" pos="-.963 0 1.32" euler="0 -30 0"
rgba=".1 .25 .2 1"/>
<!-- passive rider -->
<frame pos="-.3 0 .21" euler="0 0 180">
<attach model="humanoid" body="torso" prefix="rider_"/>
</frame>
</worldbody>
</mujoco>