Skip to content

Rigid object can use vhacd as decomposition method#344

Open
matafela wants to merge 2 commits into
mainfrom
cj/rigid-object-can-use-vhacd
Open

Rigid object can use vhacd as decomposition method#344
matafela wants to merge 2 commits into
mainfrom
cj/rigid-object-can-use-vhacd

Conversation

@matafela

@matafela matafela commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Description

Rigid object can use vhacd as decomposition method.

example: scripts/tutorials/grasp/grasp_generator.py

Type of change

  • Enhancement (non-breaking change which improves an existing functionality)

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Dependencies have been updated, if applicable.

matafela added 2 commits July 1, 2026 18:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for selecting the convex decomposition backend for rigid mesh collision (enabling V-HACD in addition to CoACD) and wires this option through the mesh-loading path, with an updated tutorial example showing usage.

Changes:

  • Introduced convex_decomposition_method on RigidObjectCfg (defaulting to "coacd").
  • Updated mesh spawning to call load_actor_with_acd(..., method=...) when max_convex_hull_num > 1.
  • Updated the grasp tutorial to use "vhacd" for convex decomposition (and aligned joint regex patterns with existing UR10 tests).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
scripts/tutorials/grasp/grasp_generator.py Uses the new config field in an example (sets convex_decomposition_method="vhacd").
embodichain/lab/sim/utility/sim_utils.py Forwards the configured decomposition method into the actor-loading path for convex decomposition.
embodichain/lab/sim/cfg.py Adds the new RigidObjectCfg.convex_decomposition_method configuration field.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 833 to 835
If `max_convex_hull_num` is set to larger than 1, the rigid body will be decomposed into multiple convex hulls using coacd alogorithm.
Reference: https://github.com/SarahWeiii/CoACD
"""
Comment on lines +837 to +840
convex_decomposition_method: str = "coacd"
"""The method used for convex decomposition of the rigid body.
Currently, "coacd" and "vhacd" is supported. If `max_convex_hull_num` is set to larger than 1, the rigid body will be decomposed into multiple convex hulls using the specified method.
"""
Comment on lines 318 to 320
max_convex_hull_num=max_convex_hull_num,
method=cfg.convex_decomposition_method,
)
cache_path=cache_dir,
actor_type=body_type,
max_convex_hull_num=max_convex_hull_num,
method=cfg.convex_decomposition_method,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants