Skip to content

Commit 4c4377d

Browse files
Adds velocity_limit_sim and effort_limit_sim to actuator (#1654)
# Description <!-- Thank you for your interest in sending a pull request. Please make sure to check the contribution guidelines. Link: https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html --> This PR follows up on [Issue 1384](#1384) and [PR 1509](#1509) by seperating actuator limits for calculating computed torques from physics solver limits. Fixes # (#1384) <!-- As a practice, it is recommended to open an issue to have discussions on the proposed pull request. This makes it easier for the community to keep track of what is being developed or added, and if a given feature is demanded by more than one party. --> ## Type of change <!-- As you go through the list, delete the ones that are not applicable. --> - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) ## Screenshots Please attach before and after screenshots of the change if applicable. <!-- Example: | Before | After | | ------ | ----- | | _gif/png before_ | _gif/png after_ | To upload images to a PR -- simply drag and drop an image while in edit mode and it should upload the image directly. You can then paste that source into the above before/after sections. --> ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there <!-- As you go through the checklist above, you can mark something as done by putting an x character in it For example, - [x] I have done this task - [ ] I have not done this task --> --------- Signed-off-by: James Tigue <[email protected]> Co-authored-by: Pascal Roth <[email protected]>
1 parent 157c6b7 commit 4c4377d

File tree

6 files changed

+86
-14
lines changed

6 files changed

+86
-14
lines changed

source/isaaclab/config/extension.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
# Note: Semantic Versioning is used: https://semver.org/
4-
version = "0.33.17"
4+
version = "0.34.0"
55

66
# Description
77
title = "Isaac Lab framework for Robot Learning"

source/isaaclab/docs/CHANGELOG.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
Changelog
22
---------
33

4+
0.34.0 (2025-02-14)
5+
~~~~~~~~~~~~~~~~~~~~
6+
7+
Fixed
8+
^^^^^
9+
10+
* Adds attributes velocity_limits_sim and effort_limits_sim to :class:`isaaclab.actuators.AssetBaseCfg` to separate
11+
solver limits from actuator limits.
12+
13+
414
0.33.17 (2025-02-13)
515
~~~~~~~~~~~~~~~~~~~~
616

source/isaaclab/isaaclab/actuators/actuator_base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ def __init__(
110110
# note: for velocity limits, we don't have USD parameter, so default is infinity
111111
self.effort_limit = self._parse_joint_parameter(self.cfg.effort_limit, effort_limit)
112112
self.velocity_limit = self._parse_joint_parameter(self.cfg.velocity_limit, velocity_limit)
113+
self.effort_limit_sim = self._parse_joint_parameter(self.cfg.effort_limit_sim, effort_limit)
114+
self.velocity_limit_sim = self._parse_joint_parameter(self.cfg.velocity_limit_sim, velocity_limit)
113115

114116
# create commands buffers for allocation
115117
self.computed_effort = torch.zeros(self._num_envs, self.num_joints, device=self._device)

source/isaaclab/isaaclab/actuators/actuator_cfg.py

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,45 @@ class ActuatorBaseCfg:
3333
effort_limit: dict[str, float] | float | None = None
3434
"""Force/Torque limit of the joints in the group. Defaults to None.
3535
36-
If None, the limit is set to the value specified in the USD joint prim.
36+
This limit is used to clip the computed torque sent to the simulation. If None, the limit is set to the value
37+
specified in the USD joint prim.
38+
39+
.. note::
40+
41+
For ImplicitActuators this value will be collapsed with effort_limit_sim due to duplicating functionality. If
42+
both are set the effort_limit_sim will be used priority.
3743
"""
3844

3945
velocity_limit: dict[str, float] | float | None = None
4046
"""Velocity limit of the joints in the group. Defaults to None.
4147
42-
If None, the limit is set to the value specified in the USD joint prim.
48+
This limit is used by the actuator model. If None, the limit is set to the value specified in the USD joint prim.
49+
50+
.. note::
51+
52+
velocity_limit is not used in ActuatorBaseCfg but is provided for inherited version like
53+
:class:`isaaclab.actuators.DCMotor`.
54+
55+
.. note::
56+
57+
For ImplicitActuators this value will be collapsed with velocity_limit_sim due to duplicating functionality. If
58+
both are set the effort_limit_sim will be used priority.
59+
"""
60+
61+
effort_limit_sim: dict[str, float] | float | None = None
62+
"""Force/Torque limit of the joints in the group that will be propagated to the simulation physics solver. Defaults to None.
63+
64+
If None, the limit is set to the value specified in the USD joint prim for ImplicitActuators or 1.0e9 for explicit
65+
actuators (e.g. IdealPDActuator). The simulation effort limits prevent computed torques from exceeding the specified
66+
limit. If effort limits are too tight issues with solver convergence may occur. It is suggested to keep these value large.
67+
"""
68+
69+
velocity_limit_sim: dict[str, float] | float | None = None
70+
"""Velocity limit of the joints in the group that will be propagated to the simulation physics solver. Defaults to None.
71+
72+
If None, the limit is set to the value specified in the USD joint prim. Resulting solver solutions will constrain
73+
velocities by these limits. If velocity_limit_sim is too tight issues with solver convergence may occur. It is
74+
suggested to keep these value large.
4375
"""
4476

4577
stiffness: dict[str, float] | float | None = MISSING

source/isaaclab/isaaclab/assets/articulation/articulation.py

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,20 +1339,48 @@ def _process_actuators_cfg(self):
13391339
# set the passed gains and limits into the simulation
13401340
if isinstance(actuator, ImplicitActuator):
13411341
self._has_implicit_actuators = True
1342+
# resolve actuator limit duplication for ImplicitActuators
1343+
# effort limits
1344+
if actuator.effort_limit_sim is None and actuator.effort_limit is not None:
1345+
omni.log.warn(
1346+
f"ImplicitActuatorCfg {actuator_name} has effort_limit_sim=None but is specifying effort_limit."
1347+
"effort_limit will be applied to effort_limit_sim for ImplicitActuators."
1348+
)
1349+
actuator.effort_limit_sim = actuator.effort_limit
1350+
elif actuator.effort_limit_sim is not None and actuator.effort_limit is not None:
1351+
omni.log.warn(
1352+
f"ImplicitActuatorCfg {actuator_name} has set both effort_limit_sim and effort_limit."
1353+
"Only effort_limit_sim will be used for ImplicitActuators."
1354+
)
1355+
# velocity limits
1356+
if actuator.velocity_limit_sim is None and actuator.velocity_limit is not None:
1357+
omni.log.warn(
1358+
f"ImplicitActuatorCfg {actuator_name} has velocity_limit_sim=None but is specifying"
1359+
" velocity_limit.velocity_limit will be applied to velocity_limit_sim for ImplicitActuators."
1360+
)
1361+
actuator.velocity_limit_sim = actuator.velocity_limit
1362+
elif actuator.velocity_limit_sim is not None and actuator.velocity_limit is not None:
1363+
omni.log.warn(
1364+
f"ImplicitActuatorCfg {actuator_name} has set both velocity_limit_sim and velocity_limit."
1365+
"Only velocity_limit_sim will be used for ImplicitActuators."
1366+
)
13421367
# the gains and limits are set into the simulation since actuator model is implicit
13431368
self.write_joint_stiffness_to_sim(actuator.stiffness, joint_ids=actuator.joint_indices)
13441369
self.write_joint_damping_to_sim(actuator.damping, joint_ids=actuator.joint_indices)
1345-
self.write_joint_effort_limit_to_sim(actuator.effort_limit, joint_ids=actuator.joint_indices)
1346-
self.write_joint_velocity_limit_to_sim(actuator.velocity_limit, joint_ids=actuator.joint_indices)
1370+
self.write_joint_effort_limit_to_sim(actuator.effort_limit_sim, joint_ids=actuator.joint_indices)
1371+
self.write_joint_velocity_limit_to_sim(actuator.velocity_limit_sim, joint_ids=actuator.joint_indices)
13471372
self.write_joint_armature_to_sim(actuator.armature, joint_ids=actuator.joint_indices)
13481373
self.write_joint_friction_to_sim(actuator.friction, joint_ids=actuator.joint_indices)
13491374
else:
13501375
# the gains and limits are processed by the actuator model
13511376
# we set gains to zero, and torque limit to a high value in simulation to avoid any interference
13521377
self.write_joint_stiffness_to_sim(0.0, joint_ids=actuator.joint_indices)
13531378
self.write_joint_damping_to_sim(0.0, joint_ids=actuator.joint_indices)
1354-
self.write_joint_effort_limit_to_sim(1.0e9, joint_ids=actuator.joint_indices)
1355-
self.write_joint_velocity_limit_to_sim(actuator.velocity_limit, joint_ids=actuator.joint_indices)
1379+
self.write_joint_effort_limit_to_sim(
1380+
1.0e9 if actuator.effort_limit_sim is None else actuator.effort_limit_sim,
1381+
joint_ids=actuator.joint_indices,
1382+
)
1383+
self.write_joint_velocity_limit_to_sim(actuator.velocity_limit_sim, joint_ids=actuator.joint_indices)
13561384
self.write_joint_armature_to_sim(actuator.armature, joint_ids=actuator.joint_indices)
13571385
self.write_joint_friction_to_sim(actuator.friction, joint_ids=actuator.joint_indices)
13581386
# Store the actual default stiffness and damping values for explicit and implicit actuators (not written the sim)

source/isaaclab/test/assets/test_articulation.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def generate_articulation_cfg(
4343
articulation_type: Literal["humanoid", "panda", "anymal", "shadow_hand", "single_joint"],
4444
stiffness: float | None = 10.0,
4545
damping: float | None = 2.0,
46-
vel_limit: float | None = 100.0,
47-
effort_limit: float | None = 400.0,
46+
vel_limit_sim: float | None = None,
47+
effort_limit_sim: float | None = None,
4848
) -> ArticulationCfg:
4949
"""Generate an articulation configuration.
5050
@@ -75,8 +75,8 @@ def generate_articulation_cfg(
7575
actuators={
7676
"joint": ImplicitActuatorCfg(
7777
joint_names_expr=[".*"],
78-
effort_limit=effort_limit,
79-
velocity_limit=vel_limit,
78+
effort_limit_sim=effort_limit_sim,
79+
velocity_limit_sim=vel_limit_sim,
8080
stiffness=0.0,
8181
damping=10.0,
8282
),
@@ -900,7 +900,7 @@ def test_setting_gains_from_cfg_dict(self):
900900
torch.testing.assert_close(articulation.actuators["body"].stiffness, expected_stiffness)
901901
torch.testing.assert_close(articulation.actuators["body"].damping, expected_damping)
902902

903-
def test_setting_velocity_limits(self):
903+
def test_setting_velocity_sim_limits(self):
904904
"""Test that velocity limits are loaded form the configuration correctly."""
905905
for num_articulations in (1, 2):
906906
for device in ("cuda:0", "cpu"):
@@ -911,7 +911,7 @@ def test_setting_velocity_limits(self):
911911
) as sim:
912912
sim._app_control_on_stop_handle = None
913913
articulation_cfg = generate_articulation_cfg(
914-
articulation_type="single_joint", vel_limit=limit, effort_limit=limit
914+
articulation_type="single_joint", vel_limit_sim=limit, effort_limit_sim=limit
915915
)
916916
articulation, _ = generate_articulation(
917917
articulation_cfg=articulation_cfg, num_articulations=num_articulations, device=device
@@ -928,7 +928,7 @@ def test_setting_velocity_limits(self):
928928
)
929929
# Check that gains are loaded from USD file
930930
torch.testing.assert_close(
931-
articulation.actuators["joint"].velocity_limit, expected_velocity_limit
931+
articulation.actuators["joint"].velocity_limit_sim, expected_velocity_limit
932932
)
933933
torch.testing.assert_close(
934934
articulation.data.joint_velocity_limits, expected_velocity_limit

0 commit comments

Comments
 (0)