Commit 901c0e22 authored by David Hoeller's avatar David Hoeller

Modifies the teleop_se3_agent example reset logic (#112)

# Description

Before, the target cube position in the teleop_se3_agent example was
being reset every 5 seconds.
Now, it is only modified when the cube reaches the target.

## 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 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
parent 293a6c2b
...@@ -38,8 +38,10 @@ import torch ...@@ -38,8 +38,10 @@ import torch
import carb import carb
from omni.isaac.lab.devices import Se3Gamepad, Se3Keyboard, Se3SpaceMouse from omni.isaac.lab.devices import Se3Gamepad, Se3Keyboard, Se3SpaceMouse
from omni.isaac.lab.managers import TerminationTermCfg as DoneTerm
import omni.isaac.lab_tasks # noqa: F401 import omni.isaac.lab_tasks # noqa: F401
from omni.isaac.lab_tasks.manager_based.manipulation.lift import mdp
from omni.isaac.lab_tasks.utils import parse_env_cfg from omni.isaac.lab_tasks.utils import parse_env_cfg
...@@ -66,7 +68,11 @@ def main(): ...@@ -66,7 +68,11 @@ def main():
) )
# modify configuration # modify configuration
env_cfg.terminations.time_out = None env_cfg.terminations.time_out = None
if "Lift" in args_cli.task:
# set the resampling time range to large number to avoid resampling
env_cfg.commands.object_pose.resampling_time_range = (1.0e9, 1.0e9)
# add termination condition for reaching the goal otherwise the environment won't reset
env_cfg.terminations.object_reached_goal = DoneTerm(func=mdp.object_reached_goal)
# create environment # create environment
env = gym.make(args_cli.task, cfg=env_cfg) env = gym.make(args_cli.task, cfg=env_cfg)
# check environment name (for reach , we don't allow the gripper) # check environment name (for reach , we don't allow the gripper)
......
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