Commit 944245a2 authored by jaczhangnv's avatar jaczhangnv Committed by Kelly Guo

Improves XR teleop performance (#236)

# Description

- Updated the simulation parameters to improve the XR teleop performance

## Type of change

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

## 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
- [ ] 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

<!--
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
-->

---------
Co-authored-by: 's avatarRafael Wiltz <rwiltz@nvidia.com>
parent 027ba928
......@@ -38,10 +38,16 @@ class Se3HandTracking(DeviceBase):
"""
GRIP_HYSTERESIS_METERS: Final[float] = 0.05 # 2.0 inch
DELTA_POS_SCALE_FACTOR = 10
DELTA_ROT_SCALE_FACTOR = 10
def __init__(self, hand, abs=True, zero_out_xy_rotation=False, use_wrist_rotation=False):
def __init__(
self,
hand,
abs=True,
zero_out_xy_rotation=False,
use_wrist_rotation=False,
delta_pos_scale_factor=10,
delta_rot_scale_factor=10,
):
self._openxr = OpenXR()
self._previous_pos = np.zeros(3)
self._previous_rot = np.zeros(3)
......@@ -71,6 +77,8 @@ class Se3HandTracking(DeviceBase):
# Select RTX - RealTime for Renderer
viewport_api = get_active_viewport()
viewport_api.set_hd_engine("rtx", "RaytracedLighting")
self._delta_pos_scale_factor = delta_pos_scale_factor
self._delta_rot_scale_factor = delta_rot_scale_factor
def __del__(self):
return
......@@ -247,7 +255,7 @@ class Se3HandTracking(DeviceBase):
if not self._tracking:
return np.zeros(6)
return np.concatenate([delta_pos * self.DELTA_POS_SCALE_FACTOR, delta_rot * self.DELTA_ROT_SCALE_FACTOR])
return np.concatenate([delta_pos * self._delta_pos_scale_factor, delta_rot * self._delta_rot_scale_factor])
def _calculate_gripper_command(self, hand_joints):
index_tip = hand_joints[OpenXRSpec.HandJointEXT.XR_HAND_JOINT_INDEX_TIP_EXT]
......
......@@ -34,3 +34,10 @@ class FrankaCubeStackEnvCfg(stack_joint_pos_env_cfg.FrankaCubeStackEnvCfg):
scale=0.5,
body_offset=DifferentialInverseKinematicsActionCfg.OffsetCfg(pos=[0.0, 0.0, 0.107]),
)
# Set the simulation parameters
self.sim.dt = 1 / 60
self.sim.render_interval = 1
self.decimation = 3
self.episode_length_s = 20.0
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