-
Notifications
You must be signed in to change notification settings - Fork 9
Articulation use none as default drive type. #210
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -24,7 +24,7 @@ Articulations are configured using the {class}`~cfg.ArticulationCfg` dataclass. | |||||
|
|
||||||
| ### Drive Configuration | ||||||
|
|
||||||
| The `drive_props` parameter controls the joint physics behavior. It is defined using the `JointDrivePropertiesCfg` class. | ||||||
| The `drive_props` parameter controls the joint physics behavior. It is defined using the `JointDrivePropertiesCfg` class. For articulation object without internal drive force, like cabinet and drawer, better set `drive_type` to `"none"`. | ||||||
|
|
||||||
|
Comment on lines
25
to
28
|
||||||
| | Parameter | Type | Default | Description | | ||||||
| | :--- | :--- | :--- | :--- | | ||||||
|
|
@@ -33,7 +33,7 @@ The `drive_props` parameter controls the joint physics behavior. It is defined u | |||||
| | `max_effort` | `float` / `Dict` | `1.0e10` | Maximum effort (force/torque) the joint can exert. | | ||||||
| | `max_velocity` | `float` / `Dict` | `1.0e10` | Maximum velocity allowed for the joint ($m/s$ or $rad/s$). | | ||||||
| | `friction` | `float` / `Dict` | `0.0` | Joint friction coefficient. | | ||||||
| | `drive_type` | `str` | `"force"` | Drive mode: `"force"`(driven by a force), `"acceleration"`(driven by an acceleration) or `none`(no force). | | ||||||
| | `drive_type` | `str` | `"none"` | Drive mode: `"force"`(driven by a force), `"acceleration"`(driven by an acceleration) or `none`(no force). | | ||||||
|
||||||
| | `drive_type` | `str` | `"none"` | Drive mode: `"force"`(driven by a force), `"acceleration"`(driven by an acceleration) or `none`(no force). | | |
| | `drive_type` | `str` | `"force"` | Drive mode: `"force"`(driven by a force), `"acceleration"`(driven by an acceleration) or `none`(no force). | |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,168 @@ | ||||||||||||||||||
| # Cloth Object | ||||||||||||||||||
|
|
||||||||||||||||||
| ```{currentmodule} embodichain.lab.sim | ||||||||||||||||||
| ``` | ||||||||||||||||||
|
|
||||||||||||||||||
| The {class}`~objects.Cloth` class represents deformable surface entities in EmbodiChain. Unlike rigid bodies, cloth objects are defined by vertices and meshes rather than a single rigid pose. | ||||||||||||||||||
|
||||||||||||||||||
| The {class}`~objects.Cloth` class represents deformable surface entities in EmbodiChain. Unlike rigid bodies, cloth objects are defined by vertices and meshes rather than a single rigid pose. | |
| The {class}`~objects.ClothObject` class represents deformable surface entities in EmbodiChain. Unlike rigid bodies, cloth objects are defined by vertices and meshes rather than a single rigid pose. |
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs refer to {class}~objects.Cloth here, but the codebase exports `ClothObject` (see `embodichain/lab/sim/objects/cloth_object.py`). Unless there is an alias not shown here, this should likely be `{class}`~objects.ClothObject to avoid broken references in the generated docs.
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Section title typo: ### CLoth Body Attributes has inconsistent capitalization. Consider renaming to ### Cloth Body Attributes for consistency and readability.
| ### CLoth Body Attributes | |
| ### Cloth Body Attributes |
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in heading: "CLoth" should be "Cloth".
| ### CLoth Body Attributes | |
| ### Cloth Body Attributes |
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Section title has a capitalization typo: "CLoth" -> "Cloth".
| ### CLoth Body Attributes | |
| ### Cloth Body Attributes |
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence says cloth bodies require "voxelization", but ClothObjectCfg only has physical_attr and shape (no voxelization config like SoftObjectCfg has). Consider removing the voxelization reference to keep the cloth docs accurate.
| Cloth bodies require both voxelization and physical attributes. | |
| Cloth bodies require both a mesh shape and physical attributes. |
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section says cloth bodies require "voxelization", but ClothObjectCfg only has shape and physical_attr (no voxelization attributes). Please revise this text to describe the actual cloth configuration requirements.
| ### CLoth Body Attributes | |
| Cloth bodies require both voxelization and physical attributes. | |
| ### Cloth Body Attributes | |
| Cloth bodies are configured using a mesh shape ({class}`~cfg.MeshCfg` via the `shape` field) and physical attributes ({class}`~cfg.ClothPhysicalAttributesCfg` via the `physical_attr` field). |
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setup code example references o3d, os, tempfile, MeshCfg, and ClothPhysicalAttributesCfg but they aren’t imported in the snippet, so it won’t run as written. Add the missing imports (or remove those references) to keep the example executable.
| from embodichain.lab.sim.objects import ClothObject, ClothObjectCfg | |
| from embodichain.lab.sim.objects import ClothObject, ClothObjectCfg | |
| from embodichain.lab.sim.cfg import MeshCfg, ClothPhysicalAttributesCfg | |
| import os | |
| import tempfile | |
| import open3d as o3d |
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar issue in the example docstring: "Returns an vertices and triangles." should be corrected (e.g., "Returns vertices and triangles."), otherwise it reads incorrectly in the rendered documentation.
| Returns an vertices and triangles. | |
| Returns vertices and triangles. |
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small docstring grammar issue in the example: "Returns an vertices and triangles." should be corrected (e.g., "Returns vertices and triangles.")
| Returns an vertices and triangles. | |
| Returns vertices and triangles. |
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setup code block uses o3d, os, and tempfile, but they are not imported in this snippet. Consider adding the missing imports (or explicitly noting the snippet is partial) to prevent copy/paste errors.
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setup code block references MeshCfg and ClothPhysicalAttributesCfg (used in shape=... / physical_attr=...), but the snippet only imports ClothObject/ClothObjectCfg. Consider adding the missing imports so the example is self-contained.
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The vertex API table has a couple of correctness issues: get_current_vertex_velocity() is described as returning positions (should describe velocities), and get_rest_vertex_position()'s return shape is missing a closing parenthesis/backtick. These will confuse readers and should be corrected.
| | `get_current_vertex_velocity()` | `(n_envs, n_vert, 3)` | Current positions of mesh vertices. | | |
| | `get_rest_vertex_position()` | `(n_envs, n_vert, 3` | Rest (initial) positions of collision vertices. | | |
| | `get_current_vertex_velocity()` | `(n_envs, n_vert, 3)` | Current velocities of mesh vertices. | | |
| | `get_rest_vertex_position()` | `(n_envs, n_vert, 3)` | Rest (initial) positions of collision vertices. | |
Copilot
AI
Mar 31, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return shape formatting is broken for get_rest_vertex_position() (missing closing parenthesis/backtick). This will render incorrectly and is ambiguous.
| | `get_rest_vertex_position()` | `(n_envs, n_vert, 3` | Rest (initial) positions of collision vertices. | | |
| | `get_rest_vertex_position()` | `(n_envs, n_vert, 3)` | Rest (initial) positions of collision vertices. | |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -63,8 +63,7 @@ The grid mesh generated earlier is saved to disk and then passed to :meth:`Simul | |||||
| .. literalinclude:: ../../../scripts/tutorials/sim/create_cloth.py | ||||||
| :language: python | ||||||
| :start-at: cloth_verts, cloth_faces = create_2d_grid_mesh | ||||||
| :end-at: ) | ||||||
| :end-before: padding_box_cfg | ||||||
| :end-at: padding_box_cfg = RigidObjectCfg | ||||||
|
||||||
| :end-at: padding_box_cfg = RigidObjectCfg | |
| :end-before: padding_box_cfg = RigidObjectCfg( |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1235,7 +1235,7 @@ def set_joint_drive( | |
| max_effort: torch.Tensor | None = None, | ||
| max_velocity: torch.Tensor | None = None, | ||
| friction: torch.Tensor | None = None, | ||
| drive_type: str = "force", | ||
| drive_type: str = "none", | ||
| joint_ids: Sequence[int] | None = None, | ||
| env_ids: Sequence[int] | None = None, | ||
|
Comment on lines
1236
to
1240
|
||
| ) -> None: | ||
|
Comment on lines
1237
to
1241
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -792,6 +792,41 @@ def _init_control_parts(self, control_parts: Dict[str, List[str]]) -> None: | |
| # Initialize control groups | ||
| self._control_groups = self._extract_control_groups() | ||
|
|
||
| def set_joint_drive( | ||
| self, | ||
| stiffness: torch.Tensor | None = None, | ||
| damping: torch.Tensor | None = None, | ||
| max_effort: torch.Tensor | None = None, | ||
| max_velocity: torch.Tensor | None = None, | ||
| friction: torch.Tensor | None = None, | ||
| drive_type: str = "force", | ||
| joint_ids: Sequence[int] | None = None, | ||
| env_ids: Sequence[int] | None = None, | ||
| ) -> None: | ||
|
Comment on lines
+795
to
+805
|
||
| """Set the drive properties for the robot. | ||
| Different from Articulation, default drive type is 'force' instead of 'none' | ||
|
|
||
| Args: | ||
| stiffness (torch.Tensor): The stiffness of the joint drive with shape (len(env_ids), len(joint_ids)). | ||
| damping (torch.Tensor): The damping of the joint drive with shape (len(env_ids), len(joint_ids)). | ||
| max_effort (torch.Tensor): The maximum effort of the joint drive with shape (len(env_ids), len(joint_ids)). | ||
| max_velocity (torch.Tensor): The maximum velocity of the joint drive with shape (len(env_ids), len(joint_ids)). | ||
| friction (torch.Tensor): The joint friction coefficient with shape (len(env_ids), len(joint_ids)). | ||
| drive_type (str, optional): The type of drive to apply. Defaults to "force". | ||
| joint_ids (Sequence[int] | None, optional): The joint indices to apply the drive to. If None, applies to all joints. Defaults to None. | ||
| env_ids (Sequence[int] | None, optional): The environment indices to apply the drive to. If None, applies to all environments. Defaults to None. | ||
| """ | ||
| super().set_joint_drive( | ||
| stiffness=stiffness, | ||
| damping=damping, | ||
| max_effort=max_effort, | ||
| max_velocity=max_velocity, | ||
| friction=friction, | ||
| drive_type=drive_type, | ||
| joint_ids=joint_ids, | ||
| env_ids=env_ids, | ||
| ) | ||
|
|
||
| def _set_default_joint_drive(self) -> None: | ||
| """Set default joint drive parameters based on the configuration.""" | ||
| import numbers | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor grammar/style: "For articulation object ... better set" is awkward English and could be misread. Consider rephrasing (e.g., "For articulations without internal drive force (e.g., cabinets/drawers), it's better to set
drive_typeto "none".").