Skip to content
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
151 changes: 151 additions & 0 deletions docs/source/how-to/write_articulation_cfg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,154 @@ to combine them into a single actuator model.
damping={"slider_to_cart": 10.0, "cart_to_pole": 0.0},
),
},


ActuatorCfg velocity/effort limits considerations
-------------------------------------------------

In IsaacLab v1.4.0, the plain ``velocity_limit`` and ``effort_limit`` attributes were **not** consistently
pushed into the physics solver:

- **Implicit actuators**
- velocity_limit was ignored (never set in simulation)
- effort_limit was set into simulation

- **Explicit actuators**
- both velocity_limit and effort_limit were used only by the drive model, not by the solver


In v2.0.1 we accidentally changed this: all velocity_limit & effort_limit, implicit or
explicit, were being applied to the solver. That caused many training under the old default uncaped solver
limits to break.

To restore the original behavior while still giving users full control over solver limits, we introduced two new flags:

* **velocity_limit_sim**
Sets the physics-solver's maximum joint-velocity cap in simulation.

* **effort_limit_sim**
Sets the physics-solver's maximum joint-effort cap in simulation.


These explicitly set the solver's joint-velocity and joint-effort caps at simulation level.

On the other hand, velocity_limit and effort_limit model the motor's hardware-level constraints in torque
computation for all explicit actuators rather than limiting simulation-level constraint.
For implicit actuators, since they do not model motor hardware limitations, ``velocity_limit`` were removed in v2.1.1
and marked as deprecated. This preserves same behavior as they did in v1.4.0. Eventually, ``velocity_limit`` and
``effort_limit`` will be deprecated for implicit actuators, preserving only ``velocity_limit_sim`` and
``effort_limit_sim``


.. table:: Limit Options Comparison

.. list-table::
:header-rows: 1
:widths: 20 40 40

* - **Attribute**
- **Implicit Actuator**
- **Explicit Actuator**
* - ``velocity_limit``
- Deprecated (alias for ``velocity_limit_sim``)
- Used by the model (e.g. DC motor), not set into simulation
* - ``effort_limit``
- Deprecated (alias for ``effort_limit_sim``)
- Used by the model, not set into simulation
* - ``velocity_limit_sim``
- Set into simulation
- Set into simulation
* - ``effort_limit_sim``
- Set into simulation
- Set into simulation



Users who want to tune the underlying physics-solver limits should set the ``_sim`` flags.


USD vs. ActuatorCfg discrepancy resolution
------------------------------------------

USD having default value and the fact that ActuatorCfg can be specified with None, or a overriding value can sometime be
confusing what exactly gets written into simulation. The resolution follows these simple rules,per joint and per
property:

.. table:: Resolution Rules for USD vs. ActuatorCfg

+------------------------+------------------------+--------------------+
| **Condition** | **ActuatorCfg Value** | **Applied** |
+========================+========================+====================+
| No override provided | Not Specified | USD Value |
+------------------------+------------------------+--------------------+
| Override provided | User's ActuatorCfg | Same as ActuatorCfg|
+------------------------+------------------------+--------------------+


Digging into USD can sometime be unconvinent, to help clarify what exact value is written, we designed a flag
:attr:`~isaaclab.assets.ArticulationCfg.actuator_value_resolution_debug_print`,
to help user figure out what exact value gets used in simulation.

Whenever an actuator parameter is overridden in the user's ActuatorCfg (or left unspecified),
we compare it to the value read from the USD definition and record any differences. For each joint and each property,
if unmatching value is found, we log the resolution:

1. **USD Value**
The default limit or gain parsed from the USD asset.

2. **ActuatorCfg Value**
The user-provided override (or “Not Specified” if none was given).

3. **Applied**
The final value actually used for simulation: if the user didn't override it, this matches the USD value;
otherwise it reflects the user's setting.

This resolution info is emitted as a warning table only when discrepancies exist.
Here's an example of what you'll see::

