Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

## Mirrored collision meshes

V2 uses 16 pre-mirrored collision meshes as a temporary
V1 uses six pre-mirrored arm collision meshes, and V2 uses 16 pre-mirrored
arm and gripper collision meshes, as a temporary
workaround for [MuJoCo #3604](https://github.com/google-deepmind/mujoco/issues/3604).
Negative mesh scale can produce inward convex polygon normals and incorrect
contacts. The V2 arm and gripper collision assets load with positive scale.
Visual mesh definitions retain their original files and scales.
contacts. All V1/V2 collision assets load with positive scale.
Arm visual mesh definitions retain their original files and scales.

V1 fingers share `finger.stl`; the opposing finger geometry is rotated 180
degrees around Z instead of using a mirrored mesh.

Regenerate the `_left` assets after updating their original meshes:

Expand Down
21 changes: 14 additions & 7 deletions dev/mirror_meshes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Generate the pre-mirrored V2 collision meshes across Y=0."""
"""Generate the pre-mirrored V1/V2 collision meshes across Y=0."""

from pathlib import Path
import struct


_TRIANGLE = struct.Struct("<12fH")
_COLLISION = Path(__file__).resolve().parents[1] / "v2" / "assets" / "collision"
_MESHES = (
_ROOT = Path(__file__).resolve().parents[1]
_V1_COLLISION = _ROOT / "v1" / "meshes" / "collision" / "arm"
_V1_MESHES = [f"link{i}.stl" for i in (0, 1, 2, 5, 6, 7)]
_V2_COLLISION = _ROOT / "v2" / "assets" / "collision"
_V2_MESHES = (
["base_link.stl", "ee_base_link.stl"]
+ [f"link{i}.stl" for i in (1, 2, 6)]
+ [f"link5_part_{i:02d}.stl" for i in range(3)]
Expand Down Expand Up @@ -52,10 +55,14 @@ def mirror_stl(source: Path, destination: Path) -> None:


def main() -> None:
"""Regenerate the 16 mirrored V2 collision assets from their originals."""
for name in _MESHES:
source = _COLLISION / name
mirror_stl(source, source.with_stem(f"{source.stem}_left"))
"""Regenerate six V1 and 16 V2 mirrored collision assets."""
for directory, names in (
(_V1_COLLISION, _V1_MESHES),
(_V2_COLLISION, _V2_MESHES),
):
for name in names:
source = directory / name
mirror_stl(source, source.with_stem(f"{source.stem}_left"))


if __name__ == "__main__":
Expand Down
Binary file added v1/meshes/collision/arm/link0_left.stl
Binary file not shown.
Binary file added v1/meshes/collision/arm/link1_left.stl
Binary file not shown.
Binary file added v1/meshes/collision/arm/link2_left.stl
Binary file not shown.
Binary file added v1/meshes/collision/arm/link5_left.stl
Binary file not shown.
Binary file added v1/meshes/collision/arm/link6_left.stl
Binary file not shown.
Binary file added v1/meshes/collision/arm/link7_left.stl
Binary file not shown.
Binary file modified v1/meshes/collision/gripper/finger.stl
Binary file not shown.
Binary file modified v1/meshes/collision/gripper/hand.stl
Binary file not shown.
473 changes: 271 additions & 202 deletions v1/openarm.xml

Large diffs are not rendered by default.

396 changes: 200 additions & 196 deletions v1/openarm_bimanual.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion v2/cell/cell.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ limitations under the License.
</default>
<default class="lifter">
<joint limited="true" type="slide" damping="50" />
<position kp="8000" kv="4000" forcelimited="true" forcerange="-3000 3000" ctrllimited="true" />
<position forcelimited="true" forcerange="-3000 3000" ctrllimited="true" />
</default>
</default>

Expand Down
16 changes: 10 additions & 6 deletions v2/openarm_bimanual.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,21 @@ limitations under the License.
<default>
<joint stiffness="0" ref="0.0" />
<default class="robot">
<!-- Armatures approximate motor rotor readouts * gear ratio squared (kg*m^2).
Damping references from motor readouts, assuming the same conversion (N*m*s/rad):
DM8009P ~0.13, DM4340 ~0.33, DM4310 ~0.03. Reference only; gearbox contributions
are unconfirmed. Applied damping is unchanged. -->
<default class="motor_DM8009">
<joint frictionloss="0.2" damping="1.0" armature="0.0081" limited="true" type="hinge" />
<position kp="200" kv="150" forcelimited="true" forcerange="-40 40" ctrllimited="true" />
<joint frictionloss="0.2" damping="1.0" armature="0.016" limited="true" type="hinge" />
<position forcelimited="true" forcerange="-40 40" ctrllimited="true" />
</default>
<default class="motor_DM4340">
<joint frictionloss="0.1" damping="0.9" armature="0.1600" limited="true" type="hinge" />
<position kp="100" kv="30" forcelimited="true" forcerange="-27 27" ctrllimited="true" />
<joint frictionloss="0.1" damping="0.9" armature="0.030" limited="true" type="hinge" />
<position forcelimited="true" forcerange="-27 27" ctrllimited="true" />
</default>
<default class="motor_DM4310">
<joint frictionloss="0.04" damping="0.9" armature="0.0100" limited="true" type="hinge" />
<position kp="200" kv="5" forcelimited="true" forcerange="-7 7" ctrllimited="true" />
<joint frictionloss="0.04" damping="0.9" armature="0.002" limited="true" type="hinge" />
<position forcelimited="true" forcerange="-7 7" ctrllimited="true" />
<!-- Keep gripper-specific friction and damping; inherit DM4310 inertia and limits. -->
<default class="motor_finger">
<joint frictionloss="0" damping="0.6"/>
Expand Down
Loading