Skip to content

Commit

Permalink
Fixes articulation indexing (isaac-sim#478)
Browse files Browse the repository at this point in the history
# Description

Fixes articulation indexing.

Fixes # [472](isaac-sim#472)

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## 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 run all the tests with `./isaaclab.sh --test` and they pass
- [ ] 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
  • Loading branch information
Dhoeller19 authored Jun 10, 2024
1 parent 133c61c commit b468546
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def write_joint_state_to_sim(
physx_env_ids = self._ALL_INDICES
if joint_ids is None:
joint_ids = slice(None)
elif env_ids != slice(None):
if env_ids != slice(None) and joint_ids != slice(None):
env_ids = env_ids[:, None]
# set into internal buffers
self._data.joint_pos[env_ids, joint_ids] = position
Expand Down Expand Up @@ -377,7 +377,7 @@ def write_joint_stiffness_to_sim(
physx_env_ids = self._ALL_INDICES
if joint_ids is None:
joint_ids = slice(None)
elif env_ids != slice(None):
if env_ids != slice(None) and joint_ids != slice(None):
env_ids = env_ids[:, None]
# set into internal buffers
self._data.joint_stiffness[env_ids, joint_ids] = stiffness
Expand Down Expand Up @@ -407,7 +407,7 @@ def write_joint_damping_to_sim(
physx_env_ids = self._ALL_INDICES
if joint_ids is None:
joint_ids = slice(None)
elif env_ids != slice(None):
if env_ids != slice(None) and joint_ids != slice(None):
env_ids = env_ids[:, None]
# set into internal buffers
self._data.joint_damping[env_ids, joint_ids] = damping
Expand Down Expand Up @@ -435,7 +435,7 @@ def write_joint_effort_limit_to_sim(
physx_env_ids = self._ALL_INDICES
if joint_ids is None:
joint_ids = slice(None)
elif env_ids != slice(None):
if env_ids != slice(None) and joint_ids != slice(None):
env_ids = env_ids[:, None]
# move tensor to cpu if needed
if isinstance(limits, torch.Tensor):
Expand Down Expand Up @@ -466,7 +466,7 @@ def write_joint_armature_to_sim(
physx_env_ids = self._ALL_INDICES
if joint_ids is None:
joint_ids = slice(None)
elif env_ids != slice(None):
if env_ids != slice(None) and joint_ids != slice(None):
env_ids = env_ids[:, None]
# set into internal buffers
self._data.joint_armature[env_ids, joint_ids] = armature
Expand All @@ -493,7 +493,7 @@ def write_joint_friction_to_sim(
physx_env_ids = self._ALL_INDICES
if joint_ids is None:
joint_ids = slice(None)
elif env_ids != slice(None):
if env_ids != slice(None) and joint_ids != slice(None):
env_ids = env_ids[:, None]
# set into internal buffers
self._data.joint_friction[env_ids, joint_ids] = joint_friction
Expand Down Expand Up @@ -521,7 +521,7 @@ def write_joint_limits_to_sim(
physx_env_ids = self._ALL_INDICES
if joint_ids is None:
joint_ids = slice(None)
elif env_ids != slice(None):
if env_ids != slice(None) and joint_ids != slice(None):
env_ids = env_ids[:, None]
# set into internal buffers
self._data.joint_limits[env_ids, joint_ids] = limits
Expand Down Expand Up @@ -551,7 +551,7 @@ def set_joint_position_target(
env_ids = slice(None)
if joint_ids is None:
joint_ids = slice(None)
elif env_ids != slice(None):
if env_ids != slice(None) and joint_ids != slice(None):
env_ids = env_ids[:, None]
# set targets
self._data.joint_pos_target[env_ids, joint_ids] = target
Expand All @@ -575,7 +575,7 @@ def set_joint_velocity_target(
env_ids = slice(None)
if joint_ids is None:
joint_ids = slice(None)
elif env_ids != slice(None):
if env_ids != slice(None) and joint_ids != slice(None):
env_ids = env_ids[:, None]
# set targets
self._data.joint_vel_target[env_ids, joint_ids] = target
Expand All @@ -599,7 +599,7 @@ def set_joint_effort_target(
env_ids = slice(None)
if joint_ids is None:
joint_ids = slice(None)
elif env_ids != slice(None):
if env_ids != slice(None) and joint_ids != slice(None):
env_ids = env_ids[:, None]
# set targets
self._data.joint_effort_target[env_ids, joint_ids] = target
Expand All @@ -626,7 +626,7 @@ def set_fixed_tendon_stiffness(
env_ids = slice(None)
if fixed_tendon_ids is None:
fixed_tendon_ids = slice(None)
elif env_ids != slice(None):
if env_ids != slice(None) and fixed_tendon_ids != slice(None):
env_ids = env_ids[:, None]
# set stiffness
self._data.fixed_tendon_stiffness[env_ids, fixed_tendon_ids] = stiffness
Expand All @@ -653,7 +653,7 @@ def set_fixed_tendon_damping(
env_ids = slice(None)
if fixed_tendon_ids is None:
fixed_tendon_ids = slice(None)
elif env_ids != slice(None):
if env_ids != slice(None) and fixed_tendon_ids != slice(None):
env_ids = env_ids[:, None]
# set damping
self._data.fixed_tendon_damping[env_ids, fixed_tendon_ids] = damping
Expand All @@ -680,7 +680,7 @@ def set_fixed_tendon_limit_stiffness(
env_ids = slice(None)
if fixed_tendon_ids is None:
fixed_tendon_ids = slice(None)
elif env_ids != slice(None):
if env_ids != slice(None) and fixed_tendon_ids != slice(None):
env_ids = env_ids[:, None]
# set limit_stiffness
self._data.fixed_tendon_limit_stiffness[env_ids, fixed_tendon_ids] = limit_stiffness
Expand All @@ -707,7 +707,7 @@ def set_fixed_tendon_limit(
env_ids = slice(None)
if fixed_tendon_ids is None:
fixed_tendon_ids = slice(None)
elif env_ids != slice(None):
if env_ids != slice(None) and fixed_tendon_ids != slice(None):
env_ids = env_ids[:, None]
# set limit
self._data.fixed_tendon_limit[env_ids, fixed_tendon_ids] = limit
Expand All @@ -734,7 +734,7 @@ def set_fixed_tendon_rest_length(
env_ids = slice(None)
if fixed_tendon_ids is None:
fixed_tendon_ids = slice(None)
elif env_ids != slice(None):
if env_ids != slice(None) and fixed_tendon_ids != slice(None):
env_ids = env_ids[:, None]
# set rest_length
self._data.fixed_tendon_rest_length[env_ids, fixed_tendon_ids] = rest_length
Expand All @@ -761,7 +761,7 @@ def set_fixed_tendon_offset(
env_ids = slice(None)
if fixed_tendon_ids is None:
fixed_tendon_ids = slice(None)
elif env_ids != slice(None):
if env_ids != slice(None) and fixed_tendon_ids != slice(None):
env_ids = env_ids[:, None]
# set offset
self._data.fixed_tendon_offset[env_ids, fixed_tendon_ids] = offset
Expand Down

0 comments on commit b468546

Please sign in to comment.