+----------------+--------------------+---------------------+----+-------------+--------------------+----------+
| Group | Property | Name | ID | USD Value | ActuatorCfg Value | Applied |
+----------------+--------------------+---------------------+----+-------------+--------------------+----------+
| panda_shoulder | velocity_limit_sim | panda_joint1 | 0 | 2.17e+00 | Not Specified | 2.17e+00 |
| | | panda_joint2 | 1 | 2.17e+00 | Not Specified | 2.17e+00 |
| | | panda_joint3 | 2 | 2.17e+00 | Not Specified | 2.17e+00 |
| | | panda_joint4 | 3 | 2.17e+00 | Not Specified | 2.17e+00 |
| | stiffness | panda_joint1 | 0 | 2.29e+04 | 8.00e+01 | 8.00e+01 |
| | | panda_joint2 | 1 | 2.29e+04 | 8.00e+01 | 8.00e+01 |
| | | panda_joint3 | 2 | 2.29e+04 | 8.00e+01 | 8.00e+01 |
| | | panda_joint4 | 3 | 2.29e+04 | 8.00e+01 | 8.00e+01 |
| | damping | panda_joint1 | 0 | 4.58e+03 | 4.00e+00 | 4.00e+00 |
| | | panda_joint2 | 1 | 4.58e+03 | 4.00e+00 | 4.00e+00 |
| | | panda_joint3 | 2 | 4.58e+03 | 4.00e+00 | 4.00e+00 |
| | | panda_joint4 | 3 | 4.58e+03 | 4.00e+00 | 4.00e+00 |
| | armature | panda_joint1 | 0 | 0.00e+00 | Not Specified | 0.00e+00 |
| | | panda_joint2 | 1 | 0.00e+00 | Not Specified | 0.00e+00 |
| | | panda_joint3 | 2 | 0.00e+00 | Not Specified | 0.00e+00 |
| | | panda_joint4 | 3 | 0.00e+00 | Not Specified | 0.00e+00 |
| panda_forearm | velocity_limit_sim | panda_joint5 | 4 | 2.61e+00 | Not Specified | 2.61e+00 |
| | | panda_joint6 | 5 | 2.61e+00 | Not Specified | 2.61e+00 |
| | | panda_joint7 | 6 | 2.61e+00 | Not Specified | 2.61e+00 |
| | stiffness | panda_joint5 | 4 | 2.29e+04 | 8.00e+01 | 8.00e+01 |
| | | panda_joint6 | 5 | 2.29e+04 | 8.00e+01 | 8.00e+01 |
| | | panda_joint7 | 6 | 2.29e+04 | 8.00e+01 | 8.00e+01 |
| | damping | panda_joint5 | 4 | 4.58e+03 | 4.00e+00 | 4.00e+00 |
| | | panda_joint6 | 5 | 4.58e+03 | 4.00e+00 | 4.00e+00 |
| | | panda_joint7 | 6 | 4.58e+03 | 4.00e+00 | 4.00e+00 |
| | armature | panda_joint5 | 4 | 0.00e+00 | Not Specified | 0.00e+00 |
| | | panda_joint6 | 5 | 0.00e+00 | Not Specified | 0.00e+00 |
| | | panda_joint7 | 6 | 0.00e+00 | Not Specified | 0.00e+00 |
| | friction | panda_joint5 | 4 | 0.00e+00 | Not Specified | 0.00e+00 |
| | | panda_joint6 | 5 | 0.00e+00 | Not Specified | 0.00e+00 |
| | | panda_joint7 | 6 | 0.00e+00 | Not Specified | 0.00e+00 |
| panda_hand | velocity_limit_sim | panda_finger_joint1 | 7 | 2.00e-01 | Not Specified | 2.00e-01 |
| | | panda_finger_joint2 | 8 | 2.00e-01 | Not Specified | 2.00e-01 |
| | stiffness | panda_finger_joint1 | 7 | 1.00e+06 | 2.00e+03 | 2.00e+03 |
| | | panda_finger_joint2 | 8 | 1.00e+06 | 2.00e+03 | 2.00e+03 |
| | armature | panda_finger_joint1 | 7 | 0.00e+00 | Not Specified | 0.00e+00 |
| | | panda_finger_joint2 | 8 | 0.00e+00 | Not Specified | 0.00e+00 |
| | friction | panda_finger_joint1 | 7 | 0.00e+00 | Not Specified | 0.00e+00 |
| | | panda_finger_joint2 | 8 | 0.00e+00 | Not Specified | 0.00e+00 |
+----------------+--------------------+---------------------+----+-------------+--------------------+----------+

To keep the cleaniness of logging, :attr:`~isaaclab.assets.ArticulationCfg.actuator_value_resolution_debug_print`
default to False, remember to turn it on when wishes.
16 changes: 8 additions & 8 deletions docs/source/migration/migrating_from_isaacgymenvs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -692,18 +692,18 @@ the need to set simulation parameters for actors in the task implementation.
| asset_root = os.path.dirname(asset_path) | actuators={ |
| asset_file = os.path.basename(asset_path) | "cart_actuator": ImplicitActuatorCfg( |
| | joint_names_expr=["slider_to_cart"], |
| asset_options = gymapi.AssetOptions() | effort_limit=400.0, |
| asset_options.fix_base_link = True | velocity_limit=100.0, |
| asset_options = gymapi.AssetOptions() | effort_limit_sim=400.0, |

@Mayankm96 Mayankm96 Jul 26, 2025 •

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.

Be careful. Here this is IsaacGym API.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The gym api code is not modified, the documentation change is on the isaaclab api. Let me know if I misunderstood your comment : )).

| asset_options.fix_base_link = True | velocity_limit_sim=100.0, |
| cartpole_asset = self.gym.load_asset(self.sim, | stiffness=0.0, |
| asset_root, asset_file, asset_options) | damping=10.0, |
| self.num_dof = self.gym.get_asset_dof_count( | ), |
| cartpole_asset) | "pole_actuator": ImplicitActuatorCfg( |
| | joint_names_expr=["cart_to_pole"], effort_limit=400.0, |
| pose = gymapi.Transform() | velocity_limit=100.0, stiffness=0.0, damping=0.0 |
| if self.up_axis == 'z': | ), |
| pose.p.z = 2.0 | }, |
| pose.r = gymapi.Quat(0.0, 0.0, 0.0, 1.0) | ) |
| else: | |
| | joint_names_expr=["cart_to_pole"], |
| pose = gymapi.Transform() | effort_limit_sim=400.0, velocity_limit_sim=100.0, |
| if self.up_axis == 'z': | stiffness=0.0, damping=0.0 |
| pose.p.z = 2.0 | ), |
| pose.r = gymapi.Quat(0.0, 0.0, 0.0, 1.0) | }, |
| else: | ) |
| pose.p.y = 2.0 | |
| pose.r = gymapi.Quat( | |
| -np.sqrt(2)/2, 0.0, 0.0, np.sqrt(2)/2) | |
Expand Down
4 changes: 2 additions & 2 deletions docs/source/migration/migrating_from_omniisaacgymenvs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ including file path, simulation parameters, actuator properties, and initial sta
actuators={
"cart_actuator": ImplicitActuatorCfg(
joint_names_expr=["slider_to_cart"],
effort_limit=400.0,
velocity_limit=100.0,
effort_limit_sim=400.0,
velocity_limit_sim=100.0,
stiffness=0.0,
damping=10.0,
),
Expand Down
56 changes: 44 additions & 12 deletions source/isaaclab/isaaclab/actuators/actuator_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,24 +144,44 @@ def __init__(
self._device = device
self._joint_names = joint_names
self._joint_indices = joint_ids

self.joint_property_resolution_table: dict[str, list] = {}
# For explicit models, we do not want to enforce the effort limit through the solver
# (unless it is explicitly set)
if not self.is_implicit_model and self.cfg.effort_limit_sim is None:
self.cfg.effort_limit_sim = self._DEFAULT_MAX_EFFORT_SIM

# parse joint stiffness and damping
self.stiffness = self._parse_joint_parameter(self.cfg.stiffness, stiffness)
self.damping = self._parse_joint_parameter(self.cfg.damping, damping)
# parse joint armature and friction
self.armature = self._parse_joint_parameter(self.cfg.armature, armature)
self.friction = self._parse_joint_parameter(self.cfg.friction, friction)
# parse joint limits
# -- velocity
self.velocity_limit_sim = self._parse_joint_parameter(self.cfg.velocity_limit_sim, velocity_limit)
# resolve usd, actuator configuration values
# case 1: if usd_value == actuator_cfg_value: all good,
# case 2: if usd_value != actuator_cfg_value: we use actuator_cfg_value
# case 3: if actuator_cfg_value is None: we use usd_value

to_check = [
("velocity_limit_sim", velocity_limit),
("effort_limit_sim", effort_limit),
("stiffness", stiffness),
("damping", damping),
("armature", armature),
("friction", friction),
]
for param_name, usd_val in to_check:
cfg_val = getattr(self.cfg, param_name)
setattr(self, param_name, self._parse_joint_parameter(cfg_val, usd_val))
new_val = getattr(self, param_name)

allclose = (
torch.all(new_val == usd_val) if isinstance(usd_val, (float, int)) else torch.allclose(new_val, usd_val)
)
if cfg_val is None or not allclose:
self._record_actuator_resolution(
cfg_val=getattr(self.cfg, param_name),
new_val=new_val[0], # new val always has the shape of (num_envs, num_joints)
usd_val=usd_val,
joint_names=joint_names,
joint_ids=joint_ids,
actuator_param=param_name,
)

self.velocity_limit = self._parse_joint_parameter(self.cfg.velocity_limit, self.velocity_limit_sim)
# -- effort
self.effort_limit_sim = self._parse_joint_parameter(self.cfg.effort_limit_sim, effort_limit)
self.effort_limit = self._parse_joint_parameter(self.cfg.effort_limit, self.effort_limit_sim)

# create commands buffers for allocation
Expand Down Expand Up @@ -246,6 +266,18 @@ def compute(
Helper functions.
"""

def _record_actuator_resolution(self, cfg_val, new_val, usd_val, joint_names, joint_ids, actuator_param: str):
if actuator_param not in self.joint_property_resolution_table:
self.joint_property_resolution_table[actuator_param] = []
table = self.joint_property_resolution_table[actuator_param]

ids = joint_ids if isinstance(joint_ids, torch.Tensor) else list(range(len(joint_names)))
for idx, name in enumerate(joint_names):
cfg_val_log = "Not Specified" if cfg_val is None else float(new_val[idx])
default_usd_val = usd_val if isinstance(usd_val, (float, int)) else float(usd_val[0][idx])
applied_val_log = default_usd_val if cfg_val is None else float(new_val[idx])
table.append([name, int(ids[idx]), default_usd_val, cfg_val_log, applied_val_log])

def _parse_joint_parameter(
self, cfg_value: float | dict[str, float] | None, default_value: float | torch.Tensor | None
) -> torch.Tensor:
Expand Down
13 changes: 13 additions & 0 deletions source/isaaclab/isaaclab/assets/articulation/articulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1443,6 +1443,19 @@ def _process_actuators_cfg(self):
f" joints available: {total_act_joints} != {self.num_joints - self.num_fixed_tendons}."
)

if self.cfg.actuator_value_resolution_debug_print:
t = PrettyTable(["Group", "Property", "Name", "ID", "USD Value", "ActutatorCfg Value", "Applied"])
for actuator_group, actuator in self.actuators.items():
group_count = 0
for property, resolution_details in actuator.joint_property_resolution_table.items():
for prop_idx, resolution_detail in enumerate(resolution_details):
actuator_group_str = actuator_group if group_count == 0 else ""
property_str = property if prop_idx == 0 else ""
fmt = [f"{v:.2e}" if isinstance(v, float) else str(v) for v in resolution_detail]
t.add_row([actuator_group_str, property_str, *fmt])
group_count += 1
omni.log.warn(f"\nActuatorCfg-USD Value Discrepancy Resolution (matching values are skipped): \n{t}")

def _process_fixed_tendons(self):
"""Process fixed tendons."""
# create a list to store the fixed tendon names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ class InitialStateCfg(AssetBaseCfg.InitialStateCfg):

actuators: dict[str, ActuatorBaseCfg] = MISSING
"""Actuators for the robot with corresponding joint names."""

actuator_value_resolution_debug_print = False
"""Print the resolution of actuator final value when input cfg is different from USD value, Defaults to False
"""
3 changes: 1 addition & 2 deletions source/isaaclab_assets/isaaclab_assets/robots/allegro.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@
actuators={
"fingers": ImplicitActuatorCfg(
joint_names_expr=[".*"],
effort_limit=0.5,
velocity_limit=100.0,
effort_limit_sim=0.5,
stiffness=3.0,
damping=0.1,
friction=0.01,
Expand Down
Loading