Unverified Commit 5dae83eb authored by rwiltz's avatar rwiltz Committed by GitHub

Fixes the reach task regression with teleop devices returning the gripper (#3327)

Fixes the reach task regression with teleop devices returning the
gripper term

# Description
Fixes the reach task regression with teleop devices returning the
gripper. The reach task expects just the se3 term and not the gripper
term. We add a configuration parameter to the teleop devices which do
not use retargeters to conditional return the gripper term, and update
the reach env cfg to properly configure the teleop devices.
<!--
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
-->

Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context.
List any dependencies that are required for this change.

Fixes #3264 

<!-- 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)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- This change requires a documentation update

## 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
- [x] My changes generate no new warnings
- [x] 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: 's avatarrwiltz <165190220+rwiltz@users.noreply.github.com>
Co-authored-by: 's avatarKelly Guo <kellyg@nvidia.com>
parent 2f9298d7
...@@ -395,5 +395,10 @@ ...@@ -395,5 +395,10 @@
"package": "zipp", "package": "zipp",
"license" : "UNKNOWN", "license" : "UNKNOWN",
"comment": "MIT" "comment": "MIT"
},
{
"package": "fsspec",
"license" : "UNKNOWN",
"comment": "BSD"
} }
] ]
[package] [package]
# Note: Semantic Versioning is used: https://semver.org/ # Note: Semantic Versioning is used: https://semver.org/
version = "0.45.9" version = "0.45.10"
# Description # Description
title = "Isaac Lab framework for Robot Learning" title = "Isaac Lab framework for Robot Learning"
......
Changelog Changelog
--------- ---------
0.45.10 (2025-09-02)
~~~~~~~~~~~~~~~~~~~~
Fixed
^^^^^
* Fixed regression in reach task configuration where the gripper command was being returned.
* Added :attr:`~isaaclab.devices.Se3GamepadCfg.gripper_term` to :class:`~isaaclab.devices.Se3GamepadCfg`
to control whether the gamepad device should return a gripper command.
* Added :attr:`~isaaclab.devices.Se3SpaceMouseCfg.gripper_term` to :class:`~isaaclab.devices.Se3SpaceMouseCfg`
to control whether the spacemouse device should return a gripper command.
* Added :attr:`~isaaclab.devices.Se3KeyboardCfg.gripper_term` to :class:`~isaaclab.devices.Se3KeyboardCfg`
to control whether the keyboard device should return a gripper command.
0.45.9 (2025-08-27) 0.45.9 (2025-08-27)
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
......
...@@ -22,6 +22,7 @@ from ..device_base import DeviceBase, DeviceCfg ...@@ -22,6 +22,7 @@ from ..device_base import DeviceBase, DeviceCfg
class Se3GamepadCfg(DeviceCfg): class Se3GamepadCfg(DeviceCfg):
"""Configuration for SE3 gamepad devices.""" """Configuration for SE3 gamepad devices."""
gripper_term: bool = True
dead_zone: float = 0.01 # For gamepad devices dead_zone: float = 0.01 # For gamepad devices
pos_sensitivity: float = 1.0 pos_sensitivity: float = 1.0
rot_sensitivity: float = 1.6 rot_sensitivity: float = 1.6
...@@ -75,6 +76,7 @@ class Se3Gamepad(DeviceBase): ...@@ -75,6 +76,7 @@ class Se3Gamepad(DeviceBase):
self.pos_sensitivity = cfg.pos_sensitivity self.pos_sensitivity = cfg.pos_sensitivity
self.rot_sensitivity = cfg.rot_sensitivity self.rot_sensitivity = cfg.rot_sensitivity
self.dead_zone = cfg.dead_zone self.dead_zone = cfg.dead_zone
self.gripper_term = cfg.gripper_term
self._sim_device = cfg.sim_device self._sim_device = cfg.sim_device
# acquire omniverse interfaces # acquire omniverse interfaces
self._appwindow = omni.appwindow.get_default_app_window() self._appwindow = omni.appwindow.get_default_app_window()
...@@ -155,9 +157,11 @@ class Se3Gamepad(DeviceBase): ...@@ -155,9 +157,11 @@ class Se3Gamepad(DeviceBase):
# -- convert to rotation vector # -- convert to rotation vector
rot_vec = Rotation.from_euler("XYZ", delta_rot).as_rotvec() rot_vec = Rotation.from_euler("XYZ", delta_rot).as_rotvec()
# return the command and gripper state # return the command and gripper state
gripper_value = -1.0 if self._close_gripper else 1.0 command = np.concatenate([delta_pos, rot_vec])
delta_pose = np.concatenate([delta_pos, rot_vec]) if self.gripper_term:
command = np.append(delta_pose, gripper_value) gripper_value = -1.0 if self._close_gripper else 1.0
command = np.append(command, gripper_value)
return torch.tensor(command, dtype=torch.float32, device=self._sim_device) return torch.tensor(command, dtype=torch.float32, device=self._sim_device)
""" """
......
...@@ -22,6 +22,7 @@ from ..device_base import DeviceBase, DeviceCfg ...@@ -22,6 +22,7 @@ from ..device_base import DeviceBase, DeviceCfg
class Se3KeyboardCfg(DeviceCfg): class Se3KeyboardCfg(DeviceCfg):
"""Configuration for SE3 keyboard devices.""" """Configuration for SE3 keyboard devices."""
gripper_term: bool = True
pos_sensitivity: float = 0.4 pos_sensitivity: float = 0.4
rot_sensitivity: float = 0.8 rot_sensitivity: float = 0.8
retargeters: None = None retargeters: None = None
...@@ -67,6 +68,7 @@ class Se3Keyboard(DeviceBase): ...@@ -67,6 +68,7 @@ class Se3Keyboard(DeviceBase):
# store inputs # store inputs
self.pos_sensitivity = cfg.pos_sensitivity self.pos_sensitivity = cfg.pos_sensitivity
self.rot_sensitivity = cfg.rot_sensitivity self.rot_sensitivity = cfg.rot_sensitivity
self.gripper_term = cfg.gripper_term
self._sim_device = cfg.sim_device self._sim_device = cfg.sim_device
# acquire omniverse interfaces # acquire omniverse interfaces
self._appwindow = omni.appwindow.get_default_app_window() self._appwindow = omni.appwindow.get_default_app_window()
...@@ -139,9 +141,11 @@ class Se3Keyboard(DeviceBase): ...@@ -139,9 +141,11 @@ class Se3Keyboard(DeviceBase):
# convert to rotation vector # convert to rotation vector
rot_vec = Rotation.from_euler("XYZ", self._delta_rot).as_rotvec() rot_vec = Rotation.from_euler("XYZ", self._delta_rot).as_rotvec()
# return the command and gripper state # return the command and gripper state
gripper_value = -1.0 if self._close_gripper else 1.0 command = np.concatenate([self._delta_pos, rot_vec])
delta_pose = np.concatenate([self._delta_pos, rot_vec]) if self.gripper_term:
command = np.append(delta_pose, gripper_value) gripper_value = -1.0 if self._close_gripper else 1.0
command = np.append(command, gripper_value)
return torch.tensor(command, dtype=torch.float32, device=self._sim_device) return torch.tensor(command, dtype=torch.float32, device=self._sim_device)
""" """
......
...@@ -22,6 +22,7 @@ from .utils import convert_buffer ...@@ -22,6 +22,7 @@ from .utils import convert_buffer
class Se3SpaceMouseCfg(DeviceCfg): class Se3SpaceMouseCfg(DeviceCfg):
"""Configuration for SE3 space mouse devices.""" """Configuration for SE3 space mouse devices."""
gripper_term: bool = True
pos_sensitivity: float = 0.4 pos_sensitivity: float = 0.4
rot_sensitivity: float = 0.8 rot_sensitivity: float = 0.8
retargeters: None = None retargeters: None = None
...@@ -58,6 +59,7 @@ class Se3SpaceMouse(DeviceBase): ...@@ -58,6 +59,7 @@ class Se3SpaceMouse(DeviceBase):
# store inputs # store inputs
self.pos_sensitivity = cfg.pos_sensitivity self.pos_sensitivity = cfg.pos_sensitivity
self.rot_sensitivity = cfg.rot_sensitivity self.rot_sensitivity = cfg.rot_sensitivity
self.gripper_term = cfg.gripper_term
self._sim_device = cfg.sim_device self._sim_device = cfg.sim_device
# acquire device interface # acquire device interface
self._device = hid.device() self._device = hid.device()
...@@ -122,9 +124,11 @@ class Se3SpaceMouse(DeviceBase): ...@@ -122,9 +124,11 @@ class Se3SpaceMouse(DeviceBase):
- gripper command: Last element as a binary value (+1.0 for open, -1.0 for close). - gripper command: Last element as a binary value (+1.0 for open, -1.0 for close).
""" """
rot_vec = Rotation.from_euler("XYZ", self._delta_rot).as_rotvec() rot_vec = Rotation.from_euler("XYZ", self._delta_rot).as_rotvec()
delta_pose = np.concatenate([self._delta_pos, rot_vec]) command = np.concatenate([self._delta_pos, rot_vec])
gripper_value = -1.0 if self._close_gripper else 1.0 if self.gripper_term:
command = np.append(delta_pose, gripper_value) gripper_value = -1.0 if self._close_gripper else 1.0
command = np.append(command, gripper_value)
return torch.tensor(command, dtype=torch.float32, device=self._sim_device) return torch.tensor(command, dtype=torch.float32, device=self._sim_device)
""" """
......
...@@ -7,6 +7,10 @@ from dataclasses import MISSING ...@@ -7,6 +7,10 @@ from dataclasses import MISSING
import isaaclab.sim as sim_utils import isaaclab.sim as sim_utils
from isaaclab.assets import ArticulationCfg, AssetBaseCfg from isaaclab.assets import ArticulationCfg, AssetBaseCfg
from isaaclab.devices import DevicesCfg
from isaaclab.devices.gamepad import Se3GamepadCfg
from isaaclab.devices.keyboard import Se3KeyboardCfg
from isaaclab.devices.spacemouse import Se3SpaceMouseCfg
from isaaclab.envs import ManagerBasedRLEnvCfg from isaaclab.envs import ManagerBasedRLEnvCfg
from isaaclab.managers import ActionTermCfg as ActionTerm from isaaclab.managers import ActionTermCfg as ActionTerm
from isaaclab.managers import CurriculumTermCfg as CurrTerm from isaaclab.managers import CurriculumTermCfg as CurrTerm
...@@ -206,3 +210,20 @@ class ReachEnvCfg(ManagerBasedRLEnvCfg): ...@@ -206,3 +210,20 @@ class ReachEnvCfg(ManagerBasedRLEnvCfg):
self.viewer.eye = (3.5, 3.5, 3.5) self.viewer.eye = (3.5, 3.5, 3.5)
# simulation settings # simulation settings
self.sim.dt = 1.0 / 60.0 self.sim.dt = 1.0 / 60.0
self.teleop_devices = DevicesCfg(
devices={
"keyboard": Se3KeyboardCfg(
gripper_term=False,
sim_device=self.sim.device,
),
"gamepad": Se3GamepadCfg(
gripper_term=False,
sim_device=self.sim.device,
),
"spacemouse": Se3SpaceMouseCfg(
gripper_term=False,
sim_device=self.sim.device,
),
},
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment