Skip to content

Adds joint effort observation #2211

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion source/isaaclab/config/extension.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

# Note: Semantic Versioning is used: https://semver.org/
version = "0.36.3"
version = "0.37.0"

# Description
title = "Isaac Lab framework for Robot Learning"
Expand Down
9 changes: 9 additions & 0 deletions source/isaaclab/docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Changelog
---------

0.37.0 (2025-04-01)
~~~~~~~~~~~~~~~~~~

Added
~~~~~

* Added the :meth:`~isaaclab.env.mdp.observations.joint_effort`


0.36.4 (2025-03-24)
~~~~~~~~~~~~~~~~~~~

Expand Down
17 changes: 17 additions & 0 deletions source/isaaclab/isaaclab/envs/mdp/observations.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,23 @@ def joint_vel_rel(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityC
return asset.data.joint_vel[:, asset_cfg.joint_ids] - asset.data.default_joint_vel[:, asset_cfg.joint_ids]


def joint_effort(env: ManagerBasedEnv, asset_cfg: SceneEntityCfg = SceneEntityCfg("robot")) -> torch.Tensor:
"""The joint applied effort of the robot.

NOTE: Only the joints configured in :attr:`asset_cfg.joint_ids` will have their effort returned.

Args:
env: The environment.
asset_cfg: The SceneEntity associated with this observation.

Returns:
The joint effort (N or N-m) for joint_names in asset_cfg, shape is [num_env,num_joints].
"""
# extract the used quantities (to enable type-hinting)
asset: Articulation = env.scene[asset_cfg.name]
return asset.data.applied_torque[:, asset_cfg.joint_ids]


"""
Sensors.
"""
Expand Down