-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Actuators integration #5455
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
Actuators integration #5455
Changes from all commits
8ec6832
3a86722
88f325f
5632e2e
4751440
59eb3a6
b2718e7
bf56a74
c1915c6
879a715
d12e610
21d937b
0122914
7989143
9052978
2bd037b
354ced7
0d8b794
1f64749
35938c1
ec957c9
f9d1120
16138b0
e9e337f
82a03d9
e7e2619
051dd82
03f8e1d
8e571c7
97f7491
48fe2d7
1009239
24a3362
1a767d4
198e562
c5675d3
232b19d
a74c2e0
0517a80
672d715
426cff1
3f30ec3
7cdd669
6a9d8b0
f215bbd
f4be3f0
a48d3bd
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 |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| Added | ||
| ^^^^^ | ||
|
|
||
| * Added :func:`~isaaclab.sim.schemas.define_actuator_properties` to author | ||
| ``NewtonActuator`` USD prims from IsaacLab actuator configs. Lives alongside | ||
| the other ``define_*_properties`` schema writers and is invoked from the | ||
| schema-side post-spawn hook below. | ||
| * Added :meth:`~isaaclab.assets.AssetBaseCfg._post_spawn` hook (no-op by | ||
| default) invoked by :class:`~isaaclab.assets.AssetBase` after spawning the | ||
| asset. :class:`~isaaclab.assets.ArticulationCfg` overrides it to author | ||
| Newton-native actuator prims from :attr:`~isaaclab.assets.ArticulationCfg.actuators`. | ||
|
|
||
| Changed | ||
| ^^^^^^^ | ||
|
|
||
| * :class:`~isaaclab.assets.BaseArticulation` no longer imports | ||
| ``isaaclab_newton`` from its ``__init__``. Newton-native actuator authoring | ||
| now flows through the generic ``_post_spawn`` hook on | ||
| :class:`~isaaclab.assets.AssetBaseCfg`. | ||
| * :meth:`~isaaclab.physics.PhysicsManager.set_decimation` now has an explicit | ||
| ``pass`` body so the base class is consistent with the other no-op | ||
| classmethods. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ | |
| import torch | ||
| import warp as wp | ||
|
|
||
| from ...sim import SimulationContext | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this still needed? |
||
| from ...utils.leapp.leapp_semantics import OutputKindEnum, joint_names_resolver, leapp_tensor_semantics | ||
| from ..asset_base import AssetBase | ||
|
|
||
|
|
@@ -95,6 +96,8 @@ def __init__(self, cfg: ArticulationCfg): | |
| cfg: A configuration instance. | ||
| """ | ||
| super().__init__(cfg) | ||
| sim_ctx = SimulationContext.instance() | ||
| self._sim_cfg = sim_ctx.cfg if sim_ctx is not None else None | ||
|
Comment on lines
+99
to
+100
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this still needed? |
||
|
|
||
| """ | ||
| Properties | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,8 @@ | |
| import torch | ||
| import warp as wp | ||
|
|
||
| from pxr import Usd | ||
|
|
||
|
Comment on lines
+18
to
+19
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this still needed? |
||
| import isaaclab.sim as sim_utils | ||
| from isaaclab.physics import PhysicsEvent, PhysicsManager | ||
| from isaaclab.sim.simulation_context import SimulationContext | ||
|
|
@@ -79,7 +81,7 @@ def __init__(self, cfg: AssetBaseCfg): | |
| # flag for whether the asset is initialized | ||
| self._is_initialized = False | ||
| # get stage handle | ||
| self.stage = get_current_stage() | ||
| self.stage: Usd.Stage = get_current_stage() | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this still needed? |
||
|
|
||
| # spawn the asset | ||
| # determine path where prims should exist after spawn | ||
|
|
@@ -96,6 +98,8 @@ def __init__(self, cfg: AssetBaseCfg): | |
| matching_prims = sim_utils.find_matching_prims(check_path) | ||
| if len(matching_prims) == 0: | ||
| raise RuntimeError(f"Could not find prim with path {check_path}.") | ||
| # schema-side post-spawn hook (e.g. ArticulationCfg authors NewtonActuator prims here) | ||
| self.cfg._post_spawn(self.stage) | ||
|
Comment on lines
+101
to
+102
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this should be required. We could do this upon parsing the schema. |
||
| else: | ||
| # asset should exist at run time | ||
| check_path = self.cfg.prim_path | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ | |
| from __future__ import annotations | ||
|
|
||
| from dataclasses import MISSING | ||
| from typing import Literal | ||
| from typing import Any, Literal | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. restore |
||
|
|
||
| from isaaclab.sim import SpawnerCfg | ||
| from isaaclab.utils.configclass import configclass | ||
|
|
@@ -88,3 +88,17 @@ class InitialStateCfg: | |
| When ``None`` (the default), shape checks follow Python's ``__debug__`` | ||
| flag — enabled in normal mode, disabled with ``python -O``. | ||
| """ | ||
|
|
||
| def _post_spawn(self, stage: Any) -> None: | ||
| """Hook invoked by :class:`~isaaclab.assets.AssetBase` after the asset's prims are | ||
| spawned and verified to exist on the stage. | ||
|
|
||
| The default implementation is a no-op. Subclasses that need to author additional | ||
| USD schemas tied to this asset (for example, :class:`~isaaclab.assets.ArticulationCfg` | ||
| which authors ``NewtonActuator`` prims from its ``actuators`` mapping) should | ||
| override this method. | ||
|
|
||
| Args: | ||
| stage: The USD stage on which the asset was spawned. | ||
| """ | ||
| pass | ||
|
Comment on lines
+91
to
+104
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nuke |
||
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.
Is this still needed?