Add internal functionmj_tendonDot: time derivative of tendon Jacobian for one tendon.

Notes:
- Currently always uses dense math, even for sparse models. This should be easy to change in the future.
- Does not support geom wrapping. This is possible but harder, requires derivatives of mju_wrap.
PiperOrigin-RevId: 740378741
Change-Id: Id39ef2c4bfbb7ee11ec33c97d7d83140441cdab2
This commit is contained in:
Yuval Tassa
2025-03-25 09:35:14 -07:00
committed by Copybara-Service
parent 4e206c29c1
commit c931565fdc
7 changed files with 334 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<mujoco>
<option integrator="RK4">
<flag energy="enable"/>
</option>
<worldbody>
<site name="tendon" type="box" size=".03 .03 .03" pos="-.5 0 -.5"/>
<body name="link1" pos="-1 0 0">
<joint name="link1" axis="0 -1 0" stiffness="100" springref="90"/>
<geom type="capsule" size=".02" fromto="0 0 0 0 0 -1"/>
<geom type="sphere" size=".08" pos="0 0 -1"/>
<site name="link1" type="box" size=".03 .03 .03" pos="0 0 -.5"/>
</body>
</worldbody>
<tendon>
<spatial width=".01" rgba=".2 .2 1 1">
<site site="link1"/>
<site site="tendon"/>
</spatial>
</tendon>
<keyframe>
<key qpos="1" qvel="1"/>
</keyframe>
</mujoco>
+29
View File
@@ -0,0 +1,29 @@
<mujoco>
<option integrator="RK4">
<flag contact="disable" gravity="disable" energy="enable"/>
</option>
<worldbody>
<site name="tendon" type="box" size=".03 .03 .03" pos="-.5 0 0"/>
<body name="link1" pos="-1 0 0">
<joint name="link1" axis="0 -1 0" damping="0" stiffness="50"/>
<geom name="link1" type="capsule" size=".02" fromto="0 0 0 0 0 -1"/>
<body name="link2" pos="0 0 -1">
<joint name="link2" axis="0 -1 0" damping="0" stiffness="1" springref="-180"/>
<geom name="link2" type="capsule" size=".03" fromto="0 0 0 .6 0 0"/>
<site name="link2" type="box" size=".03 .03 .03" pos=".5 0 0"/>
</body>
</body>
</worldbody>
<tendon>
<spatial width=".01" rgba=".2 .2 1 1">
<site site="link2"/>
<site site="tendon"/>
</spatial>
</tendon>
<keyframe>
<key qpos="-1 0" qvel="1 1"/>
</keyframe>
</mujoco>
+34
View File
@@ -0,0 +1,34 @@
<mujoco>
<option integrator="RK4">
<flag contact="disable" gravity="disable" energy="enable"/>
</option>
<worldbody>
<body name="thigh" pos="-1 0 0">
<site name="0" type="box" size=".03 .03 .03" pos=".1 0 -.3"/>
<joint axis="1 0 0" stiffness="50"/>
<joint axis="0 1 0" stiffness="50"/>
<joint axis="0 0 1" stiffness="50"/>
<geom type="capsule" size=".04" fromto="0 0 0 0 0 -1"/>
<geom type="capsule" size=".02" fromto="0 0 -1 .05 -.08 -1.1"/>
<site name="1" type="box" size=".03 .03 .03" pos=".05 -.08 -1.1"/>
<body name="calf" pos="0 0 -1">
<joint axis="0 -1 0" damping="0" stiffness="5" springref="90"/>
<geom type="capsule" size=".03" fromto="0 0 0 -.6 0 0"/>
<body name="foot" pos="-.6 0 0">
<joint type="ball" stiffness="20" armature=".1"/>
<site name="2" type="box" size=".03 .03 .03" pos=".03 .1 .15"/>
<geom name="foot" type="box" size=".03 .1 .15" pos="0 0 -.05"/>
</body>
</body>
</body>
</worldbody>
<tendon>
<spatial name="ten" width=".01" rgba=".2 .2 1 1">
<site site="0"/>
<site site="1"/>
<site site="2"/>
</spatial>
</tendon>
</mujoco>
+66
View File
@@ -0,0 +1,66 @@
<mujoco>
<option integrator="RK4">
<flag contact="disable" energy="enable"/>
</option>
<default>
<joint axis="0 1 0" range="0 60" limited="true"/>
<geom type="capsule" size=".01" rgba=".9 .7 .1 1"/>
<site rgba=".9 .9 .9 1"/>
<default class="visual_cylinder">
<geom type="cylinder" fromto="0 .015 0 0 -.015 0" size=".02" rgba=".3 .9 .3 .4"/>
</default>
</default>
<worldbody>
<light pos="0 0 1"/>
<body name="weight" pos="-.03 0 .175">
<joint axis="0 0 1" pos="0 0 .025" type="slide"/>
<geom type="cylinder" size=".03 .025" density="5000" rgba=".2 .2 .5 1"/>
<site name="s1" pos="0 0 .025"/>
</body>
<site name="s2" pos="-.03 0 .33"/>
<body pos="0 0 .3">
<joint/>
<geom fromto="0 0 0 .1 0 0"/>
<site name="s3" pos=".02 0 .03"/>
<body pos=".1 0 0">
<joint/>
<geom fromto="0 0 0 .1 0 0"/>
<site name="s4" pos=".03 0 .01"/>
<site name="s5" pos=".05 0 .02"/>
<site name="side2" pos="0 0 .03"/>
<body pos=".1 0 0">
<joint/>
<geom fromto="0 0 0 .1 0 0" size=".017"/>
<site name="s6" pos=".03 0 .01"/>
<site name="side3" pos="0 0 .02"/>
</body>
</body>
</body>
</worldbody>
<tendon>
<spatial range="0 .33" limited="true" width=".002" rgba=".95 .3 .3 1">
<site site="s1"/>
<site site="s2"/>
<site site="s3"/>
<pulley divisor="2"/>
<site site="s3"/>
<site site="side2"/>
<site site="s4"/>
<pulley divisor="2"/>
<site site="s3"/>
<site site="side2"/>
<site site="s5"/>
<site site="side3"/>
<site site="s6"/>
</spatial>
</tendon>
</mujoco>