Articulation use none as default drive type.#210
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aligns joint-drive defaults by changing Articulation.set_joint_drive() to default to "none" while keeping Robot default behavior at "force", and expands simulation documentation with a new cloth overview plus related doc updates.
Changes:
- Change
Articulation.set_joint_drive()defaultdrive_typefrom"force"to"none". - Add
Robot.set_joint_drive()override to preserve the robot defaultdrive_type="force". - Add/adjust documentation for cloth assets and articulation drive-type guidance.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
embodichain/lab/sim/objects/robot.py |
Adds a set_joint_drive() override so robots keep default drive type "force". |
embodichain/lab/sim/objects/articulation.py |
Switches the articulation API default drive type to "none". |
docs/source/tutorial/create_cloth.rst |
Tweaks the included snippet boundaries for the cloth tutorial. |
docs/source/overview/sim/sim_soft_object.md |
Updates soft-object intro wording (removes cloth example). |
docs/source/overview/sim/sim_cloth.md |
Introduces new cloth-object overview documentation page. |
docs/source/overview/sim/sim_assets.md |
Adds the cloth overview page to the sim assets toctree. |
docs/source/overview/sim/sim_articulation.md |
Updates drive-type default and adds guidance for drive-less articulations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| :start-at: cloth_verts, cloth_faces = create_2d_grid_mesh | ||
| :end-at: ) | ||
| :end-before: padding_box_cfg | ||
| :end-at: padding_box_cfg = RigidObjectCfg |
There was a problem hiding this comment.
This literalinclude now ends at the line containing padding_box_cfg = RigidObjectCfg, which in the referenced script is the start of a multi-line call. This will include an incomplete statement (unclosed parenthesis) in the rendered docs. Consider ending before padding_box_cfg (e.g., using :end-before:) or ending at the closing ) of the cloth spawn block so the snippet is syntactically complete.
| :end-at: padding_box_cfg = RigidObjectCfg | |
| :end-before: padding_box_cfg = RigidObjectCfg( |
| 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, |
There was a problem hiding this comment.
drive_type now defaults to "none", but the docstring parameter description still states it defaults to "force". This is misleading for API consumers; please update the docstring to match the new default (and adjust any related wording if needed).
| Different from Articulation, default drive type is 'force' instead of 'none' | ||
|
|
There was a problem hiding this comment.
The new set_joint_drive docstring has inconsistent indentation on the second line (it is indented further than the opening line), which will render oddly in generated docs. Consider reflowing this sentence and aligning indentation with the rest of the docstring.
| Different from Articulation, default drive type is 'force' instead of 'none' | |
| Different from ``Articulation``, the default drive type is ``"force"`` instead of ``"none"``. |
| 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. | ||
|
|
||
| ## Configuration | ||
|
|
||
| Configured via {class}`~cfg.ClothObjectCfg`. |
There was a problem hiding this comment.
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.
| | `physical_attr` | `ClothPhysicalAttributesCfg` | `...` | Physical attributes. | | ||
| | `shape` | `MeshCfg` | `MeshCfg()` | Mesh configuration. | | ||
|
|
||
| ### CLoth Body Attributes |
There was a problem hiding this comment.
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 |
| | `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. | |
There was a problem hiding this comment.
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. | |
| ### 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"`. |
There was a problem hiding this comment.
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_type to "none".").
| 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"`. | |
| The `drive_props` parameter controls the joint physics behavior. It is defined using the `JointDrivePropertiesCfg` class. For articulations without internal drive force (e.g., cabinets and drawers), it's better to set `drive_type` to `"none"`. |
| The rectangle is subdivided into an `nx` by `ny` grid (cells) and | ||
| triangulated. `nx=1, ny=1` yields the simple two-triangle rectangle. | ||
|
|
||
| Returns an vertices and triangles. |
There was a problem hiding this comment.
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. |
| # 2. Configure Cloth Object | ||
| cfg=ClothObjectCfg( | ||
| uid="cloth_demo", | ||
| shape=MeshCfg(fpath=cloth_save_path), | ||
| init_pos=[0.5, 0.0, 0.3], |
There was a problem hiding this comment.
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.
| cloth_verts, cloth_faces = create_2d_grid_mesh(width=0.3, height=0.3, nx=12, ny=12) | ||
| cloth_mesh = o3d.geometry.TriangleMesh( | ||
| vertices=o3d.utility.Vector3dVector(cloth_verts.to("cpu").numpy()), | ||
| triangles=o3d.utility.Vector3iVector(cloth_faces.to("cpu").numpy()), | ||
| ) |
There was a problem hiding this comment.
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.
641ee5a to
8cacfaf
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 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, |
There was a problem hiding this comment.
The drive_type parameter default was changed to "none", but the docstring still says it defaults to "force". Please update the docstring to match the new default so callers aren’t misled.
| | `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). | |
There was a problem hiding this comment.
The docs list the default drive_type as "none", but the actual config default is still "force" (JointDrivePropertiesCfg.drive_type = "force" in embodichain/lab/sim/cfg.py:502). Either update the code default (if intended) or correct this documentation default to avoid confusing users.
| | `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). | |
| | `physical_attr` | `ClothPhysicalAttributesCfg` | `...` | Physical attributes. | | ||
| | `shape` | `MeshCfg` | `MeshCfg()` | Mesh configuration. | | ||
|
|
||
| ### CLoth Body Attributes |
There was a problem hiding this comment.
Typo in heading: "CLoth" should be "Cloth".
| ### CLoth Body Attributes | |
| ### Cloth Body Attributes |
| ### CLoth Body Attributes | ||
|
|
||
| Cloth bodies require both voxelization and physical attributes. |
There was a problem hiding this comment.
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). |
| ```python | ||
| import torch | ||
| from embodichain.lab.sim import SimulationManager, SimulationManagerCfg | ||
| from embodichain.lab.sim.objects import ClothObject, ClothObjectCfg |
There was a problem hiding this comment.
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 |
| The rectangle is subdivided into an `nx` by `ny` grid (cells) and | ||
| triangulated. `nx=1, ny=1` yields the simple two-triangle rectangle. | ||
|
|
||
| Returns an vertices and triangles. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ### 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"`. | ||
|
|
There was a problem hiding this comment.
Documentation refers to drive_props, but the actual config field used throughout the codebase (and other docs) is drive_pros. Using the wrong name here is confusing and can lead users to pass an unsupported parameter name.
| ```{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. |
There was a problem hiding this comment.
objects.Cloth doesn’t appear to exist in the codebase (the implementation/export is objects.ClothObject). The class reference here should be updated so the docs resolve correctly.
| 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. |
| | `physical_attr` | `ClothPhysicalAttributesCfg` | `...` | Physical attributes. | | ||
| | `shape` | `MeshCfg` | `MeshCfg()` | Mesh configuration. | | ||
|
|
||
| ### CLoth Body Attributes |
There was a problem hiding this comment.
Section title has a capitalization typo: "CLoth" -> "Cloth".
| ### CLoth Body Attributes | |
| ### Cloth Body Attributes |
| | :--- | :--- | :--- | | ||
| | `get_current_vertex_position()` | `(n_envs, n_vert, 3)` | Current positions of mesh vertices. | | ||
| | `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. | |
There was a problem hiding this comment.
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. | |
| 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, | ||
| ) -> None: |
There was a problem hiding this comment.
drive_type now defaults to "none" in the signature, but the docstring below still states the default is "force". Please update the docstring to avoid misleading API docs.
| 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: |
There was a problem hiding this comment.
Adding this override changes the default drive_type only for explicit calls to Robot.set_joint_drive(). It does not prevent robots from initializing with drive_type="none" via RobotCfg inheriting ArticulationCfg’s new default. If the intent is for Robot defaults to remain "force", consider also overriding drive_pros in RobotCfg (or adjusting Robot’s initialization fallback).
Description
noneas default drive type. But robot still useforceas default drive type.Fixes # (issue)
noneas default drive type.Type of change
Checklist
black .command to format the code base.