Skip to content

Updates NoiseModelWithAdditiveBias to apply per-feature bias sampling #2760

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

Merged
merged 10 commits into from
Jun 26, 2025
Merged
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.40.6"
version = "0.40.X"

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

## [Unreleased]
~~~~~~~~~~~~~~~

Changed
^^^^^^^

* Changed :class:`~isaaclab.utils.noise.noise_model.NoiseModelWithAdditiveBias` to sample each bias feature dimension independently.
Previously, for multi-dimensional data, e.g., a 3D position vector, all feature dimensions shared the same bias value.


0.40.6 (2025-06-12)
~~~~~~~~~~~~~~~~~~~

Expand Down
8 changes: 8 additions & 0 deletions source/isaaclab/isaaclab/utils/noise/noise_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def __init__(self, noise_model_cfg: noise_cfg.NoiseModelWithAdditiveBiasCfg, num
# store the bias noise configuration
self._bias_noise_cfg = noise_model_cfg.bias_noise_cfg
self._bias = torch.zeros((num_envs, 1), device=self._device)
self._feature_dim: int | None = None

def reset(self, env_ids: Sequence[int] | None = None):
"""Reset the noise model.
Expand All @@ -179,4 +180,11 @@ def apply(self, data: torch.Tensor) -> torch.Tensor:
Returns:
The data with the noise applied. Shape is the same as the input data.
"""
# on first apply, expand bias to match last dim of data
if self._feature_dim is None:
*_, self._feature_dim = data.shape
# expand bias from (num_envs,1) to (num_envs, feature_dim)
self._bias = self._bias.repeat(1, self._feature_dim)
# now re-sample that expanded bias in-place
self.reset()
return super().apply(data) + self._bias