From de2fe974c27545c59e691f85f62b6ef68c4123a7 Mon Sep 17 00:00:00 2001 From: "-T.K.-" Date: Wed, 15 Jan 2025 11:49:04 -0800 Subject: [PATCH] Fix typo in Anymal C DirectRL environment (#1683) # Description This PR fixes a small typo in the code, where "undesired" is accidentally typed as "undersired". ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update ## Screenshots N/A ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [ ] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --- .../omni/isaac/lab_tasks/direct/anymal_c/anymal_c_env.py | 4 ++-- .../omni/isaac/lab_tasks/direct/anymal_c/anymal_c_env_cfg.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/anymal_c/anymal_c_env.py b/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/anymal_c/anymal_c_env.py index a6125c4f41..006e859659 100644 --- a/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/anymal_c/anymal_c_env.py +++ b/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/anymal_c/anymal_c_env.py @@ -130,7 +130,7 @@ def _get_rewards(self) -> torch.Tensor: air_time = torch.sum((last_air_time - 0.5) * first_contact, dim=1) * ( torch.norm(self._commands[:, :2], dim=1) > 0.1 ) - # undersired contacts + # undesired contacts net_contact_forces = self._contact_sensor.data.net_forces_w_history is_contact = ( torch.max(torch.norm(net_contact_forces[:, :, self._undesired_contact_body_ids], dim=-1), dim=1)[0] > 1.0 @@ -148,7 +148,7 @@ def _get_rewards(self) -> torch.Tensor: "dof_acc_l2": joint_accel * self.cfg.joint_accel_reward_scale * self.step_dt, "action_rate_l2": action_rate * self.cfg.action_rate_reward_scale * self.step_dt, "feet_air_time": air_time * self.cfg.feet_air_time_reward_scale * self.step_dt, - "undesired_contacts": contacts * self.cfg.undersired_contact_reward_scale * self.step_dt, + "undesired_contacts": contacts * self.cfg.undesired_contact_reward_scale * self.step_dt, "flat_orientation_l2": flat_orientation * self.cfg.flat_orientation_reward_scale * self.step_dt, } reward = torch.sum(torch.stack(list(rewards.values())), dim=0) diff --git a/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/anymal_c/anymal_c_env_cfg.py b/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/anymal_c/anymal_c_env_cfg.py index fed4e725bb..062b2e9bdd 100644 --- a/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/anymal_c/anymal_c_env_cfg.py +++ b/source/extensions/omni.isaac.lab_tasks/omni/isaac/lab_tasks/direct/anymal_c/anymal_c_env_cfg.py @@ -107,7 +107,7 @@ class AnymalCFlatEnvCfg(DirectRLEnvCfg): joint_accel_reward_scale = -2.5e-7 action_rate_reward_scale = -0.01 feet_air_time_reward_scale = 0.5 - undersired_contact_reward_scale = -1.0 + undesired_contact_reward_scale = -1.0 flat_orientation_reward_scale = -5.0