Skip to content

add utilities for tendon wrapping #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 16, 2025
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
3 changes: 3 additions & 0 deletions mujoco_warp/_src/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def put_model(mjm: mujoco.MjModel) -> types.Model:
if unsupported.any():
raise NotImplementedError(f"{field_str} {field[unsupported]} not supported.")

if np.isin(mjm.wrap_type, [types.WrapType.SPHERE, types.WrapType.CYLINDER]).any():
raise NotImplementedError("Tendon geom wrapping not supported.")

if mjm.nplugin > 0:
raise NotImplementedError("Plugins are unsupported.")

Expand Down
4 changes: 2 additions & 2 deletions mujoco_warp/_src/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
# ==============================================================================

from typing import Tuple
from typing import Any, Tuple

import warp as wp

Expand Down Expand Up @@ -213,7 +213,7 @@ def make_frame(a: wp.vec3):


@wp.func
def normalize_with_norm(x: wp.vec3):
def normalize_with_norm(x: Any):
norm = wp.length(x)
if norm == 0.0:
return x, 0.0
Expand Down
6 changes: 5 additions & 1 deletion mujoco_warp/_src/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,15 @@ class WrapType(enum.IntEnum):
Members:
JOINT: constant moment arm
SITE: pass through site
SPHERE: wrap around sphere
CYLINDER: wrap around (infinite) cylinder
"""

JOINT = mujoco.mjtWrap.mjWRAP_JOINT
SITE = mujoco.mjtWrap.mjWRAP_SITE
# unsupported: PULLEY, SPHERE, CYLINDER
SPHERE = mujoco.mjtWrap.mjWRAP_SPHERE
CYLINDER = mujoco.mjtWrap.mjWRAP_CYLINDER
# unsupported: PULLEY


class vec5f(wp.types.vector(length=5, dtype=float)):
Expand Down
Loading
Loading